projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9dd89a0
)
bcachefs: Fix a null ptr deref
author
Kent Overstreet
<kent.overstreet@gmail.com>
Sun, 23 May 2021 22:42:51 +0000
(18:42 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:04 +0000
(17:09 -0400)
bch2_btree_iter_peek() won't always return a key - whoops.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/move.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/move.c
b/fs/bcachefs/move.c
index bce10eb4eb4c6a080765478d44360b578866e33a..8807b18ddc433a1059de43873377752c8bb46bfb 100644
(file)
--- a/
fs/bcachefs/move.c
+++ b/
fs/bcachefs/move.c
@@
-522,6
+522,11
@@
static int lookup_inode(struct btree_trans *trans, struct bpos pos,
if (ret)
goto err;
+ if (!k.k || bkey_cmp(k.k->p, pos)) {
+ ret = -ENOENT;
+ goto err;
+ }
+
ret = k.k->type == KEY_TYPE_inode ? 0 : -EIO;
if (ret)
goto err;