lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1907121243220.3900@hadrien>
Date:   Fri, 12 Jul 2019 12:43:52 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Hannes Reinecke <hare@...e.de>
cc:     Colin King <colin.king@...onical.com>,
        "James E . J . Bottomley" <jejb@...ux.ibm.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        linux-scsi@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: libfc: fix null pointer dereference on a null
 lport



On Fri, 12 Jul 2019, Hannes Reinecke wrote:

> On 7/2/19 11:18 AM, Colin King wrote:
> > From: Colin Ian King <colin.king@...onical.com>
> >
> > Currently if lport is null then the null lport pointer is dereference
> > when printing out debug via the FC_LPORT_DB macro. Fix this by using
> > the more generic FC_LIBFC_DBG debug macro instead that does not use
> > lport.
> >
> > Addresses-Coverity: ("Dereference after null check")
> > Fixes: 7414705ea4ae ("libfc: Add runtime debugging with debug_logging module parameter")
> > Signed-off-by: Colin Ian King <colin.king@...onical.com>
> > ---
> >  drivers/scsi/libfc/fc_exch.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
> > index 025cd2ff9f65..c477fadbf504 100644
> > --- a/drivers/scsi/libfc/fc_exch.c
> > +++ b/drivers/scsi/libfc/fc_exch.c
> > @@ -2591,8 +2591,8 @@ void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp)
> >
> >  	/* lport lock ? */
> >  	if (!lport || lport->state == LPORT_ST_DISABLED) {
> > -		FC_LPORT_DBG(lport, "Receiving frames for an lport that "
> > -			     "has not been initialized correctly\n");
> > +		FC_LIBFC_DBG("Receiving frames for an lport that "
> > +			     "has not been initialized correctly\n");

If the code is being changed, perhaps the string could be put onto one
line as well.

julia

> >  		fc_frame_free(fp);
> >  		return;
> >  	}
> >
> Reviewed-by: Hannes Reinecke <hare@...e.com>
>
> Cheers,
>
> Hannes
> --
> Dr. Hannes Reinecke		   Teamlead Storage & Networking
> hare@...e.de			               +49 911 74053 688
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
> HRB 21284 (AG Nürnberg)
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ