lkml.org 
[lkml]   [2012]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] exec: do not leave bprm->interp on stack
From
Date
P J P wrote:
>
> Hello Kees,
>
> +-- On Wed, 24 Oct 2012, Kees Cook wrote --+
> | What should the code here _actually_ be doing? The _script and _misc
> | handlers expect to rewrite the bprm contents and recurse, but the module
> | loader want to try again. It's not clear to me what the binfmt module
> | handler is even there for; I don't see any binfmt-XXXX aliases in the tree.
> | If nothing uses it, should we just rip it out? That would solve it too.
>
> I've been following this issue and updated versions of HDs patch. Below is a
> small patch to search_binary_handler() routine, which attempts to make the
> request_module call before calling load_script routine.
>
> Besides fixing the stack disclosure issue it also helps to *simplify* the
> search_binary_handler routine by removing the -for (try=0;try<2;try++)- loop.
>
> I'd really appreciate any comments/suggestions you may have.

Excuse me, but why do you change definition of printable(c) ?
Looks like a regression.

Wouldn't your patch trigger call request_module() whenever a script
starting with "#!/bin/sh" is executed?

And if you meant

if (!(printable(bprm->buf[0]) && printable(bprm->buf[1])
&& printable(bprm->buf[2]) && printable(bprm->buf[3])))

then, wouldn't that trigger request_module() recursion?


\
 
 \ /
  Last update: 2012-10-25 14:41    [W:0.163 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site