Re: [PATCH 2/8] block/export: Fix null pointer dereference in error path

2023-05-12 Thread Eric Blake
On Fri, May 12, 2023 at 11:16:03AM -0500, Eric Blake wrote: > > > On Wed, May 10, 2023 at 10:35:55PM +0200, Kevin Wolf wrote: > > > > There are some error paths in blk_exp_add() that jump to 'fail:' before > > 'exp' is even created. So we can't just unconditionally access exp->blk. > > > > Ad

Re: [PATCH 2/8] block/export: Fix null pointer dereference in error path

2023-05-12 Thread Eric Blake
On Wed, May 10, 2023 at 10:35:55PM +0200, Kevin Wolf wrote: > > There are some error paths in blk_exp_add() that jump to 'fail:' before > 'exp' is even created. So we can't just unconditionally access exp->blk. > > Add a NULL check, and switch from exp->blk to blk, which is available > earlier,

Re: [PATCH 2/8] block/export: Fix null pointer dereference in error path

2023-05-12 Thread Peter Maydell
On Wed, 10 May 2023 at 21:38, Kevin Wolf wrote: > > There are some error paths in blk_exp_add() that jump to 'fail:' before > 'exp' is even created. So we can't just unconditionally access exp->blk. > > Add a NULL check, and switch from exp->blk to blk, which is available > earlier, just to be ext

[PATCH 2/8] block/export: Fix null pointer dereference in error path

2023-05-10 Thread Kevin Wolf
There are some error paths in blk_exp_add() that jump to 'fail:' before 'exp' is even created. So we can't just unconditionally access exp->blk. Add a NULL check, and switch from exp->blk to blk, which is available earlier, just to be extra sure that we really cover all cases where BlockDevOps cou