Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp978812rwe; Thu, 25 Aug 2022 12:49:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR6LYhcTUZBEhmWgXaAcXynsTLCasbR1mQbaIXeJY2wo0EfTepDs2gL4aaLh/nyfuG0qQIfi X-Received: by 2002:a17:906:5d04:b0:722:f46c:b891 with SMTP id g4-20020a1709065d0400b00722f46cb891mr3506023ejt.4.1661456964285; Thu, 25 Aug 2022 12:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661456964; cv=none; d=google.com; s=arc-20160816; b=S2p0ppV/tjcVWqeRinzcHttQw+oc2SXNKMomMKuCSAR2N5BG2RUfdANvGIdOweW0qF HmCOzJExTUVTx+jI9O9rTHTAXVEJLwyDUVQmwrQHcUDRa1dI1dJdMRz652IQIvieW0eo X916IGE4z+J6TV5wpe0REnNri5nMVsDe1hSV3oSEJR6QdprH8Kl2+g+qJUv15G508m5T JegFFUX/DklUeaIvaN6mgfz8GqXswid0/pPRd1NYiRMdw2nvYk1dNzCrrSjf9h06HBO3 rjUeD1LDuEN3pHyl2+HoyJFPGD0B0ybBrb6QKDbFnymZFlTesm3SMDmjdWQEY48FXnsA AOrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=e8Gq1eg55USHCL83Reobt5ibzPL8cvMuV1NX5De9ZYY=; b=q2Yb/nWpsbwpRGF9YOhYmvnj8vYKxEbyW2OeceO/Bq3B/WMpleeld/CjAmKXUFNIQ7 gFti9ukARR7qlbMPFOj18iw4r5mPm+xu4aIp5faVowPwIg2k6w6vOcnSgQWZak3zZ49x qJj+stkPrRYLlax7DMX7a1QXWjpoEjKng9tzBMb5jomZdXY9RzeicpiMA77OapDSb73b FacpP/AX1Pj6JnkwZKnXCpYFTCtp+N+kV/Y3Rx8dHAsDv4KRcDmioZiqxM8Wur1X1lLB h22S708Tvk7aNWQJBArZBQKYUvF2hdqR3s/vIc1ml3iIerRDB4OmQ16mI7lxFrQwgl47 3Xsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=O7VCw6m6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020a1709065f8500b0072af6e1fff0si44624eju.330.2022.08.25.12.48.58; Thu, 25 Aug 2022 12:49:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=O7VCw6m6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243612AbiHYTTX (ORCPT + 99 others); Thu, 25 Aug 2022 15:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240803AbiHYTTW (ORCPT ); Thu, 25 Aug 2022 15:19:22 -0400 Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A7F3AF0E0 for ; Thu, 25 Aug 2022 12:19:21 -0700 (PDT) Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-11d7a859b3aso14945050fac.4 for ; Thu, 25 Aug 2022 12:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=e8Gq1eg55USHCL83Reobt5ibzPL8cvMuV1NX5De9ZYY=; b=O7VCw6m6DYZ9SRwwETgBSqa1zuOS859jqBgpBIVSG63HOg7KKdU/QyOTg3x2mMKLlZ /sk+enC4j9MprDEgOepuTKPmBoZ+sG3JQUyandbIfwWBmTyew+NcfQNlQxrCLf562JLt CBDBuBCbwtrJNQe3ltgbUG8+lxI+qESJLbZ0QjttHTgIelL4DCFUrpjqekdSpJmnnmqw 5+qWUz8Dkm4iat2Vs0aOfyU5R/QMPzUhEaDtsp239vjwfrvwNLroQmHWmjQKOUL6AgDf 0aK+BsUrax9MV0QeahftRbTrPT7WR2Q4AhsrTUIGzz3L/CutBwNsczdrnoWMGQfm8Wko Shzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=e8Gq1eg55USHCL83Reobt5ibzPL8cvMuV1NX5De9ZYY=; b=cUwXOwT6Tq1Vg0EocsfBKpYJOsS5sgZ1oaAxP/L7TtieVDqpKWV42ey2E7s34NqH9D HvylcEeEUqSVhGZ1SDfAUrWIPOLXdAd5XNhgJyB5G7G39pzAI1rmm9+dWSDl1y0yPz1C OpWfPIvjnQGsE4Pmlw/5IkDD/ypBq2OMUUClmIGdEUWqDTPTxEZJYf5ztJcwnUIy0rcj /gPKv7fnQjSEXwjEcOxQ5UD9bZRrsft0uXHwa+xbhRMSDa2sFwRkP43paAOwFsaSQz6H GjXLSGQxnMyMPr4V5aEzyCAUcs2luKAUOZa2F0Kr/nAtGjv2WeqPGWDvqf7GmpKcHtmk Qolw== X-Gm-Message-State: ACgBeo0canYYQyH6HHVzbfFaSxUCm/ZNkrMtKiqjfJvVEfikYSNQ2ce1 S7Snp/H13ksxArk8VyBKQodqnwW32DM6Di3r2Xg+ X-Received: by 2002:a05:6870:a78d:b0:11c:437b:ec70 with SMTP id x13-20020a056870a78d00b0011c437bec70mr257186oao.136.1661455160511; Thu, 25 Aug 2022 12:19:20 -0700 (PDT) MIME-Version: 1.0 References: <8735dux60p.fsf@email.froward.int.ebiederm.org> <871qte8wy3.fsf@email.froward.int.ebiederm.org> <8735du7fnp.fsf@email.froward.int.ebiederm.org> <87tu6a4l83.fsf@email.froward.int.ebiederm.org> <20220818140521.GA1000@mail.hallyn.com> <20220819144537.GA16552@mail.hallyn.com> <875yigp4tp.fsf@email.froward.int.ebiederm.org> In-Reply-To: <875yigp4tp.fsf@email.froward.int.ebiederm.org> From: Paul Moore Date: Thu, 25 Aug 2022 15:19:09 -0400 Message-ID: Subject: Re: [PATCH v5 0/4] Introduce security_create_user_ns() To: "Eric W. Biederman" Cc: "Serge E. Hallyn" , Linus Torvalds , Frederick Lawler , kpsingh@kernel.org, revest@chromium.org, jackmanb@chromium.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, jmorris@namei.org, stephen.smalley.work@gmail.com, eparis@parisplace.org, shuah@kernel.org, brauner@kernel.org, casey@schaufler-ca.com, bpf@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kernel-team@cloudflare.com, cgzones@googlemail.com, karl@bigbadwolfsecurity.com, tixxdz@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 25, 2022 at 2:15 PM Eric W. Biederman wrote: > Paul Moore writes: > > On Fri, Aug 19, 2022 at 10:45 AM Serge E. Hallyn wrote: > >> I am hoping we can come up with > >> "something better" to address people's needs, make everyone happy, and > >> bring forth world peace. Which would stack just fine with what's here > >> for defense in depth. > >> > >> You may well not be interested in further work, and that's fine. I need > >> to set aside a few days to think on this. > > > > I'm happy to continue the discussion as long as it's constructive; I > > think we all are. My gut feeling is that Frederick's approach falls > > closest to the sweet spot of "workable without being overly offensive" > > (*cough*), but if you've got an additional approach in mind, or an > > alternative approach that solves the same use case problems, I think > > we'd all love to hear about it. > > I would love to actually hear the problems people are trying to solve so > that we can have a sensible conversation about the trade offs. Here are several taken from the previous threads, it's surely not a complete list, but it should give you a good idea: https://lore.kernel.org/linux-security-module/CAHC9VhQnPAsmjmKo-e84XDJ1wmaOFkTKPjjztsOa9Yrq+AeAQA@mail.gmail.com/ > As best I can tell without more information people want to use > the creation of a user namespace as a signal that the code is > attempting an exploit. Some use cases are like that, there are several other use cases that go beyond this; see all of our previous discussions on this topic/patchset. As has been mentioned before, there are use cases that require improved observability, access control, or both. > As such let me propose instead of returning an error code which will let > the exploit continue, have the security hook return a bool. With true > meaning the code can continue and on false it will trigger using SIGSYS > to terminate the program like seccomp does. Having the kernel forcibly exit the process isn't something that most LSMs would likely want. I suppose we could modify the hook/caller so that *if* an LSM wanted to return SIGSYS the system would kill the process, but I would want that to be something in addition to returning an error code like LSMs normally do (e.g. EACCES). -- paul-moore.com