diff options
| author | ZhangGuoDong <zhangguodong@kylinos.cn> | 2025-10-12 00:47:59 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-11-24 10:35:48 +0100 |
| commit | f1305587731886da37a214cda812ade246c653b0 (patch) | |
| tree | 219eb05679e07182fde366d6e65e7a4b95b9f009 /fs | |
| parent | 6c627bcc1896ba62ec793d0c00da74f3c93ce3ad (diff) | |
| download | linux-f1305587731886da37a214cda812ade246c653b0.tar.gz linux-f1305587731886da37a214cda812ade246c653b0.tar.bz2 linux-f1305587731886da37a214cda812ade246c653b0.zip | |
smb/server: fix possible memory leak in smb2_read()
[ Upstream commit 6fced056d2cc8d01b326e6fcfabaacb9850b71a4 ]
Memory leak occurs when ksmbd_vfs_read() fails.
Fix this by adding the missing kvfree().
Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/smb/server/smb2pdu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 796235cb9567..67021dc6dfd8 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -6782,6 +6782,7 @@ int smb2_read(struct ksmbd_work *work) nbytes = ksmbd_vfs_read(work, fp, length, &offset, aux_payload_buf); if (nbytes < 0) { + kvfree(aux_payload_buf); err = nbytes; goto out; } |
