mbox series

[0/2] btrfs: Move dereference behind null checks

Message ID 20191207221818.3641-1-sebastian.scherbel@fau.de (mailing list archive)
Headers show
Series btrfs: Move dereference behind null checks | expand

Message

Sebastian Dec. 7, 2019, 10:18 p.m. UTC
From: Sebastian Scherbel <sebastian.scherbel@fau.de>

Regarding Bug 205003, points 1 and 2
This patch series moves two dereferences after the null check to avoid
a possible null pointer dereference.

Sebastian Scherbel (2):
  btrfs: Move dereference behind null check in check integrity
  btrfs: Move dereference behind null check in check volumes

 fs/btrfs/check-integrity.c | 4 +++-
 fs/btrfs/volumes.c         | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Johannes Thumshirn Dec. 9, 2019, 9:30 a.m. UTC | #1
On 07/12/2019 23:18, Sebastian wrote:
> From: Sebastian Scherbel <sebastian.scherbel@fau.de>
> 
> Regarding Bug 205003, points 1 and 2
> This patch series moves two dereferences after the null check to avoid
> a possible null pointer dereference.
> 
> Sebastian Scherbel (2):
>   btrfs: Move dereference behind null check in check integrity
>   btrfs: Move dereference behind null check in check volumes
> 
>  fs/btrfs/check-integrity.c | 4 +++-
>  fs/btrfs/volumes.c         | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 


Hi,

I've already submitted a series addressing these and David merged it:
https://lore.kernel.org/linux-btrfs/20191205131959.19184-1-jth@kernel.org/
David Sterba Dec. 9, 2019, 4:11 p.m. UTC | #2
On Mon, Dec 09, 2019 at 10:30:06AM +0100, Johannes Thumshirn wrote:
> On 07/12/2019 23:18, Sebastian wrote:
> > From: Sebastian Scherbel <sebastian.scherbel@fau.de>
> > 
> > Regarding Bug 205003, points 1 and 2
> > This patch series moves two dereferences after the null check to avoid
> > a possible null pointer dereference.
> > 
> > Sebastian Scherbel (2):
> >   btrfs: Move dereference behind null check in check integrity
> >   btrfs: Move dereference behind null check in check volumes
> > 
> >  fs/btrfs/check-integrity.c | 4 +++-
> >  fs/btrfs/volumes.c         | 4 +++-
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> > 
> 
> I've already submitted a series addressing these and David merged it:
> https://lore.kernel.org/linux-btrfs/20191205131959.19184-1-jth@kernel.org/

Yes, that's been in misc-next since ~friday, I'm not sure when I pushed
the branch.

Sebastian, thanks for the patches, this sometimes happens that the work
is duplicated. Johannes removed the BUG_ON and WARN_ON completely though
your change is also correct assuming that the two are not redundant.