Messages in this thread | | | Subject | Re: [PATCH v2] UBIFS: compute KSA size and store in superblock | From | Artem Bityutskiy <> | Date | Thu, 31 May 2012 13:36:05 +0300 |
| |
On Thu, 2012-05-31 at 13:19 +0300, Artem Bityutskiy wrote: > Why assert? The point is that if we read the superblock we should check > that it is sane. See teh validate_sb() function. If any of the above 2 > checks fail - the superblock is insane and we should refuse mounting.
Let me put it this way. You are reading the KSA-related fields from the flash. You cannot assume they have reasonable values to prevent attacks.
This is the general UBI/UBIFS pattern - we validate everything we read from the flash. We check the CRC and make sure all the fields we use have reasonable values.
-- Best Regards, Artem Bityutskiy [unhandled content-type:application/pgp-signature] | |