[Linux Kernel Bug] WARNING: zero-size vmalloc in ubi_read_volume_table

Yang, Chenyuan cy54 at illinois.edu
Tue Jan 23 08:39:30 PST 2024


Hi Richard,

Thanks for your prompt reply! Here are the configs related to MTD, and I attach the whole CONFIG in this email.

```
# CONFIG_GNSS is not set
CONFIG_MTD=y
# CONFIG_MTD_TESTS is not set

#
# Partition parsers
#
# CONFIG_MTD_AR7_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_OF_PARTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# end of Partition parsers

#
# User Modules And Translation Layers
#
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y

#
# Note that in some cases UBI block is preferred. See MTD_UBI_BLOCK.
#
CONFIG_FTL=y
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_SM_FTL is not set
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_SWAP is not set
# CONFIG_MTD_PARTITIONED_MASTER is not set

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# end of RAM/ROM/Flash chip drivers

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_INTEL_VR_NOR is not set
# CONFIG_MTD_PLATRAM is not set
# end of Mapping drivers for chip access

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_DATAFLASH is not set
# CONFIG_MTD_MCHP23K256 is not set
# CONFIG_MTD_MCHP48L640 is not set
# CONFIG_MTD_SST25L is not set
CONFIG_MTD_SLRAM=y
CONFIG_MTD_PHRAM=y
CONFIG_MTD_MTDRAM=y
CONFIG_MTDRAM_TOTAL_SIZE=128
CONFIG_MTDRAM_ERASE_SIZE=4
CONFIG_MTD_BLOCK2MTD=y

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOCG3 is not set
# end of Self-contained MTD device drivers

#
# NAND
#
# CONFIG_MTD_ONENAND is not set
# CONFIG_MTD_RAW_NAND is not set
# CONFIG_MTD_SPI_NAND is not set

#
# ECC engine support
#
# CONFIG_MTD_NAND_ECC_SW_HAMMING is not set
# CONFIG_MTD_NAND_ECC_SW_BCH is not set
# CONFIG_MTD_NAND_ECC_MXIC is not set
# end of ECC engine support
# end of NAND

#
# LPDDR & LPDDR2 PCM memory drivers
#
# CONFIG_MTD_LPDDR is not set
# end of LPDDR & LPDDR2 PCM memory drivers

# CONFIG_MTD_SPI_NOR is not set
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
# CONFIG_MTD_UBI_FASTMAP is not set
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_BLOCK is not set
# CONFIG_MTD_HYPERBUS is not set
CONFIG_OF=y
# CONFIG_OF_UNITTEST is not set
CONFIG_OF_KOBJ=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
# CONFIG_OF_OVERLAY is not set
CONFIG_OF_NUMA=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_PARPORT=y
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_1284 is not set
CONFIG_PARPORT_NOT_PC=y
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y
```

If you need more information, feel free to contact me.

Best,
Chenyuan

On 1/23/24, 10:15 AM, "Richard Weinberger" <richard at nod.at> wrote:

    Chenyuan,

    ----- Ursprüngliche Mail -----
    > Von: "Yang, Chenyuan" <cy54 at illinois.edu>
    > An: "linux-mtd" <linux-mtd at lists.infradead.org>, "richard" <richard at nod.at>, "Miquel Raynal"
    > <miquel.raynal at bootlin.com>, "Vignesh Raghavendra" <vigneshr at ti.com>
    > CC: "syzkaller" <syzkaller at googlegroups.com>, "Zhao, Zijie" <zijie4 at illinois.edu>, "Zhang, Lingming"
    > <lingming at illinois.edu>
    > Gesendet: Dienstag, 23. Januar 2024 16:30:59
    > Betreff: Re: [Linux Kernel Bug] WARNING: zero-size vmalloc in ubi_read_volume_table

    > Dear Linux Kernel Developers for UBI,
    > 
    > I am writing to inquire if there have been any updates regarding the crash issue
    > previously discussed. I would like to suggest a potential solution: adding a
    > check for the malloc size could possibly prevent crashes caused by zero-size
    > vmalloc.
    > 
    > Your insights on this matter would be greatly appreciated. Thank you for your
    > time and dedication

    Before we add a check, what MTD are you using?
    Can you share the parameters? Erase size, etc...

    Thanks,
    //richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: config
Type: application/octet-stream
Size: 245742 bytes
Desc: config
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20240123/13babe74/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: machineInfo0
Type: application/octet-stream
Size: 3699 bytes
Desc: machineInfo0
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20240123/13babe74/attachment-0003.obj>


More information about the linux-mtd mailing list