path: root/ipc/msg.c
diff options
authorVasily Averin <>2021-06-30 18:57:09 -0700
committerLinus Torvalds <>2021-07-01 11:06:07 -0700
commitfc37a3b8b4388e73e8e3525556d9f1feeb232bb9 (patch)
tree4a1adfb461437e5dff7626b725c7f77ab11dbcae /ipc/msg.c
parent3b52348345b2cfe038d317de52bcdef788c6520d (diff)
ipc sem: use kvmalloc for sem_undo allocation
Patch series "ipc: allocations cleanup", v2. Some ipc objects use the wrong allocation functions: small objects can use kmalloc(), and vice versa, potentially large objects can use kmalloc(). This patch (of 2): Size of sem_undo can exceed one page and with the maximum possible nsems = 32000 it can grow up to 64Kb. Let's switch its allocation to kvmalloc to avoid user-triggered disruptive actions like OOM killer in case of high-order memory shortage. User triggerable high order allocations are quite a problem on heavily fragmented systems. They can be a DoS vector. Link: Link: Signed-off-by: Vasily Averin <> Acked-by: Michal Hocko <> Reviewed-by: Shakeel Butt <> Acked-by: Roman Gushchin <> Cc: Alexey Dobriyan <> Cc: Davidlohr Bueso <> Cc: Dmitry Safonov <> Cc: Johannes Weiner <> Cc: Manfred Spraul <> Cc: Vladimir Davydov <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'ipc/msg.c')
0 files changed, 0 insertions, 0 deletions