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]
Date:	Tue, 4 Mar 2008 09:01:51 +0800
From:	"Peter Teoh" <htmldeveloper@...il.com>
To:	"Bartlomiej Zolnierkiewicz" <bzolnier@...il.com>
Cc:	"Adrian Bunk" <bunk@...nel.org>, linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: ide_register_hw(): buggy code

On Tue, Mar 4, 2008 at 6:29 AM, Bartlomiej Zolnierkiewicz
<bzolnier@...il.com> wrote:
>
>  Hi,
>
>
>  On Monday 03 March 2008, Peter Teoh wrote:
>  > On Sun, Mar 2, 2008 at 11:19 PM, Adrian Bunk <bunk@...nel.org> wrote:
>  > > The Coverity checker spotted the following bogus change to
>  > >  ide_register_hw() in commit 9e016a719209d95338e314b46c3012cc7feaaeec:
>  > >
>  > >  <--  snip  -->
>  > >
>  > >  ...
>  > >  +               hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]);
>  > >  +               index = hwif->index;
>  > >  +               if (hwif)
>  > >  +                       goto found;
>  > >                 for (index = 0; index < MAX_HWIFS; index++)
>  > >  ...
>  > >
>  > >  <--  snip  -->
>  > >
>  > >  It's impossible to reach the for() loop without Oopsing before.
>
>  [ iff free hwif is not found (unlikely case) ]
>
>
>  > >  Can you either fix this for 2.6.25 or push your patch that removes
>  > >  ide_register_hw() for 2.6.25?
>  > >
>  >
>  > My question is:
>  >
>  > a.   why is "retry=1", and then the do while loop always end up the
>  > loop being one round executed only?   Why not just remove the while
>  > loop entirely?
>
>  the whole ide_register_hw() is already gone in IDE tree
>  (these patches are scheduled for 2.6.26)
>
>
>  > b.   not sure if your statement above implied this, but checking for
>  > hwif!=0 should be before index.  ???
>  >
>  > c.   "index = hwif->index;" should not be there, but after "found".
>  > Is that correct?
>
>  Yes, could you please re-do your patch to contain:
>
>  - only 'hwif->index' change
>  - proper patch description
>  - Signed-off-by: line
>
>  so I could merge it?


Description:

Relocating the index to come after finding the hwif pointer.

Thanks.

-- 
Regards,
Peter Teoh

View attachment "relocating_deriving_index.patch" of type "text/x-patch" (614 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ