From: Yang Yingliang yangyingliang@huawei.com
mainline inclusion from mainline-5.15-rc1 commit 113ef68d47f5d36611c16a6ef4bd2a837aa344ab category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA
Reference: https://git.kernel.org/torvalds/linux/c/113ef68d47f5
-------------------------------
Before assigning wbuf to stream_buf, memory allocate in ksmbd_vfs_getcasexattr() need be freed.
Signed-off-by: Yang Yingliang yangyingliang@huawei.com Signed-off-by: Namjae Jeon namjae.jeon@samsung.com Signed-off-by: Steve French stfrench@microsoft.com Signed-off-by: Jason Yan yanaijie@huawei.com Signed-off-by: Zhong Jinghua zhongjinghua@huawei.com --- fs/cifsd/vfs.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/fs/cifsd/vfs.c b/fs/cifsd/vfs.c index cd037594f486..e70b67e41cd4 100644 --- a/fs/cifsd/vfs.c +++ b/fs/cifsd/vfs.c @@ -429,6 +429,7 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,
if (v_len > 0) memcpy(wbuf, stream_buf, v_len); + kvfree(stream_buf); stream_buf = wbuf; }