Re: crash in pscsi_get_device_type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 27, Nicholas A. Bellinger wrote:

> On Thu, 2015-02-26 at 10:26 +0100, Olaf Hering wrote:

> > [  145.661468] IP: [<ffffffffa024f17b>] pscsi_get_device_type+0xb/0x20 [target_core_pscsi]
> Looks like a PSCSI specific NULL pointer dereference when reading the
> dev_type attribute if a backend device was not able to be successfully
> configured -> enabled.
> 
> Here's a quick patch to address this case.  Please confirm on your end.

Unfortunately I can not reproduce it anymore. Maybe it depends on the .config?

Olaf

> diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
> index 1045dcd..f6c954c 100644
> --- a/drivers/target/target_core_pscsi.c
> +++ b/drivers/target/target_core_pscsi.c
> @@ -1121,7 +1121,7 @@ static u32 pscsi_get_device_type(struct se_device *dev)
>         struct pscsi_dev_virt *pdv = PSCSI_DEV(dev);
>         struct scsi_device *sd = pdv->pdv_sd;
>  
> -       return sd->type;
> +       return (sd) ? sd->type : TYPE_NO_LUN;
>  }
>  
>  static sector_t pscsi_get_blocks(struct se_device *dev)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux