linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.14 01/21] autofs: fix a leak in autofs_expire_indirect()
@ 2019-11-22 19:49 Sasha Levin
  2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 02/21] RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN Sasha Levin
                   ` (19 more replies)
  0 siblings, 20 replies; 23+ messages in thread
From: Sasha Levin @ 2019-11-22 19:49 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Al Viro, Sasha Levin

From: Al Viro <viro@zeniv.linux.org.uk>

[ Upstream commit 03ad0d703df75c43f78bd72e16124b5b94a95188 ]

if the second call of should_expire() in there ends up
grabbing and returning a new reference to dentry, we need
to drop it before continuing.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/autofs4/expire.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 141f9bc213a3d..94a0017c923b1 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -472,9 +472,10 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
 		 */
 		flags &= ~AUTOFS_EXP_LEAVES;
 		found = should_expire(expired, mnt, timeout, how);
-		if (!found || found != expired)
-			/* Something has changed, continue */
+		if (found != expired) { // something has changed, continue
+			dput(found);
 			goto next;
+		}
 
 		if (expired != dentry)
 			dput(dentry);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-11-25 13:34 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 19:49 [PATCH AUTOSEL 4.14 01/21] autofs: fix a leak in autofs_expire_indirect() Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 02/21] RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 03/21] xfrm: Fix memleak on xfrm state destroy Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 04/21] iwlwifi: pcie: don't consider IV len in A-MSDU Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 05/21] exportfs_decode_fh(): negative pinned may become positive without the parent locked Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 06/21] audit_get_nd(): don't unlock parent too early Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 07/21] NFC: nxp-nci: Fix NULL pointer dereference after I2C communication error Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 08/21] xfrm: release device reference for invalid state Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 09/21] Input: cyttsp4_core - fix use after free bug Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 10/21] sched/core: Avoid spurious lock dependencies Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 11/21] ALSA: pcm: Fix stream lock usage in snd_pcm_period_elapsed() Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 12/21] net: usb: qmi_wwan: add support for Foxconn T77W968 LTE modules Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 13/21] slip: Fix memory leak in slip_open error path Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 14/21] net: cdc_ncm: Signedness bug in cdc_ncm_set_dgram_size() Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 15/21] slcan: Fix memory leak in error path Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 16/21] rsxx: add missed destroy_workqueue calls in remove Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 17/21] ax88172a: fix information leak on short answers Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 18/21] net: ep93xx_eth: fix mismatch of request_mem_region in remove Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 19/21] i2c: acpi: Force bus speed to 400KHz if a Silead touchscreen is present Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 20/21] i2c: core: fix use after free in of_i2c_notify Sasha Levin
2019-11-22 19:49 ` [PATCH AUTOSEL 4.14 21/21] Input: synaptics - enable RMI mode for X1 Extreme 2nd Generation Sasha Levin
2019-11-22 19:56   ` Dmitry Torokhov
2019-11-25 13:34     ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).