mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: torvalds@osdl.org, akpm@linux-foundation.org,
	ralf@linux-mips.org, linux-kernel@vger.kernel.org,
	Russell King <rmk+kernel@arm.linux.org.uk>
Subject: Re: [PATCH] Make do_execve() take a const filename pointer
Date: Wed, 18 Aug 2010 13:50:45 +0800	[thread overview]
Message-ID: <20100818055045.GD5243@cr0.nay.redhat.com> (raw)
In-Reply-To: <20100817225256.4775.6641.stgit@warthog.procyon.org.uk>

On Tue, Aug 17, 2010 at 11:52:56PM +0100, David Howells wrote:
>Make do_execve() take a const filename pointer so that kernel_execve() compiles
>correctly on ARM:
>
>arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type
>
>This also requires the argv and envp arguments to be consted twice, once for
>the pointer array and once for the strings the array points to.  This is
>because do_execve() passes a pointer to the filename (now const) to
>copy_strings_kernel().  A simpler alternative would be to cast the filename
>pointer in do_execve() when it's passed to copy_strings_kernel().
>
>do_execve() may not change any of the strings it is passed as part of the argv
>or envp lists as they are some of them in .rodata, so marking these strings as
>const should be fine.
>
>Further kernel_execve() and sys_execve() need to be changed to match.
>
>This has been test built on x86_64, frv, arm and mips.
>
>Signed-off-by: David Howells <dhowells@redhat.com>
>Tested-by: Ralf Baechle <ralf@linux-mips.org>
>Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

I encountered the same issue when I worked on UML, I wanted to fix this,
but it needs lots of efforts. Thanks a lot for doing this!

This patch looks good for me,

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>

  reply	other threads:[~2010-08-18  5:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17 22:52 David Howells
2010-08-18  5:50 ` Américo Wang [this message]
2010-08-18 16:41   ` Tony Luck
2010-08-18 17:23   ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2010-08-17 14:07 David Howells
2010-08-17 15:25 ` Russell King

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=20100818055045.GD5243@cr0.nay.redhat.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=torvalds@osdl.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

Powered by JetHome