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: <20250912110619.10147C7e-hca@linux.ibm.com>
Date: Fri, 12 Sep 2025 13:06:19 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Vasily Gorbik <gor@...ux.ibm.com>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Sven Schnelle <svens@...ux.ibm.com>, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] s390/hypfs_sprp: Replace kzalloc() + copy_from_user()
 with memdup_user()

On Fri, Sep 12, 2025 at 12:09:43PM +0200, Thorsten Blum wrote:
> On 12. Sep 2025, at 11:56, Heiko Carstens wrote:
> > This is not an improvement and also incorrect, since kfree() may now
> > be called with an error pointer.
> 
> Unless I'm missing something, kfree() works just fine with error
> pointers. See linux/slab.h:
> 
> DEFINE_FREE(kfree, void *, if (!IS_ERR_OR_NULL(_T)) kfree(_T))

This is for automatically freed memory, but not for the generic case.
See cd7eb8f83fcf ("mm/slab: make __free(kfree) accept error pointers").

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ