On Sun, Oct 27, 2024 at 07:46:52PM +0000, Piotr Zalewski wrote:
> Add NULL check for key returned from bch2_btree_and_journal_iter_peek in
> btree_node_iter_and_journal_peek to avoid NULL ptr dereference in
> bch2_bkey_buf_reassemble.
> 
> When key returned from bch2_btree_and_journal_iter_peek is NULL it means
> that btree topology needs repair. Print topology error message with
> position at which node wasn't found, its parent node information and
> btree_id with level.
> 
> Return error code returned by bch2_topology_error to ensure that topology
> error is handled properly by recovery.
> 
> Reported-by: [email protected]
> Closes: https://syzkaller.appspot.com/bug?extid=005ef9aa519f30d97657
> Fixes: 5222a4607cd8 ("bcachefs: BTREE_ITER_WITH_JOURNAL")
> Suggested-by: Alan Huang <[email protected]>
> Suggested-by: Kent Overstreet <[email protected]>
> Signed-off-by: Piotr Zalewski <[email protected]>

Thanks - applied.

Reply via email to