Re: [GIT PULL] s390 patches for 2.6.39-rc4

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

 



On Tue, 26 Apr 2011 11:38:22 -0700
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> I'll pull this, but:
> 
> On Tue, Apr 26, 2011 at 2:03 AM, Martin Schwidefsky
> <schwidefsky@xxxxxxxxxx> wrote:
> >
> > Jan Glauber (3):
> > Â Â Â[S390] prng: prevent access beyond end of stack
> 
> I don't think that's _still_ correct.
> 
> Just looking at the diff, it looks broken:
> 
> > Â Â Â Â/* Add the entropy */
> > Â Â Â Âwhile (nbytes >= 8) {
> > - Â Â Â Â Â Â Â *((__u64 *)parm_block) ^= *((__u64 *)buf+i*8);
> > + Â Â Â Â Â Â Â *((__u64 *)parm_block) ^= *((__u64 *)buf+i);
> > Â Â Â Â Â Â Â Âprng_add_entropy();
> > Â Â Â Â Â Â Â Âi += 8;
> > Â Â Â Â Â Â Â Ânbytes -= 8;
> 
> The "i += 8" implies that "i" is a byte offset.
> 
> But "(__u64 *)buf+i" will parse as "((__u64 *)buf) + i" and thus still
> do another multiply-by-eight.
> 
> So the diff fixes one "off by a factor of 8", but not another, if I
> read it right.
> 
> So the parenthesis should be moved around to something like "*(__u64
> *) (buf+i)", I think.

Urgs, pointer arithmetic for dummies..  it is indeed still wrong. We'll fix.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" 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]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux