Re: [PATCH] s390/hypfs_sprp: Replace kzalloc() + copy_from_user() with memdup_user()

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

 



On Fri, Sep 12, 2025 at 12:51:05PM +0200, Thorsten Blum wrote:
> On 12. Sep 2025, at 12:09, 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))
> 
> And unless kzalloc() is required here, memdup_user() is an improvement,
> since it uses kmalloc() internally and avoids unnecessarily zeroing the
> memory before overwriting it with copy_from_user().

Again, there are gazillions of similar trivial cleanup patches possible. The
additional zeroing in this case doesn't matter at all, since this code is
executed once a year.

Reviewing and integrating such patches could keep us busy all day long.
So, please don't send such patches.

Patches which fix (potential) bugs are welcome however.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux