Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 28 Jun 2016 23:38:42 +0200
From: "PaX Team" <pageexec@...email.hu>
To: Emese Revfy <re.emese@...il.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>
CC: kernel-hardening@...ts.openwall.com, spender@...ecurity.net,
        mmarek@...e.com, keescook@...omium.org, linux-kernel@...r.kernel.org,
        yamada.masahiro@...ionext.com, linux-kbuild@...r.kernel.org,
        minipli@...linux.so, linux@...linux.org.uk, catalin.marinas@....com,
        david.brown@...aro.org, benh@...nel.crashing.org, tglx@...utronix.de,
        akpm@...ux-foundation.org, jlayton@...chiereds.net, arnd@...db.de
Subject: Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

On 28 Jun 2016 at 22:50, Rasmus Villemoes wrote:

> > +extern const char *kstrdup_const(const char *s, gfp_t gfp) __nocapture(1);
> 
> OK, so this one is pretty dangerous, and probably wrong. If one does
> 
>   foo->bar = kstrdup_const(a-macro-that-might-be-a-string-literal)
> 
> in an .init function, foo->bar will very likely become dangling.

doesn't kstrdup_const omit the copy only for arguments that are stored in
.rodata (which doesn't include .init.rodata* and other init sections)?

cheers,
 PaX Team

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.