lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Nov 2019 08:35:31 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...hiba.co.jp>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        David Miller <davem@...emloft.net>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>,
        Jouni Hogander <jouni.hogander@...kie.com>
Subject: Re: [PATCH 4.19 282/306] net-sysfs: Fix reference count leak in
 rx|netdev_queue_add_kobject

On Thu, Nov 28, 2019 at 12:33:02PM +0900, Nobuhiro Iwamatsu wrote:
> Hi,
> 
> On Wed, Nov 27, 2019 at 09:32:12PM +0100, Greg Kroah-Hartman wrote:
> > From: Jouni Hogander <jouni.hogander@...kie.com>
> > 
> > commit b8eb718348b8fb30b5a7d0a8fce26fb3f4ac741b upstream.
> > 
> > kobject_init_and_add takes reference even when it fails. This has
> > to be given up by the caller in error handling. Otherwise memory
> > allocated by kobject_init_and_add is never freed. Originally found
> > by Syzkaller:
> > 
> > BUG: memory leak
> > unreferenced object 0xffff8880679f8b08 (size 8):
> >   comm "netdev_register", pid 269, jiffies 4294693094 (age 12.132s)
> >   hex dump (first 8 bytes):
> >     72 78 2d 30 00 36 20 d4                          rx-0.6 .
> >   backtrace:
> >     [<000000008c93818e>] __kmalloc_track_caller+0x16e/0x290
> >     [<000000001f2e4e49>] kvasprintf+0xb1/0x140
> >     [<000000007f313394>] kvasprintf_const+0x56/0x160
> >     [<00000000aeca11c8>] kobject_set_name_vargs+0x5b/0x140
> >     [<0000000073a0367c>] kobject_init_and_add+0xd8/0x170
> >     [<0000000088838e4b>] net_rx_queue_update_kobjects+0x152/0x560
> >     [<000000006be5f104>] netdev_register_kobject+0x210/0x380
> >     [<00000000e31dab9d>] register_netdevice+0xa1b/0xf00
> >     [<00000000f68b2465>] __tun_chr_ioctl+0x20d5/0x3dd0
> >     [<000000004c50599f>] tun_chr_ioctl+0x2f/0x40
> >     [<00000000bbd4c317>] do_vfs_ioctl+0x1c7/0x1510
> >     [<00000000d4c59e8f>] ksys_ioctl+0x99/0xb0
> >     [<00000000946aea81>] __x64_sys_ioctl+0x78/0xb0
> >     [<0000000038d946e5>] do_syscall_64+0x16f/0x580
> >     [<00000000e0aa5d8f>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> >     [<00000000285b3d1a>] 0xffffffffffffffff
> > 
> > Cc: David Miller <davem@...emloft.net>
> > Cc: Lukas Bulwahn <lukas.bulwahn@...il.com>
> > Signed-off-by: Jouni Hogander <jouni.hogander@...kie.com>
> > Signed-off-by: David S. Miller <davem@...emloft.net>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> > 
> 
> We also need the following commits to fix this issue:
> 
> commit 48a322b6f9965b2f1e4ce81af972f0e287b07ed0
> Author: Eric Dumazet <edumazet@...gle.com>
> Date:   Wed Nov 20 19:19:07 2019 -0800
> 
>     net-sysfs: fix netdev_queue_add_kobject() breakage
> 
>     kobject_put() should only be called in error path.
> 
>     Fixes: b8eb718348b8 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject")
>     Signed-off-by: Eric Dumazet <edumazet@...gle.com>
>     Cc: Jouni Hogander <jouni.hogander@...kie.com>
>     Signed-off-by: David S. Miller <davem@...emloft.net>
> 
> And this should also apply to 4.14.y and 5.3.y.
> Please apply this commnit to 4.14.y, 4.19.y and 5.3.y

Thanks for the report, will go queue it up now.

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ