[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201210252103.BJG56875.OtHFLOOVSFFQMJ@I-love.SAKURA.ne.jp>
Date: Thu, 25 Oct 2012 21:03:14 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: ppandit@...hat.com, keescook@...omium.org
Cc: viro@...iv.linux.org.uk, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, josh@...htriplett.org,
serge.hallyn@...onical.com, linux-fsdevel@...r.kernel.org,
me@...fdog.net
Subject: Re: [PATCH] exec: do not leave bprm->interp on stack
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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists