lkml.org 
[lkml]   [2011]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] Notify container-init parent a 'reboot' occured
On 08/12/2011 06:29 PM, Serge Hallyn wrote:
> Quoting Daniel Lezcano (daniel.lezcano@free.fr):
> ...
>>> Doesn't this mean that an unprivileged task in a container can shut
>>> down the container?
>> Ha ha ! Right, good catch :)
>>
>> Yes, rethinking about it, we can do what initially proposed Bruno by
>> just preventing to reboot when we are not in the init_pid_ns. Actually,
>> the sys_reboot occurs after the services shutdown and "kill -1 SIGTERM"
>> and "kill -1 SIGKILL", and would not make sense to do that in a child
>> pid namespace, except if we are in a container where we don't want to
>> reboot :)
>>
>> So IMO, it is safe to do:
>>
>> if (!ns_capable(current_pid_ns()->user_ns, CAP_SYS_BOOT))
>> return -EPERM;
>>
>> if (pid_ns != &init_pid_ns)
>> return pid_namespace_reboot(pid_ns, cmd, buffer);
> So I don't know if you want to prepend
> http://kernel.ubuntu.com/git?p=serge/linux-syslogns.git;a=commit;h=63556e9a39bcd75ec4a88333425800905013c73e
> to your patchset, or just check nsown_capable(CAP_SYS_BOOT) for now,
> but as soon as you resend with that I'll happily, nay,
> ecstatically ack.

Ok, in order to not mix the functionnalities, I will send in a separate
patch the nsown_capable change.



\
 
 \ /
  Last update: 2011-08-12 22:45    [W:0.061 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site