nilfs2: replace vmalloc + copy_from_user with vmemdup_user
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 30 Oct 2025 15:46:43 +0000 (00:46 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 12 Nov 2025 18:00:17 +0000 (10:00 -0800)
commit3e4b89e970365db7fe2c4171be06c0e88e3bcbe6
tree45637761facc4b9f5c4f74f22ccf8a4080b14904
parentded7d97442f0f5af25e942949ac304e025b85165
nilfs2: replace vmalloc + copy_from_user with vmemdup_user

Replace vmalloc() followed by copy_from_user() with vmemdup_user() to
improve nilfs_ioctl_clean_segments() and nilfs_ioctl_set_suinfo().  Use
kvfree() to free the buffers created by vmemdup_user().

Use u64_to_user_ptr() instead of manually casting the pointers and
remove the obsolete 'out_free' label.

No functional changes intended.

Link: https://lkml.kernel.org/r/20251030154700.7444-1-konishi.ryusuke@gmail.com
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/ioctl.c