Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3757855imj; Tue, 19 Feb 2019 08:57:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IapSnYTSqJsltAYhJtbEg5wpiHle47g3khBJoBtcQuK7yhXY8nNMeJnUNmitmtJisegQp01 X-Received: by 2002:a62:7602:: with SMTP id r2mr30213454pfc.191.1550595434128; Tue, 19 Feb 2019 08:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550595434; cv=none; d=google.com; s=arc-20160816; b=nTMgxjcEalTJG9eFeKUQnx+RA2x7dwz/4awFHmJMIbAgJddIuQm6Yeaz5VcFfNXlsl Goqbx3NHVkPsIJ4kE7MYAEfNZHz2W/I/Rcux1QllWEqQs32Xfz9bxGNfpv1iITiayqjE bsdL/FY+AElDmrrtRO2avGxr96LlkdBvKS2PYRtzTCjoiyie2Lie0V1+xd6GjIaMa2zu qG4vwSm+zbAUYurnK+6QSg1GOduHbUFNKagvMmeK9EGc+LeS2V4vVf0mlBKb9HSyWhrt UXP9S+LMIFISbliCP1DUayXMKW2hrvqNPKGYvDW4mQXQq3q1yRY2SHLNbdBY8Fmijokq /VaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from; bh=ISkvigSuIEgqcmplU4sj6X/Bfwaeoyu8GgNyrbHnWk0=; b=tjT5CMkVPzhClAzz75XX1ArdEc71RMk8g4+bU8dlEcvOms0RStSzaMpHh2rb0ibnm/ yu0lCE7NEHVFjP7Q3dDxA8Wb6+NWmAnrnsBXXqLD17xw7Ej1rtxwXfxPeXd5yHibzFE+ +EazDaoHhpCMKM0ztBdPP24w0RI/17xXODA85bNeEs1DwX/uQ0/15UCaLhDLyN4wY/1G dQXdrf+XYWwaZnJLJi4IlukEqtzm0PSNC+zaFczWGFCXV3nBUTpIOHJKsJGzNE67gaAA My0iNNXxGybGv38gFIAhey6CC5n0nvALon0mLRS/x7TKmB1sLllsYu5Dzr+ycV+YoTJK 7Opg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si10653047pls.432.2019.02.19.08.56.58; Tue, 19 Feb 2019 08:57:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729433AbfBSQ4T (ORCPT + 99 others); Tue, 19 Feb 2019 11:56:19 -0500 Received: from out02.mta.xmission.com ([166.70.13.232]:40259 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbfBSQ4S (ORCPT ); Tue, 19 Feb 2019 11:56:18 -0500 Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1gw8gr-0004sc-CN; Tue, 19 Feb 2019 09:56:17 -0700 Received: from ip68-227-174-240.om.om.cox.net ([68.227.174.240] helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1gw8gq-0006os-E3; Tue, 19 Feb 2019 09:56:16 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: David Howells Cc: keyrings@vger.kernel.org, trond.myklebust@hammerspace.com, sfrench@samba.org, linux-security-module@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, rgb@redhat.com, linux-kernel@vger.kernel.org References: <155024683432.21651.14153938339749694146.stgit@warthog.procyon.org.uk> <155024685321.21651.1504201877881622756.stgit@warthog.procyon.org.uk> Date: Tue, 19 Feb 2019 10:56:05 -0600 In-Reply-To: <155024685321.21651.1504201877881622756.stgit@warthog.procyon.org.uk> (David Howells's message of "Fri, 15 Feb 2019 16:07:33 +0000") Message-ID: <87h8czvhsq.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1gw8gq-0006os-E3;;;mid=<87h8czvhsq.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.240;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+Hkz9xC2ZtoJq9WrUfQB5JLxVLoRP611w= X-SA-Exim-Connect-IP: 68.227.174.240 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa06.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,XMNoVowels,XMSubLong autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;David Howells X-Spam-Relay-Country: X-Spam-Timing: total 306 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 2.9 (0.9%), b_tie_ro: 1.96 (0.6%), parse: 0.90 (0.3%), extract_message_metadata: 11 (3.7%), get_uri_detail_list: 1.34 (0.4%), tests_pri_-1000: 13 (4.4%), tests_pri_-950: 1.35 (0.4%), tests_pri_-900: 1.17 (0.4%), tests_pri_-90: 21 (7.0%), check_bayes: 20 (6.4%), b_tokenize: 7 (2.2%), b_tok_get_all: 6 (1.9%), b_comp_prob: 2.1 (0.7%), b_tok_touch_all: 3.3 (1.1%), b_finish: 0.61 (0.2%), tests_pri_0: 242 (79.4%), check_dkim_signature: 0.59 (0.2%), check_dkim_adsp: 2.3 (0.8%), poll_dns_idle: 0.73 (0.2%), tests_pri_10: 2.2 (0.7%), tests_pri_500: 6 (1.8%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC PATCH 02/27] containers: Implement containers as kernel objects X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Howells writes: The container id details are ludicrous and will break practically every use case. This completely unacceptable. Nacked-by: "Eric W. Biederman" > diff --git a/include/linux/container.h b/include/linux/container.h > new file mode 100644 > index 000000000000..0a8918435097 > --- /dev/null > +++ b/include/linux/container.h > +/* > + * The container object. > + */ > +struct container { > + u64 id; /* Container ID */ ... No. This is absolutely unacceptable. As this breaks breaks nested containers and process migration. > +}; > + > diff --git a/include/linux/sched.h b/include/linux/sched.h > index d2f90fa92468..073a3a930514 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -36,6 +36,7 @@ struct backing_dev_info; > struct bio_list; > struct blk_plug; > struct cfs_rq; > +struct container; > struct fs_struct; > struct futex_pi_state; > struct io_context; > @@ -870,6 +871,8 @@ struct task_struct { > > /* Namespaces: */ > struct nsproxy *nsproxy; > + struct container *container; > + struct list_head container_link; Why? nsproxy would be a much cheaper location to put this. Less space and less foobar. > /* Signal handlers: */ > struct signal_struct *signal; > diff --git a/kernel/container.c b/kernel/container.c > new file mode 100644 > index 000000000000..ca4012632cfa > --- /dev/null > +++ b/kernel/container.c > @@ -0,0 +1,348 @@ [...] > + > + c->id = atomic64_inc_return(&container_id_counter); This id is not in a namespace, and it doesn't have enough bits of entropy to be globally unique. Not that 64bit is enough to have a chance at being globablly unique. Eric