[PATCH v4 2/2] ubifs: use strscpy() and kmemdup_nul() where appropriate

Dmitry Antipov dmantipov at yandex.ru
Fri Apr 10 05:00:59 PDT 2026


On Fri, 2026-04-10 at 07:57 +0200, Richard Weinberger wrote:

> Dmitry, how are you testing these changes?

Build with:

CONFIG_KASAN=y

CONFIG_MTD_NAND_NANDSIM=m

CONFIG_MTD_UBI=m
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_UBIFS_FS=m
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_ZSTD=y
CONFIG_UBIFS_ATIME_SUPPORT=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_SECURITY=y
CONFIG_UBIFS_FS_AUTHENTICATION=y

and boot (QEMU VM). Then use nandsim to create ~512M ubifs volume:

# modprobe nandsim second_id_byte=0xdc third_id_byte=0x80 fourth_id_byte=0x1d
# modprobe ubi mtd=0
# ubimkvol /dev/ubi0 -N test -m
Set volume size to 517644288
Volume ID 0, size 4012 LEBs (517644288 bytes, 493.6 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "test", alignment 1
# mount -t ubifs ubi0:test /mnt/ubifs

And do basic consistency check with something like:

# cp -a [~390M source tree] /mnt/ubifs
# diff -ur [tree] /mnt/ubifs/[copy of that tree] ; no output hopefully means OK
# umount /mnt/ubifs
# mount -t ubifs ubi0:test /mnt/ubifs
# diff -ur [tree] /mnt/ubifs/[copy of that tree] ; likewise

etc.

Dmitry



More information about the linux-mtd mailing list