summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2012-09-06 12:01:00 -0400
committerWilly Tarreau <w@1wt.eu>2012-10-07 23:40:57 +0200
commit9eca376d4c4e96f144a182059dd8f7b492cd662d (patch)
tree16346b63a6eb70fd4f4934399345b97ae4c1ec18 /mm
parent65525984d5eebb61afd53fa5dabe561cae5ee88d (diff)
downloadlwn-9eca376d4c4e96f144a182059dd8f7b492cd662d.tar.gz
lwn-9eca376d4c4e96f144a182059dd8f7b492cd662d.zip
Remove user-triggerable BUG from mpol_to_str
commit 80de7c3138ee9fd86a98696fd2cf7ad89b995d0a upstream. Trivially triggerable, found by trinity: kernel BUG at mm/mempolicy.c:2546! Process trinity-child2 (pid: 23988, threadinfo ffff88010197e000, task ffff88007821a670) Call Trace: show_numa_map+0xd5/0x450 show_pid_numa_map+0x13/0x20 traverse+0xf2/0x230 seq_read+0x34b/0x3e0 vfs_read+0xac/0x180 sys_pread64+0xa2/0xc0 system_call_fastpath+0x1a/0x1f RIP: mpol_to_str+0x156/0x360 Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 3c6e3e29255c..a6563fbf7190 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2259,7 +2259,7 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context)
break;
default:
- BUG();
+ return -EINVAL;
}
l = strlen(policy_types[mode]);