Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 5.10] cifs: Fix freeing non heap memory in dup_vol()
@ 2024-09-04 14:48 Alexandra Diupina
  2024-09-04 14:50 ` kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandra Diupina @ 2024-09-04 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Alexandra Diupina, Steve French, stable, Aurelien Aptel,
	Paulo Alcantara, linux-cifs, samba-technical, linux-kernel,
	lvc-project

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

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

Fixes: 54be1f6c1c37 ("cifs: Add DFS cache routines")
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
---
 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


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

* Re: [PATCH 5.10] cifs: Fix freeing non heap memory in dup_vol()
  2024-09-04 14:48 [PATCH 5.10] cifs: Fix freeing non heap memory in dup_vol() Alexandra Diupina
@ 2024-09-04 14:50 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2024-09-04 14:50 UTC (permalink / raw)
  To: Alexandra Diupina; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-3

Rule: The upstream commit ID must be specified with a separate line above the commit text.
Subject: [PATCH 5.10] cifs: Fix freeing non heap memory in dup_vol()
Link: https://lore.kernel.org/stable/20240904144832.28857-1-adiupina%40astralinux.ru

Please ignore this mail if the patch is not relevant for upstream.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




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

* [PATCH 5.10] cifs: Fix freeing non heap memory in dup_vol()
@ 2024-09-04 15:35 Alexandra Diupina
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandra Diupina @ 2024-09-04 15:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Alexandra Diupina, stable, Steve French, Paulo Alcantara,
	linux-cifs, linux-kernel, lvc-project

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@astralinux.ru>
---
 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


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

end of thread, other threads:[~2024-09-04 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04 14:48 [PATCH 5.10] cifs: Fix freeing non heap memory in dup_vol() Alexandra Diupina
2024-09-04 14:50 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-09-04 15:35 Alexandra Diupina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox