mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Re: [GIT PULL] s390 patches for 2.6.39-rc4
Date: Wed, 27 Apr 2011 08:37:42 +0200	[thread overview]
Message-ID: <20110427083742.084bda90@mschwide.boeblingen.de.ibm.com> (raw)
In-Reply-To: <BANLkTik_SMi17rgLVss9esoez9OeHEhN0w@mail.gmail.com>

On Tue, 26 Apr 2011 11:38:22 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> I'll pull this, but:
> 
> On Tue, Apr 26, 2011 at 2:03 AM, Martin Schwidefsky
> <schwidefsky@de.ibm.com> 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.


      reply	other threads:[~2011-04-27  6:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26  9:03 Martin Schwidefsky
2011-04-26 18:38 ` Linus Torvalds
2011-04-27  6:37   ` Martin Schwidefsky [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=20110427083742.084bda90@mschwide.boeblingen.de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®