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] [day] [month] [year] [list]
Date:	Fri, 16 Aug 2013 17:07:31 +0300
From:	Artem Bityutskiy <dedekind1@...il.com>
To:	Andrew Rybchenko <Andrew.Rybchenko@...etlabs.ru>
Cc:	linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] ubi: remove and create MTD device back when UBI
 volume is resized

On Mon, 2013-08-12 at 15:17 +0400, Andrew Rybchenko wrote:
> If underlying MTD device size is simply corrected (as it was before),
> MTD block device is not notified about MTD device size change. As the
> result, for example, mount fails after create with zero size, resize,
> write file system image.
> 
> Side effect of the patch is change of MTD device number on resize/update.
> 
> Signed-off-by: Andrew Rybchenko <Andrew.Rybchenko@...etlabs.ru>

Usually MTD devices never change their size, and the whole MTD subsystem
is implemented with this assumption, and the users of the MTD interface
have the same assumption - MTD devices do not size change their size.

So this change is fixing one problem by introducing another problem -
now not only the size may change, but the device number may change, and
even more ...

> +		gluebi_remove(&nt->vi);

... the device may just disappear for a while (not, the mtd mutex is
dropped here).

> +		gluebi_create(&nt->di, &nt->vi);

... then appear again in a different form :-)

When you remove the device, you also remove its sysfs files. And then
re-creates it. What an app keeps it open? Not big deal, it'll just get a
read error next time it reads it.

Anyway, this patch is not ideal.

I guess the right way to solve the problem would be to just prohibit
re-sizing a UBI volumes if we use gluebi.

Or just put the entire emulated MTD device to some "invalid" state if
the underlying UBI volume was resized. May be not always, but only if it
became smaller.

Or something else.

Anyway, I do acknowledge this is a problem, but I am not sure this is a
good solution...

-- 
Best Regards,
Artem Bityutskiy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ