]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
9p: clear dangling pointers in p9stat_free
authorDominique Martinet <dominique.martinet@cea.fr>
Mon, 27 Aug 2018 22:32:35 +0000 (07:32 +0900)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:58:46 +0000 (19:58 -0600)
commiteec253a25587683655e78577eb1c8fdbdc96bc56
treec01f05d6cbc5fb037baff0e70216d42121693a2c
parentad6a9f47d3d2d57cd395e129364242383de111d2
9p: clear dangling pointers in p9stat_free

BugLink: https://bugs.launchpad.net/bugs/1836802
[ Upstream commit 62e3941776fea8678bb8120607039410b1b61a65 ]

p9stat_free is more of a cleanup function than a 'free' function as it
only frees the content of the struct; there are chances of use-after-free
if it is improperly used (e.g. p9stat_free called twice as it used to be
possible to)

Clearing dangling pointers makes the function idempotent and safer to use.

Link: http://lkml.kernel.org/r/1535410108-20650-2-git-send-email-asmadeus@codewreck.org
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Reported-by: syzbot+d4252148d198410b864f@syzkaller.appspotmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
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/9p/protocol.c