On Tue, Nov 12, 2013 at 6:12 PM, David Rientjes <rientjes@xxxxxxxxxx> wrote: > Fengguang Wu reports that compiling mm/mempolicy.c results in a warning: > > mm/mempolicy.c: In function 'mpol_to_str': > mm/mempolicy.c:2878:2: error: format not a string literal and no format arguments > > Kees says this is because he is using -Wformat-security. > > Silence the warning. > > Reported-by: Fengguang Wu <fengguang.wu@xxxxxxxxx> > Suggested-by: Kees Cook <keescook@xxxxxxxxxxxx> > Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Thanks for helping silence my -Wformat-security warning checks. :) Acked-by: Kees Cook <keescook@xxxxxxxxxxxx> -Kees > --- > mm/mempolicy.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/mempolicy.c b/mm/mempolicy.c > --- a/mm/mempolicy.c > +++ b/mm/mempolicy.c > @@ -2950,7 +2950,7 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) > return; > } > > - p += snprintf(p, maxlen, policy_modes[mode]); > + p += snprintf(p, maxlen, "%s", policy_modes[mode]); > > if (flags & MPOL_MODE_FLAGS) { > p += snprintf(p, buffer + maxlen - p, "="); -- Kees Cook Chrome OS Security -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>