]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
debugfs: Return error during {full/open}_proxy_open() on rmmod
authorSven Eckelmann <sven@narfation.org>
Mon, 2 Aug 2021 16:24:44 +0000 (18:24 +0200)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 11 Oct 2021 23:08:48 +0000 (17:08 -0600)
commit3d2146fc2c4adbcacba849b702846c13a746322f
tree92a57fdf08215805dd90e203dca7193667028dd4
parentf2350b2876a1053646d3b6c7ecf138c1c8cd8c20
debugfs: Return error during {full/open}_proxy_open() on rmmod

BugLink: https://bugs.launchpad.net/bugs/1946024
[ Upstream commit 112cedc8e600b668688eb809bf11817adec58ddc ]

If a kernel module gets unloaded then it printed report about a leak before
commit 275678e7a9be ("debugfs: Check module state before warning in
{full/open}_proxy_open()"). An additional check was added in this commit to
avoid this printing. But it was forgotten that the function must return an
error in this case because it was not actually opened.

As result, the systems started to crash or to hang when a module was
unloaded while something was trying to open a file.

Fixes: 275678e7a9be ("debugfs: Check module state before warning in {full/open}_proxy_open()")
Cc: Taehee Yoo <ap420073@gmail.com>
Reported-by: Mário Lopes <ml@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://lore.kernel.org/r/20210802162444.7848-1-sven@narfation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/debugfs/file.c