lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025112442-favorite-draw-76b0@gregkh>
Date: Mon, 24 Nov 2025 17:15:28 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Will Rosenberg <whrosenb@....edu>
Cc: Oliver Rosenberg <olrose55@...il.com>, Tejun Heo <tj@...nel.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] kernfs: fix memory leak of kernfs_iattrs in
 __kernfs_new_node

On Mon, Nov 24, 2025 at 09:02:26AM -0700, Will Rosenberg wrote:
> There exists a memory leak of kernfs_iattrs contained as an element
> of kernfs_node allocated in __kernfs_new_node(). __kernfs_setattr()
> allocates kernfs_iattrs as a sub-object, and the LSM security check
> incorrectly errors out and does not free the kernfs_iattrs sub-object.
> 
> Make an additional error out case that properly frees kernfs_iattrs if
> security_kernfs_init_security() fails.
> 
> Fixes: f72dae20891d7bcc43e9263ab206960b6ae5209f ("Merge tag 'selinux-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux")

Did the error really happen on a merge?  That feels very wrong.

Also, please read the docs, it says how big to make that sha1 value :)

> Co-developed-by: Oliver Rosenberg <olrose55@...il.com>
> Signed-off-by: Oliver Rosenberg <olrose55@...il.com>
> Signed-off-by: Will Rosenberg <whrosenb@....edu>
> ---
>  fs/kernfs/dir.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

What changed from v2?

Again, please read the kernel docs on how to submit a patch.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ