[PATCH 5.10] cifs: Fix freeing non heap memory in dup_vol()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No upstream commit exists for this patch.

Remove kfree(&vi->smb_vol), since &vi->smb_vol
is a pointer to an area inside the allocated memory.

The issue was fixed on the way by upstream commit 837e3a1bbfdc
("cifs: rename dup_vol to smb3_fs_context_dup and move it into fs_context.c")
but this commit is not material for stable branches.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 54be1f6c1c37 ("cifs: Add DFS cache routines")
Signed-off-by: Alexandra Diupina <adiupina@xxxxxxxxxxxxx>
---
 fs/cifs/dfs_cache.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
index 7b6db272fd0b..da6d775102f2 100644
--- a/fs/cifs/dfs_cache.c
+++ b/fs/cifs/dfs_cache.c
@@ -1194,7 +1194,6 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new)
 	kfree_sensitive(new->password);
 err_free_username:
 	kfree(new->username);
-	kfree(new);
 	return -ENOMEM;
 }
 
-- 
2.30.2





[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux