lkml.org 
[lkml]   [2013]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/2] vsprintf: ignore %n again
> +#define printk(fmt, ...) do {				  \
> + compiletime_assert(__builtin_constant_p(fmt), \
> + "Non-constant format string"); \
> + printk(fmt, ##__VA_ARGS__); \
> +} while (0)

May I recommend __builtin_constant_p(*fmt). Since:

char buf[OVERFLOW_VULNERABILITY];
strcpy(buf, malicious_format);
printk(buf, args)

has __builtin_constant_p(buf), but it's not a constant format string.


\
 
 \ /
  Last update: 2013-09-18 17:41    [W:0.077 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site