mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: David Rientjes <rientjes@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Henrik Grindal Bakken <henribak@cisco.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] Avoid using hardcoded values in kernel/sys.c
Date: Mon, 17 Oct 2011 18:21:13 -0700	[thread overview]
Message-ID: <1318900873.1846.1.camel@Joe-Laptop> (raw)
In-Reply-To: <alpine.DEB.2.00.1110171752300.19024@chino.kir.corp.google.com>

On Mon, 2011-10-17 at 17:55 -0700, David Rientjes wrote:
> The release field of struct new_utsname may always change, so avoid
> hardcoded values when setting up a buffer to copy to it.

I don't think this is correct.

> diff --git a/kernel/sys.c b/kernel/sys.c
[]
> -static int override_release(char __user *release, int len)
> +static int override_release(char __user *release)
>  {
> +	const int len = sizeof(release);
>  	int ret = 0;
> -	char buf[65];
> +	char buf[len];

sizeof(release) = 4 or 8



      parent reply	other threads:[~2011-10-18  1:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18  0:55 David Rientjes
2011-10-18  1:20 ` Linus Torvalds
2011-10-18  1:33   ` David Rientjes
2011-10-18  1:43     ` Linus Torvalds
2011-10-18  1:21 ` Joe Perches [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=1318900873.1846.1.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=benh@kernel.crashing.org \
    --cc=henribak@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    --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®