lkml.org 
[lkml]   [2008]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] ELF: implement AT_RANDOM for future glibc use
    On Fri, Oct 03, 2008 at 02:43:40AM +0200, Jakub Jelinek wrote:
    > On Thu, Oct 02, 2008 at 05:16:16PM -0700, Kees Cook wrote:
    > > @@ -196,6 +198,18 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
    > > return -EFAULT;
    > > }
    > >
    > > + rand_size = CONFIG_SECURITY_AUXV_RANDOM_SIZE * sizeof(unsigned long);
    >
    > I believe you want sizeof (elf_addr_t) here instead.
    >
    > > + u_rand_bytes = NULL;
    > > + if (rand_size) {
    > > + unsigned char k_rand_bytes[CONFIG_SECURITY_AUXV_RANDOM_SIZE *
    > > + sizeof(unsigned long)];
    >
    > And here too, because having a 64-bit kernel supply twice as much random
    > data to 32-bit programs as a 32-bit kernel would supply would be certainly
    > unexpected.

    Ah-ha! I see the 32-vs-64 elf_addr_t magic in fs/compat_binfmt_elf.c now.
    Excellent, I will send an updated patch.

    Thanks!

    -Kees

    --
    Kees Cook
    Ubuntu Security Team


    \
     
     \ /
      Last update: 2008-10-03 07:29    [W:0.021 / U:61.080 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site