[PATCH v2 2/2] UBI: Make mtd parameter readable

Andy Shevchenko andriy.shevchenko at linux.intel.com
Tue Jan 10 05:48:31 PST 2017


On Tue, 2017-01-10 at 14:33 +0100, Richard Weinberger wrote:
> Andy,
> 
> On Tue, Jan 10, 2017 at 1:56 PM, Andy Shevchenko
> <andriy.shevchenko at linux.intel.com> wrote:
> > Fix permissions to allow read mtd parameter back (only for owner).
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> 
> Please CC all maintainers in future. Otherwise the chance is high that
> I'll miss a patch.

Noted.

> > -module_param_call(mtd, ubi_mtd_param_parse, NULL, NULL, 000);
> > +module_param_call(mtd, ubi_mtd_param_parse, NULL, NULL, 0400);

> What is the use case?
> AFAIKT the permissions are 000

If it's not 0 in current case than you easily crash the kernel because
parser will be gone at that time. This is fixed by patch 1.

>  because a parser is involved and to
> "understand" the parameter,
> a reader needs the ubi_mtd_param_parse() function.

Are you implying that writer is a bot and reader is human being? 
The use case is obvious (any security reasons are implied?) -- allow
user to see what was written there in the first place.

Permissions 0000 are error prone.

-- 
Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Intel Finland Oy



More information about the linux-mtd mailing list