From: James Bottomley <jejb@linux.vnet.ibm.com>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Meelis Roos <mroos@linux.ee>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Hannes Reinecke <hare@suse.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: UBSAN: Undefined behaviour in drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31
Date: Thu, 12 May 2016 22:26:42 -0700 [thread overview]
Message-ID: <1463117202.2380.88.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAKb7Uvh8U1ncRg1jCnAVrdew=HyF+jNpY6=MknHgKyJmAdJEkw@mail.gmail.com>
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
prev parent reply other threads:[~2016-05-13 5:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 16:02 UBSAN: Undefined behaviour in drivers/scsi/aic7xxx/aic7xxx_core.c:2831:31 Meelis Roos
2016-05-12 20:08 ` James Bottomley
2016-05-12 21:56 ` Ilia Mirkin
2016-05-13 5:26 ` James Bottomley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463117202.2380.88.camel@linux.vnet.ibm.com \
--to=jejb@linux.vnet.ibm.com \
--cc=hare@suse.com \
--cc=imirkin@alum.mit.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mroos@linux.ee \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox