Messages in this thread | | | Date | 18 Sep 2013 11:22:09 -0400 | From | "George Spelvin" <> | Subject | Re: [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.
| |