[to-be-updated] ipc-msgc-fix-memory-leak-in-do_msgsnd.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: ipc/msg.c: fix memory leak in do_msgsnd()
has been removed from the -mm tree.  Its filename was
     ipc-msgc-fix-memory-leak-in-do_msgsnd.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Fabian Frederick <fabf@xxxxxxxxx>
Subject: ipc/msg.c: fix memory leak in do_msgsnd()

Running LTP msgsnd06 with kmemleak gives the following:

cat /sys/kernel/debug/kmemleak

unreferenced object 0xffff88003c0a11f8 (size 8):
  comm "msgsnd06", pid 1645, jiffies 4294672526 (age 6.549s)
  hex dump (first 8 bytes):
    1b 00 00 00 01 00 00 00                          ........
  backtrace:
    [<ffffffff818e2c43>] kmemleak_alloc+0x23/0x40
    [<ffffffff81177f31>] kmem_cache_alloc_trace+0xe1/0x180
    [<ffffffff812d42af>] selinux_msg_queue_alloc_security+0x3f/0xd0
    [<ffffffff812cc6be>] security_msg_queue_alloc+0x2e/0x40
    [<ffffffff812b94ee>] newque+0x4e/0x150
    [<ffffffff812b8cb9>] ipcget+0x159/0x1b0
    [<ffffffff812b98d9>] SyS_msgget+0x39/0x40
    [<ffffffff818e7bdb>] entry_SYSCALL_64_fastpath+0x13/0x8f
    [<ffffffffffffffff>] 0xffffffffffffffff

ipc_rcu_free() was given to ipc_rcu_putref() instead of msg_rcu_free()
which does security cleaning.

Link: http://lkml.kernel.org/r/1469780120-315-1-git-send-email-fabf@xxxxxxxxx
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
Cc: Davidlohr Bueso <dbueso@xxxxxxx>
Cc: Manfred Spraul <manfred@xxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 ipc/msg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN ipc/msg.c~ipc-msgc-fix-memory-leak-in-do_msgsnd ipc/msg.c
--- a/ipc/msg.c~ipc-msgc-fix-memory-leak-in-do_msgsnd
+++ a/ipc/msg.c
@@ -680,7 +680,7 @@ long do_msgsnd(int msqid, long mtype, vo
 		rcu_read_lock();
 		ipc_lock_object(&msq->q_perm);
 
-		ipc_rcu_putref(msq, ipc_rcu_free);
+		ipc_rcu_putref(msq, msg_rcu_free);
 		/* raced with RMID? */
 		if (!ipc_valid_object(&msq->q_perm)) {
 			err = -EIDRM;
_

Patches currently in -mm which might be from fabf@xxxxxxxxx are

sysv-ipc-fix-security-layer-leaking.patch
treewide-replace-obsolete-_refok-by-__ref.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]
  Powered by Linux