Skip to content

Commit

Permalink
Merge pull request #253 from Gottox/improve/inode-map-deadlock
Browse files Browse the repository at this point in the history
inode_map: fix deadlock when the inode map encounters inconsistencies
  • Loading branch information
Gottox committed Jun 2, 2024
2 parents eb777b2 + c0a590d commit 9755f40
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions libsqsh/src/archive/inode_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,14 @@ dyn_map_set(
const uint64_t old_value = ~inner_inode_refs[inner_index];
inner_inode_refs[inner_index] = ~inode_ref;
if (old_value != EMPTY_INODE_REF && old_value != inode_ref) {
return -SQSH_ERROR_INODE_MAP_IS_INCONSISTENT;
rv = -SQSH_ERROR_INODE_MAP_IS_INCONSISTENT;
goto out;
}
}

rv = sqsh__mutex_unlock(map->mutex);
if (rv < 0) {
return rv;
}
return 0;
out:
sqsh__mutex_unlock(map->mutex);
return rv;
}

static int
Expand Down
1 change: 1 addition & 0 deletions test/fuzzer/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fuzzer_repro = files(
'crash_e770c992b26a129aaeea42993b2a9b06ba91faca',
'crash_f7bc33d88bbc6a270c32bc6969059a0c44c49dd4',
'leak_2f97e04d5e7167856ba0827c10939690d203cb54',
'timeout-ed751e8e6821ce6ef7947a1133b8845f27e28ebd',
)

utest_dep = dependency('utest')
Expand Down
Binary file not shown.

0 comments on commit 9755f40

Please sign in to comment.