[Devel] [PATCH vz7 1/5] ub statd: fix new_notify structure allocation

Stanislav Kinsburskiy skinsbursky at odin.com
Thu Oct 1 02:47:40 PDT 2015


From: Stanislav Kinsburskiy <skinsbursky at parallels.com>

This bug is old, but it was hidden by minimax SLAB size equal to 32 bytes.
With SLUB allocator, there are 8-bytes slabs, and this issue is revealed.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at parallels.com>
---
 kernel/bc/statd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bc/statd.c b/kernel/bc/statd.c
index e0eac10..b0b58a4 100644
--- a/kernel/bc/statd.c
+++ b/kernel/bc/statd.c
@@ -269,7 +269,7 @@ static int ubstat_handle_notifrq(ubnotifrq_t *req)
 	struct list_head *entry;
 	struct task_struct *tsk_to_free;
 
-	new_notify = kmalloc(sizeof(new_notify), GFP_KERNEL);
+	new_notify = kmalloc(sizeof(*new_notify), GFP_KERNEL);
 	if (new_notify == NULL)
 		return -ENOMEM;
 




More information about the Devel mailing list