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: <874ir68d4u.fsf@bootlin.com>
Date: Fri, 07 Nov 2025 09:23:29 +0100
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Cheng Ming Lin <linchengming884@...il.com>
Cc: richard@....at,  chengzhihao1@...wei.com,  vigneshr@...com,
  linux-mtd@...ts.infradead.org,  linux-kernel@...r.kernel.org,
  alvinzhou@...c.com.tw,  leoyu@...c.com.tw,  Cheng Ming Lin
 <chengminglin@...c.com.tw>
Subject: Re: [PATCH 1/1] mtd: ubi: skip programming unused bits in ubi headers

Hello,

>> > +     if (ubi->vid_hdr_shift)
>> > +             memset((char *)p, 0xFF, ubi->vid_hdr_alsize - UBI_VID_HDR_SIZE);
>> > +     else
>> > +             memset((char *)p + UBI_VID_HDR_SIZE, 0xFF, ubi->vid_hdr_alsize - UBI_VID_HDR_SIZE);
>>
>> Here I am reaching the limits of my UBI knowledge, so I would prefer
>> Richard to (in)validate what I am saying, but AFAIU, the VID header can
>> be literally anywhere in the page, not just at the start or end of a
>> subpage, so in the vid_hdr_shift I would expect some extra maths to
>> happen, no?
>
> I understand your point now. If the VID header is not guaranteed to be
> at the start or end of a subpage, then yes, my current logic needs to be
> reworked to cover that case.

I don't know if this is easy to do, but maybe you can memset the whole
buffer before filling it. That would avoid the need to know where the
VID header will be.

Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ