Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

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
changed arch/h8300/kernel
changed arch/h8300/kernel/process.c
changed arch/h8300/kernel/sys_h8300.c
changed arch/ia64
changed arch/ia64/kernel
changed arch/ia64/kernel/process.c
changed arch/m32r
changed arch/m32r/kernel
changed arch/m32r/kernel/process.c
changed arch/m32r/kernel/sys_m32r.c
changed arch/m68k
changed arch/m68k/kernel
changed arch/m68k/kernel/process.c
changed arch/m68k/kernel/sys_m68k.c
changed arch/m68knommu
changed arch/m68knommu/kernel
changed arch/m68knommu/kernel/process.c
changed arch/m68knommu/kernel/sys_m68k.c
changed arch/microblaze
changed arch/microblaze/kernel
changed arch/microblaze/kernel/sys_microblaze.c
changed arch/mips
changed arch/mips/kernel
changed arch/mips/kernel/syscall.c
changed arch/mn10300
changed arch/mn10300/kernel
changed arch/mn10300/kernel/process.c
changed arch/parisc
changed arch/parisc/hpux
changed arch/parisc/hpux/fs.c
changed arch/parisc/kernel
changed arch/parisc/kernel/process.c
changed arch/powerpc
changed arch/powerpc/kernel
changed arch/powerpc/kernel/process.c
changed arch/s390
changed arch/s390/kernel
changed arch/s390/kernel/process.c
changed arch/score
changed arch/score/kernel
changed arch/score/kernel/sys_score.c
changed arch/sh
changed arch/sh/kernel
changed arch/sh/kernel/process_32.c
changed arch/sh/kernel/process_64.c
changed arch/sh/kernel/sys_sh32.c
changed arch/sh/kernel/sys_sh64.c
changed arch/sparc
changed arch/sparc/kernel
changed arch/sparc/kernel/process_32.c
changed arch/sparc/kernel/process_64.c
changed arch/sparc/kernel/sys_sparc_32.c
changed arch/sparc/kernel/sys_sparc_64.c
changed arch/tile
changed arch/tile/kernel
changed arch/tile/kernel/process.c
changed arch/um
changed arch/um/kernel
changed arch/um/kernel/exec.c
changed arch/um/kernel/syscall.c
changed arch/x86
changed arch/x86/include
changed arch/x86/include/asm
changed arch/x86/include/asm/syscalls.h
changed arch/x86/kernel
changed arch/x86/kernel/process.c
changed arch/x86/kernel/sys_i386_32.c
changed arch/xtensa
changed arch/xtensa/kernel
changed arch/xtensa/kernel/process.c
changed fs
changed fs/binfmt_misc.c
changed fs/binfmt_script.c
changed fs/exec.c
changed include
changed include/linux
changed include/linux/binfmts.h
changed include/linux/sched.h
changed include/linux/syscalls.h
changed init
changed init/do_mounts_initrd.c
changed init/main.c
changed kernel
changed kernel/kmod.c
changed security
changed security/commoncap.c
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.
arch/h8300/kernel
Directory.
arch/h8300/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/h8300/kernel/sys_h8300.c Diff Switch to side-by-side view
Loading...
arch/ia64
Directory.
arch/ia64/kernel
Directory.
arch/ia64/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/m32r
Directory.
arch/m32r/kernel
Directory.
arch/m32r/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/m32r/kernel/sys_m32r.c Diff Switch to side-by-side view
Loading...
arch/m68k
Directory.
arch/m68k/kernel
Directory.
arch/m68k/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/m68k/kernel/sys_m68k.c Diff Switch to side-by-side view
Loading...
arch/m68knommu
Directory.
arch/m68knommu/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/m68knommu/kernel/sys_m68k.c Diff Switch to side-by-side view
Loading...
arch/microblaze
Directory.
arch/microblaze/kernel/sys_microblaze.c Diff Switch to side-by-side view
Loading...
arch/mips
Directory.
arch/mips/kernel
Directory.
arch/mips/kernel/syscall.c Diff Switch to side-by-side view
Loading...
arch/mn10300
Directory.
arch/mn10300/kernel
Directory.
arch/mn10300/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/parisc
Directory.
arch/parisc/hpux
Directory.
arch/parisc/hpux/fs.c Diff Switch to side-by-side view
Loading...
arch/parisc/kernel
Directory.
arch/parisc/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/powerpc
Directory.
arch/powerpc/kernel
Directory.
arch/powerpc/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/s390
Directory.
arch/s390/kernel
Directory.
arch/s390/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/score
Directory.
arch/score/kernel
Directory.
arch/score/kernel/sys_score.c Diff Switch to side-by-side view
Loading...
arch/sh
Directory.
arch/sh/kernel
Directory.
arch/sh/kernel/process_32.c Diff Switch to side-by-side view
Loading...
arch/sh/kernel/process_64.c Diff Switch to side-by-side view
Loading...
arch/sh/kernel/sys_sh32.c Diff Switch to side-by-side view
Loading...
arch/sh/kernel/sys_sh64.c Diff Switch to side-by-side view
Loading...
arch/sparc
Directory.
arch/sparc/kernel
Directory.
arch/sparc/kernel/process_32.c Diff Switch to side-by-side view
Loading...
arch/sparc/kernel/process_64.c Diff Switch to side-by-side view
Loading...
arch/sparc/kernel/sys_sparc_32.c Diff Switch to side-by-side view
Loading...
arch/sparc/kernel/sys_sparc_64.c Diff Switch to side-by-side view
Loading...
arch/tile
Directory.
arch/tile/kernel
Directory.
arch/tile/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/um
Directory.
arch/um/kernel
Directory.
arch/um/kernel/exec.c Diff Switch to side-by-side view
Loading...
arch/um/kernel/syscall.c Diff Switch to side-by-side view
Loading...
arch/x86
Directory.
arch/x86/include
Directory.
arch/x86/include/asm/syscalls.h Diff Switch to side-by-side view
Loading...
arch/x86/kernel
Directory.
arch/x86/kernel/process.c Diff Switch to side-by-side view
Loading...
arch/x86/kernel/sys_i386_32.c Diff Switch to side-by-side view
Loading...
arch/xtensa
Directory.
arch/xtensa/kernel
Directory.
arch/xtensa/kernel/process.c Diff Switch to side-by-side view
Loading...
fs
Directory.
fs/binfmt_misc.c Diff Switch to side-by-side view
Loading...
fs/binfmt_script.c Diff Switch to side-by-side view
Loading...
fs/exec.c Diff Switch to side-by-side view
Loading...
include
Directory.
include/linux
Directory.
include/linux/binfmts.h Diff Switch to side-by-side view
Loading...
include/linux/sched.h Diff Switch to side-by-side view
Loading...
include/linux/syscalls.h Diff Switch to side-by-side view
Loading...
init
Directory.
init/do_mounts_initrd.c Diff Switch to side-by-side view
Loading...
init/main.c Diff Switch to side-by-side view
Loading...
kernel
Directory.
kernel/kmod.c Diff Switch to side-by-side view
Loading...
security
Directory.
security/commoncap.c Diff Switch to side-by-side view
Loading...
1 2 3 .. 5 > >> (Page 1 of 5)