Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-12-14 Thread Maxime Villard
I would like to end this thread. Here's a final patch: Index: exec_elf.c === RCS file: /cvs/src/sys/kern/exec_elf.c,v retrieving revision 1.93 diff -u -r1.93 exec_elf.c --- exec_elf.c 4 Jul 2013 17:37:05 - 1.93 +++ exec_elf

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-11-21 Thread Maxime Villard
Le 06/10/2013 01:09, Kenneth R Westerback a écrit : > On Sat, Oct 05, 2013 at 03:22:36PM -0600, Todd C. Miller wrote: >> On Wed, 28 Aug 2013 22:34:26 -0400, Kenneth R Westerback wrote: >> @@ -552,11 +552,16 @@ ELFNAME2(exec,makecmds)(struct proc *p, for (i = 0, pp = ph; i < eh-

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-10-05 Thread Kenneth R Westerback
On Sat, Oct 05, 2013 at 03:22:36PM -0600, Todd C. Miller wrote: > On Wed, 28 Aug 2013 22:34:26 -0400, Kenneth R Westerback wrote: > > > > @@ -552,11 +552,16 @@ ELFNAME2(exec,makecmds)(struct proc *p, > > > > > > for (i = 0, pp = ph; i < eh->e_phnum; i++, pp++) { > > > if (pp->p_type

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-10-05 Thread Todd C. Miller
On Wed, 28 Aug 2013 22:34:26 -0400, Kenneth R Westerback wrote: > > @@ -552,11 +552,16 @@ ELFNAME2(exec,makecmds)(struct proc *p, > > > > for (i = 0, pp = ph; i < eh->e_phnum; i++, pp++) { > > if (pp->p_type == PT_INTERP && !interp) { > > - if (pp->p_filesz >=

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-10-05 Thread Maxime Villard
up, please Le 28/08/2013 21:43, Maxime Villard a écrit : > On 08/28/13 20:57, Matthew Dempsky wrote: >> On Wed, Aug 28, 2013 at 5:54 AM, Maxime Villard wrote: >>> + /* Ensure interp is a valid, NUL-terminated string >>> */ >>> + for (n = 0; n < pp->p_

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-08-28 Thread Kenneth R Westerback
On Wed, Aug 28, 2013 at 09:43:24PM +0200, Maxime Villard wrote: > On 08/28/13 20:57, Matthew Dempsky wrote: > > On Wed, Aug 28, 2013 at 5:54 AM, Maxime Villard wrote: > >> + /* Ensure interp is a valid, NUL-terminated string > >> */ > >> + for (n = 0; n

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-08-28 Thread Kenneth R Westerback
On Wed, Aug 28, 2013 at 08:44:26PM +0200, Maxime Villard wrote: > On 08/28/13 16:30, Kenneth R Westerback wrote: > > On Wed, Aug 28, 2013 at 02:54:11PM +0200, Maxime Villard wrote: > >> Updated diff, with small tweaks from Andres Perera, > >> * int -> size_t, signedness issue, even if it can't be

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-08-28 Thread Maxime Villard
On 08/28/13 20:57, Matthew Dempsky wrote: > On Wed, Aug 28, 2013 at 5:54 AM, Maxime Villard wrote: >> + /* Ensure interp is a valid, NUL-terminated string */ >> + for (n = 0; n < pp->p_filesz; n++) { >> + if (interp[n] == '\

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-08-28 Thread Matthew Dempsky
On Wed, Aug 28, 2013 at 5:54 AM, Maxime Villard wrote: > + /* Ensure interp is a valid, NUL-terminated string */ > + for (n = 0; n < pp->p_filesz; n++) { > + if (interp[n] == '\0') > + b

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-08-28 Thread Maxime Villard
On 08/28/13 16:30, Kenneth R Westerback wrote: > On Wed, Aug 28, 2013 at 02:54:11PM +0200, Maxime Villard wrote: >> Updated diff, with small tweaks from Andres Perera, >> * int -> size_t, signedness issue, even if it can't be >INT_MAX >> * NULL -> NUL >> >> >> Index: exec_elf.c >> =

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-08-28 Thread Kenneth R Westerback
On Wed, Aug 28, 2013 at 02:54:11PM +0200, Maxime Villard wrote: > Updated diff, with small tweaks from Andres Perera, > * int -> size_t, signedness issue, even if it can't be >INT_MAX > * NULL -> NUL > > > Index: exec_elf.c > === >

Re: [PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-08-28 Thread Maxime Villard
Updated diff, with small tweaks from Andres Perera, * int -> size_t, signedness issue, even if it can't be >INT_MAX * NULL -> NUL Index: exec_elf.c === RCS file: /cvs/src/sys/kern/exec_elf.c,v retrieving revision 1.93 diff -u -p -r

[PATCH] ELF: ensure PT_INTERP strings are NULL-terminated

2013-08-28 Thread Maxime Villard
Hi, in the ELF format, the PT_INTERP segment contains the path of the interpreter which must be loaded. For this segment, the kernel looks at these values in the program header: p_offset: offset of the path string p_filesz: size of the path string, including the \0 The path string must be a val