Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-10-04 11:20:06 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-10-04 11:20:06 +0200
commit66074a116017942088d5edebdd687671997053b5 (patch)
tree230d2a68f5ce2de3af4361297bee6ebd0979314a
parent04a8cdf4ebac41a480dce8afce3588e2a87ca693 (diff)
parentb2ea0ab66f3184e98eff17896cd1a9c3b583ecab (diff)
Merge branch 'users/jslaby/SLE15/for-next' into SLE15
Pull a ppp fix from Jiri Slaby
-rw-r--r--patches.suse/ppp-Fix-memory-leak-in-ppp_write.patch59
-rw-r--r--series.conf1
2 files changed, 60 insertions, 0 deletions
diff --git a/patches.suse/ppp-Fix-memory-leak-in-ppp_write.patch b/patches.suse/ppp-Fix-memory-leak-in-ppp_write.patch
new file mode 100644
index 0000000000..e76351037a
--- /dev/null
+++ b/patches.suse/ppp-Fix-memory-leak-in-ppp_write.patch
@@ -0,0 +1,59 @@
+From: Takeshi Misawa <jeliantsurux@gmail.com>
+Date: Sun, 22 Sep 2019 16:45:31 +0900
+Subject: ppp: Fix memory leak in ppp_write
+Git-commit: 4c247de564f1ff614d11b3bb5313fb70d7b9598b
+Patch-mainline: 5.4-rc1
+References: git-fixes
+
+When ppp is closing, __ppp_xmit_process() failed to enqueue skb
+and skb allocated in ppp_write() is leaked.
+
+syzbot reported :
+BUG: memory leak
+unreferenced object 0xffff88812a17bc00 (size 224):
+ comm "syz-executor673", pid 6952, jiffies 4294942888 (age 13.040s)
+ hex dump (first 32 bytes):
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ backtrace:
+ [<00000000d110fff9>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
+ [<00000000d110fff9>] slab_post_alloc_hook mm/slab.h:522 [inline]
+ [<00000000d110fff9>] slab_alloc_node mm/slab.c:3262 [inline]
+ [<00000000d110fff9>] kmem_cache_alloc_node+0x163/0x2f0 mm/slab.c:3574
+ [<000000002d616113>] __alloc_skb+0x6e/0x210 net/core/skbuff.c:197
+ [<000000000167fc45>] alloc_skb include/linux/skbuff.h:1055 [inline]
+ [<000000000167fc45>] ppp_write+0x48/0x120 drivers/net/ppp/ppp_generic.c:502
+ [<000000009ab42c0b>] __vfs_write+0x43/0xa0 fs/read_write.c:494
+ [<00000000086b2e22>] vfs_write fs/read_write.c:558 [inline]
+ [<00000000086b2e22>] vfs_write+0xee/0x210 fs/read_write.c:542
+ [<00000000a2b70ef9>] ksys_write+0x7c/0x130 fs/read_write.c:611
+ [<00000000ce5e0fdd>] __do_sys_write fs/read_write.c:623 [inline]
+ [<00000000ce5e0fdd>] __se_sys_write fs/read_write.c:620 [inline]
+ [<00000000ce5e0fdd>] __x64_sys_write+0x1e/0x30 fs/read_write.c:620
+ [<00000000d9d7b370>] do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:296
+ [<0000000006e6d506>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
+
+Fix this by freeing skb, if ppp is closing.
+
+Fixes: 6d066734e9f0 ("ppp: avoid loop in xmit recursion detection code")
+Reported-and-tested-by: syzbot+d9c8bf24e56416d7ce2c@syzkaller.appspotmail.com
+Signed-off-by: Takeshi Misawa <jeliantsurux@gmail.com>
+Reviewed-by: Guillaume Nault <gnault@redhat.com>
+Tested-by: Guillaume Nault <gnault@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/net/ppp/ppp_generic.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/ppp/ppp_generic.c
++++ b/drivers/net/ppp/ppp_generic.c
+@@ -1432,6 +1432,8 @@ static void __ppp_xmit_process(struct pp
+ netif_wake_queue(ppp->dev);
+ else
+ netif_stop_queue(ppp->dev);
++ } else {
++ kfree_skb(skb);
+ }
+ ppp_xmit_unlock(ppp);
+ }
diff --git a/series.conf b/series.conf
index 4e8595d508..495a25b2e8 100644
--- a/series.conf
+++ b/series.conf
@@ -24703,6 +24703,7 @@
patches.suse/powerpc-mm-Fixup-tlbie-vs-mtpidr-mtlpidr-ordering-is.patch
patches.suse/net-ibmvnic-unlock-rtnl_lock-in-reset-so-linkwatch_e.patch
patches.suse/net-ibmvnic-prevent-more-than-one-thread-from-runnin.patch
+ patches.suse/ppp-Fix-memory-leak-in-ppp_write.patch
# jejb/scsi for-next
patches.suse/scsi-qla2xxx-Fix-Nport-ID-display-value.patch