All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cifs: Fix leak when handling lease break for cached root fid
@ 2020-06-26 20:02 Paul Aurich
  2020-06-29  9:59 ` Aurélien Aptel
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Aurich @ 2020-06-26 20:02 UTC (permalink / raw)
  To: linux-cifs, sfrench; +Cc: paul, Ronnie Sahlberg

As observed with kmemleak:

    unreferenced object 0xffff98383a5af480 (size 128):
      comm "cifsd", pid 684, jiffies 4294936606 (age 534.868s)
      hex dump (first 32 bytes):
        c0 ff ff ff 1f 00 00 00 88 f4 5a 3a 38 98 ff ff  ..........Z:8...
        88 f4 5a 3a 38 98 ff ff 80 88 d6 8a ff ff ff ff  ..Z:8...........
      backtrace:
        [<0000000068957336>] smb2_is_valid_oplock_break+0x1fa/0x8c0
        [<0000000073b70b9e>] cifs_demultiplex_thread+0x73d/0xcc0
        [<00000000905fa372>] kthread+0x11c/0x150
        [<0000000079378e4e>] ret_from_fork+0x22/0x30

Fixes: a93864d93977 ("cifs: add lease tracking to the cached root fid")
Signed-off-by: Paul Aurich <paul@darkrain42.org>
CC: Stable <stable@vger.kernel.org> # v4.18+
---
 fs/cifs/smb2misc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
index 6a39451973f8..17684b25eb21 100644
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -619,6 +619,7 @@ smb2_is_valid_lease_break(char *buffer)
 					queue_work(cifsiod_wq,
 						   &tcon->crfid.lease_break);
 					spin_unlock(&cifs_tcp_ses_lock);
+					kfree(lw);
 					return true;
 				}
 			}
-- 
2.27.0


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

* Re: [PATCH] cifs: Fix leak when handling lease break for cached root fid
  2020-06-26 20:02 [PATCH] cifs: Fix leak when handling lease break for cached root fid Paul Aurich
@ 2020-06-29  9:59 ` Aurélien Aptel
  0 siblings, 0 replies; 2+ messages in thread
From: Aurélien Aptel @ 2020-06-29  9:59 UTC (permalink / raw)
  To: Paul Aurich, linux-cifs, sfrench; +Cc: paul, Ronnie Sahlberg

Hi,

Good catch! Change looks good to me but I think we should move lw
allocation inside smb2_tcon_has_lease() so that we don't have to track
it across multiple functions as it is only used there. Could you send a
v2 doing that?

Cheers,
-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)

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

end of thread, other threads:[~2020-06-29 19:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26 20:02 [PATCH] cifs: Fix leak when handling lease break for cached root fid Paul Aurich
2020-06-29  9:59 ` Aurélien Aptel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.