From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1427006AbcBRU2I (ORCPT ); Thu, 18 Feb 2016 15:28:08 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:36384 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426848AbcBRU2E (ORCPT ); Thu, 18 Feb 2016 15:28:04 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Zhao Lei Cc: "'Mateusz Guzik'" , , References: <20160216142608.GA16757@mguzik> <87k2m33xgj.fsf@x220.int.ebiederm.org> <20160217205407.GD16757@mguzik> <009601d16a43$de01fb80$9a05f280$@cn.fujitsu.com> Date: Thu, 18 Feb 2016 14:18:03 -0600 In-Reply-To: <009601d16a43$de01fb80$9a05f280$@cn.fujitsu.com> (Zhao Lei's message of "Thu, 18 Feb 2016 19:59:48 +0800") Message-ID: <877fi122o4.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX19NeXVE2z1rQm0yHFRgbvkgjgfJFB2w8gM= X-SA-Exim-Connect-IP: 67.3.245.179 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 1.0 T_XMDrugObfuBody_06 obfuscated drug references X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Zhao Lei X-Spam-Relay-Country: X-Spam-Timing: total 556 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.3 (0.6%), b_tie_ro: 2.3 (0.4%), parse: 0.83 (0.1%), extract_message_metadata: 18 (3.3%), get_uri_detail_list: 2.5 (0.5%), tests_pri_-1000: 9 (1.5%), tests_pri_-950: 1.24 (0.2%), tests_pri_-900: 1.04 (0.2%), tests_pri_-400: 28 (5.0%), check_bayes: 27 (4.8%), b_tokenize: 7 (1.3%), b_tok_get_all: 10 (1.7%), b_comp_prob: 2.6 (0.5%), b_tok_touch_all: 4.7 (0.8%), b_finish: 0.72 (0.1%), tests_pri_0: 360 (64.8%), check_dkim_signature: 0.81 (0.1%), check_dkim_adsp: 4.7 (0.8%), tests_pri_500: 132 (23.7%), poll_dns_idle: 126 (22.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] Make core_pattern support namespace X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Zhao Lei writes: > Hi, Mateusz Guzik > >> -----Original Message----- >> From: Mateusz Guzik [mailto:mguzik@redhat.com] >> Sent: Thursday, February 18, 2016 4:54 AM >> To: Eric W. Biederman >> Cc: Zhao Lei ; containers@lists.linux-foundation.org; >> linux-kernel@vger.kernel.org >> Subject: Re: [PATCH] Make core_pattern support namespace >> >> On Wed, Feb 17, 2016 at 02:15:24PM -0600, Eric W. Biederman wrote: >> > Mateusz Guzik writes: >> > > On Tue, Feb 16, 2016 at 07:33:39PM +0800, Zhao Lei wrote: >> > >> For container based on namespace design, it is good to allow >> > >> each container keeping their own coredump setting. >> > > >> > > Sorry if this is a false alarm, I don't have easy means to test it, but >> > > is not this an immediate privilege escalation? >> > >> > It is. This is why we do not currently have a per namespace setting. >> > >> >> Thanks for confimation. >> >> > Solving the user mode helper problem is technically a fair amount of >> > work, if not theoretically challenging. >> > >> >> Well, I would say custom core_patterns without pipe support are still >> better than none. >> > +1. -1. The problem is solvable. It is just a matter of effort to build the necessary infrastructure and make certain everything works correctly. >> Say one would ensure a stable core_pattern (i.e. that it cannot be >> modified as it is being parsed) and a restricted set of allowed >> characters in the pattern (which would not include the pipe), validated >> when one attempts to set the pattern. >> >> Does this sound acceptable? If so, and there are no counter ideas from >> Lei, I can get around to that. >> > If we can let kernel select pipe_program in vm's filesystem, and run > pipe_program with vm's filesystem, set a pipe for core_patterm in vm > will be safe. > What is your opinion on above solution? Please see the other thread about user mode helpers that is current active on the container mailling list. > If above way is not acceptable, or impossible to realize, I also > agree your solution of limit vm setting pipe. I honestly think have a fully capable system that we have now that is capable of using setns and entering a containers context is better than something half baked. The solution either needs to support everything core_pattern does today but correctly in a container environment. To make the case that something does not need to be supported, a convincing argument needs to be presented and tested that no one ever does that. Without such an argument you will be breaking userspace in a different way. Not actually fixing things. My baseline reference implementation of all of this is that it is possible when a sufficiently privileged process writes to core_pattern to fork a child with the same environment and context as the writer. That forked child could then become a kernel thread and fork any additional children needed as user mode helpers. Eric