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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1f5412e0-f332-428f-899f-26ca06a3b0a4@prolan.hu>
Date: Thu, 8 May 2025 11:42:32 +0200
From: Csókás Bence <csokas.bence@...lan.hu>
To: Richard Weinberger <richard@....at>
CC: Michael Walle <mwalle@...nel.org>, linux-mtd
	<linux-mtd@...ts.infradead.org>, linux-kernel <linux-kernel@...r.kernel.org>,
	Tamás Szentendrei <szentendrei.tamas@...lan.hu>, "Tudor
 Ambarus" <tudor.ambarus@...aro.org>, pratyush <pratyush@...nel.org>, "Miquel
 Raynal" <miquel.raynal@...tlin.com>, Vignesh Raghavendra <vigneshr@...com>
Subject: Re: [PATCH] spi-nor: Verify written data in paranoid mode

Hi Richard,

On 2025. 04. 16. 20:41, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>> Von: "Csókás Bence" <csokas.bence@...lan.hu>
>>> I'm not so sure whether it makes sense at all.
>>> In it's current form, there is no recovery. So anything non-trivial
>>> on top of the MTD will just see an -EIO and has to give up.
>>> E.g. a filesystem will remount read-only.
>>
>> In our case, we use UBIFS on top of UBI, which in this case chooses
>> another eraseblock to hold the data instead, then re-tests (erase+write
>> cycles) the one which gave -EIO. Since the bus error is only transient,
>> it goes away by this time, and thus UBIFS will recover from this cleanly.
> 
> Are you sure about that?
> 
> I'd expect UBI to go into RO mode via a call path like:
> ubi_eba_write_leb() -> ubi_io_write() -> mtd_write()
> If mtd_write() returns an EIO, UBI will go into RO mode immediately.
> 
> (I'm assuming, your SPI-NOR has no bad block support, so ubi->bad_allowed
> is false).

You are right, in our case we had to patch bad_allowed to be true. But 
the point is, that UBIFS _does_ get notified, and it _does_ go into RO 
mode, instead of getting success from mtd_write(), even though the 
written data was corrupted.

On 2025. 04. 16. 14:38, Csókás Bence wrote:
 > We _could_ make it MTD-wide, in our case we only have a NOR Flash
 > onboard so this is where we added it. If it were in the MTD core, where
 > would it make sense?
 >
 > * mtd_write()
 > * mtd_write_oob()
 > * mtd_write_oob_std()
 > * or somewhere else entirely?

I'm now starting to think mtd_write_oob() would be the right place for 
it. Thoughts?

Bence


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ