]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
net-sysfs: Call dev_hold always in rx_queue_add_kobject
authorJouni Hogander <jouni.hogander@unikie.com>
Tue, 17 Dec 2019 11:46:34 +0000 (13:46 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 6 Mar 2020 07:25:26 +0000 (02:25 -0500)
commit0c58e0ed1d18ef2c068f59d2271f6ca53b62a07e
treedf4431106ed8cb732eb492dbd4b2679ecab70c55
parent8aedff2674aba8425a7ff3caec2c62c6b3d0bd4f
net-sysfs: Call dev_hold always in rx_queue_add_kobject

BugLink: https://bugs.launchpad.net/bugs/1864710
commit ddd9b5e3e765d8ed5a35786a6cb00111713fe161 upstream.

Dev_hold has to be called always in rx_queue_add_kobject.
Otherwise usage count drops below 0 in case of failure in
kobject_init_and_add.

Fixes: b8eb718348b8 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject")
Reported-by: syzbot <syzbot+30209ea299c09d8785c9@syzkaller.appspotmail.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: David Miller <davem@davemloft.net>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Jouni Hogander <jouni.hogander@unikie.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/core/net-sysfs.c