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: <2c2c2ce9-795b-4f76-cde9-db4a4066dcc1@huawei.com>
Date:   Sat, 25 Mar 2023 09:02:40 +0800
From:   Zhihao Cheng <chengzhihao1@...wei.com>
To:     Nicolas Schichan <nschichan@...ebox.fr>
CC:     <george.kennedy@...cle.com>, <linux-kernel@...r.kernel.org>,
        <linux-mtd@...ts.infradead.org>, <miquel.raynal@...tlin.com>,
        <richard@....at>, <s.hauer@...gutronix.de>, <yi.zhang@...wei.com>
Subject: Re: [PATCH -next v3] ubi: Fix failure attaching when vid_hdr offset
 equals to (sub)page size

Hi,
> 
>> Following process will make ubi attaching failed since commit
>> 1b42b1a36fc946 ("ubi: ensure that VID header offset ... size"):
>>
>> ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB
>> modprobe nandsim id_bytes=$ID
>> flash_eraseall /dev/mtd0
>> modprobe ubi mtd="0,2048"  # set vid_hdr offset as 2048 (one page)
>> (dmesg):
>>    ubi0 error: ubi_attach_mtd_dev [ubi]: VID header offset 2048 too large.
>>    UBI error: cannot attach mtd0
>>    UBI error: cannot initialize UBI, error -22
>>
>> Rework original solution, the key point is making sure
>> 'vid_hdr_shift + UBI_VID_HDR_SIZE < ubi->vid_hdr_alsize',
>> so we should check vid_hdr_shift rather not vid_hdr_offset.
>> Then, ubi still support (sub)page aligined VID header offset.
>>
>> Fixes: 1b42b1a36fc946 ("ubi: ensure that VID header offset ... size")
>> Signed-off-by: Zhihao Cheng <chengzhihao1@...wei.com>
>> ---
>>   v2->v3: Use printing format '%zu' for UBI_VID_HDR_SIZE.
>>   drivers/mtd/ubi/build.c | 21 +++++++++++++++------
>>   1 file changed, 15 insertions(+), 6 deletions(-)
> 
> [...]
> 
> Hello,
> 
> Having had the problem, and found this patch as a fix, feel free to
> add my:
> 

Thanks for testing.

> Tested-by: Nicolas Schichan <nschichan@...ebox.fr>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ