Subject: [alternative-merged] vsprintf-bug-on-%n.patch removed from -mm tree To: keescook@xxxxxxxxxxxx,mm-commits@xxxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 28 Jan 2014 12:05:37 -0800 The patch titled Subject: vsprintf: BUG on %n has been removed from the -mm tree. Its filename was vsprintf-bug-on-%n.patch This patch was dropped because an alternative patch was merged ------------------------------------------------------ From: Kees Cook <keescook@xxxxxxxxxxxx> Subject: vsprintf: BUG on %n Now that there has been a full release of the kernel, and all users of %n have been dropped, switch to %n use triggering a BUG. Ignoring arguments could be used to assist in information leaks if an arbitrary format string was under the control of an attacker. Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/vsprintf.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff -puN lib/vsprintf.c~vsprintf-bug-on-%n lib/vsprintf.c --- a/lib/vsprintf.c~vsprintf-bug-on-%n +++ a/lib/vsprintf.c @@ -1735,15 +1735,12 @@ int vsnprintf(char *buf, size_t size, co case FORMAT_TYPE_NRCHARS: { /* * Since %n poses a greater security risk than - * utility, ignore %n and skip its argument. + * utility, it should not be implemented. Instead, + * BUG when encountering %n, since there are no + * legitimate users and skipping arguments could + * assist information leak attacks. */ - void *skip_arg; - - WARN_ONCE(1, "Please remove ignored %%n in '%s'\n", - old_fmt); - - skip_arg = va_arg(args, void *); - break; + BUG(); } default: _ Patches currently in -mm which might be from keescook@xxxxxxxxxxxx are origin.patch vsprintf-ignore-arguments-to-%n.patch lib-vsprintf-add-%pt-format-specifier.patch binfmt_elfc-use-get_random_int-to-fix-entropy-depleting.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html