Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1400500

Re: UBSAN: Undefined behaviour in drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31

From James Bottomley <jejb@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: UBSAN: Undefined behaviour in drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31
Date 2016-05-13 07:30 +0200
Message-ID <rydPI-4W7-3@gated-at.bofh.it> (permalink)
References <ry1vb-ZS-13@gated-at.bofh.it> <ry55M-4p6-11@gated-at.bofh.it> <ry6Oe-6hp-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2016-05-12 at 17:56 -0400, Ilia Mirkin wrote:
> On Thu, May 12, 2016 at 4:08 PM, James Bottomley
> <jejb@linux.vnet.ibm.com> wrote:
> > On Thu, 2016-05-12 at 19:02 +0300, Meelis Roos wrote:
> > > This is from a dual-AthlonMP 32-bit x86 system with onboard
> > > Adaptec
> > > SCSI
> > > controller, once during bootup.
> > > 
> > > [    4.896307]
> > > =================================================================
> > > ====
> > > ===========
> > > [    4.896471] UBSAN: Undefined behaviour in
> > > drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31
> > > [    4.896629] shift exponent -1 is negative
> > 
> > Is this some sort of false positive?  The shift in question is
> > 
> >         devinfo->target_mask = (0x01 << devinfo->target_offset);
> > 
> > The code which calls this in ahc_linux_initialize_scsi_bus() looks
> > to
> > be looping from 0-16 (or variations).  Since the value passed in is
> > unsigned, it would have to be set to ~0, which doesn't seem
> > possible.
> 
> It's getting called from ahc_reset_channel, which does:
> 
>         ahc_compile_devinfo(&devinfo,
>                             CAM_TARGET_WILDCARD,
>                             CAM_TARGET_WILDCARD,
>                             CAM_LUN_WILDCARD,
>                             channel, ROLE_UNKNOWN);
> 
> drivers/scsi/aic7xxx/cam.h:#define      CAM_TARGET_WILDCARD 
> ((u_int)~0)

OK, thanks, you can mark it as a false positive because only the SPI
parameters are actually used for this version of devinfo.

James

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

UBSAN: Undefined behaviour in  drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31 Meelis Roos <mroos@linux.ee> - 2016-05-12 18:20 +0200
  Re: UBSAN: Undefined behaviour in  drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31 James Bottomley <jejb@linux.vnet.ibm.com> - 2016-05-12 22:10 +0200
    Re: UBSAN: Undefined behaviour in drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31 Ilia Mirkin <imirkin@alum.mit.edu> - 2016-05-13 00:00 +0200
      Re: UBSAN: Undefined behaviour in  drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31 James Bottomley <jejb@linux.vnet.ibm.com> - 2016-05-13 07:30 +0200

csiph-web