Commit [d76274] Maximize Restore History

Make do_execve() take a const filename pointer

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

David Howells David Howells 2010-08-17

Linus Torvalds Linus Torvalds 2010-08-18

1 2 3 .. 5 > >> (Page 1 of 5)
changed arch
changed arch/alpha
changed arch/alpha/kernel
changed arch/alpha/kernel/process.c
changed arch/arm
changed arch/arm/kernel
changed arch/arm/kernel/sys_arm.c
changed arch/avr32
changed arch/avr32/kernel
changed arch/avr32/kernel/process.c
changed arch/avr32/kernel/sys_avr32.c
changed arch/blackfin
changed arch/blackfin/kernel
changed arch/blackfin/kernel/process.c
changed arch/cris
changed arch/cris/arch-v10
changed arch/cris/arch-v10/kernel
changed arch/cris/arch-v10/kernel/process.c
changed arch/cris/arch-v32
changed arch/cris/arch-v32/kernel
changed arch/cris/arch-v32/kernel/process.c
changed arch/frv
changed arch/frv/kernel
changed arch/frv/kernel/process.c
changed arch/h8300
arch
Directory.
arch/alpha
Directory.
arch/alpha/kernel
Directory.
arch/alpha/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/arm
Directory.
arch/arm/kernel
Directory.
arch/arm/kernel/sys_arm.c Diff Switch to side-by-side view
Loading...
arch/avr32
Directory.
arch/avr32/kernel
Directory.
arch/avr32/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/avr32/kernel/sys_avr32.c Diff Switch to side-by-side view
Loading...
arch/blackfin
Directory.
arch/blackfin/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/cris
Directory.
arch/cris/arch-v10
Directory.
arch/cris/arch-v10/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/cris/arch-v32
Directory.
arch/cris/arch-v32/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/frv
Directory.
arch/frv/kernel
Directory.
arch/frv/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/h8300
Directory.
1 2 3 .. 5 > >> (Page 1 of 5)