lkml.org 
[lkml]   [2013]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC 1/2] export unpack_to_rootfs
From
On Tue, Feb 5, 2013 at 6:48 PM, Peter Jones <pjones@redhat.com> wrote:
> On Tue, Feb 05, 2013 at 02:34:49PM +0200, Dmitry Kasatkin wrote:
>> Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
>> ---
>> init/do_mounts.h | 2 ++
>> init/initramfs.c | 2 +-
>> 2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/init/do_mounts.h b/init/do_mounts.h
>> index f5b978a..11829eb 100644
>> --- a/init/do_mounts.h
>> +++ b/init/do_mounts.h
>> @@ -74,3 +74,5 @@ void md_run_setup(void);
>> static inline void md_run_setup(void) {}
>>
>> #endif
>> +
>> +char * __init unpack_to_rootfs(char *buf, unsigned len);
>> diff --git a/init/initramfs.c b/init/initramfs.c
>> index 84c6bf1..e32bc06 100644
>> --- a/init/initramfs.c
>> +++ b/init/initramfs.c
>> @@ -421,7 +421,7 @@ static unsigned my_inptr; /* index of next byte to be processed in inbuf */
>>
>> #include <linux/decompress/generic.h>
>>
>> -static char * __init unpack_to_rootfs(char *buf, unsigned len)
>> +char * __init unpack_to_rootfs(char *buf, unsigned len)
>> {
>> int written, res;
>> decompress_fn decompress;
>
> Doing this unconditionally seems to be inviting rootkit authors to use a
> new and shiny tool. I also don't think it's the best way to do this,
> but I'll comment on the other patch to explain why.
>

Sorry for re-post, but answering from mobile was in HTML and it was blocked.
Modifying an initramfs gives the same opportunity during boot only.
But agreed, it might be the part of the primary source code. It was
very to do it in this way to implement and test a solution.

Thanks.

> --
> Peter


\
 
 \ /
  Last update: 2013-02-05 19:21    [W:0.084 / U:2.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site