RE: [RFC] export module parameters even the permission is zero
From: Wang, Yalin
Date: Wed Jan 21 2015 - 21:10:33 EST
> -----Original Message-----
> From: Rusty Russell [mailto:rusty@xxxxxxxxxxxxxxx]
> Sent: Tuesday, January 20, 2015 2:33 PM
> To: Wang, Yalin; 'akpm@xxxxxxxxxxxxxxxxxxxx'; 'jani.nikula@xxxxxxxxx';
> 'hch@xxxxxxxxxxxxx'; 'hare@xxxxxxx'; 'keescook@xxxxxxxxxxxx'; 'linux-
> kernel@xxxxxxxxxxxxxxx'
> Subject: Re: [RFC] export module parameters even the permission is zero
>
> "Wang, Yalin" <Yalin.Wang@xxxxxxxxxxxxxx> writes:
> > This patch make sure to export module parameters even the permission
> > is zero, this is useful for some platforms like Android, the init
> > process can change the parameter mode/owner by chmod/chown during
> > bootup
> >
> > Signed-off-by: Yalin Wang <yalin.wang@xxxxxxxxxxxxxx>
>
> Hi!
>
> Unfortunately, this won't work. Various parts of the code assume
> that 0 permissions means "cannot be changed or read", so this change would
> introduce many bugs (eg. the parameter could be __initdata).
>
> Since these are owned by root at boot, changing mode and owner should still
> work. However, you can't make a read-only field writable and expect it to
> work.
>
Oh, I see,
This means kernel cmdline can change this module_parameter ignored permission,
Thanks for your comments.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/