Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89A14C6FA8E for ; Tue, 28 Feb 2023 19:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229976AbjB1Tj7 (ORCPT ); Tue, 28 Feb 2023 14:39:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbjB1Tjw (ORCPT ); Tue, 28 Feb 2023 14:39:52 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 470BC34C08 for ; Tue, 28 Feb 2023 11:39:30 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id cq23so44795671edb.1 for ; Tue, 28 Feb 2023 11:39:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1677613168; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=38BT0KquELiIMJ2OzHKpw/XOfC/UN72sj2o8O3S8SqU=; b=Hki5ORfQ1PtDXjh1xzjZdnyjFpMFKod2st24LkPgsv8OIGqhI+xw0L51MVejyT5vh7 f0wA+dipoeeO4LwaHFXP5BPjDQGdNM9NR+sEZV+uEd2SdnT8h524CERgtcEIBk6AS1wi JmV8dVC+AmV6jtILZrMrrilHAKZdeEPQpewYA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677613168; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=38BT0KquELiIMJ2OzHKpw/XOfC/UN72sj2o8O3S8SqU=; b=CdYtKN0FHwh3JhMcyKiYTzdujFJnpQBPvjhkjkEFtzwCYqV4TzjjeGYVkBD71KBZjJ dXN3RBkSP7VaJEl7gwH8hnV+Frpfh437kOICrbhfiqaW4J9EaGe+klBCAYkQskbRQhI4 Y4djK/MmC84XvMMphVLziCkras5qD4OzTHz+meVM+EQ/d9Y+72uro4miBfNLBF7l3G6V SnNoDJzbjSaoPaWoodvElyHHr9H+wz+3CjgtlM1QdzXNO9MEZpIVq5Oir9MuWJA/3ofx K3qis0M99qvrsBTOFHg2S/sQHG8JWKIdFn2dbRVvubc/tJgHXO0eJbRQU7KUBAk8tHta 6flw== X-Gm-Message-State: AO0yUKVFeQ+CgOaqQMG48nZQev3WBNpt/I0KzN9kzzygz38x0gH8cnWG M8xopgBF+sI9pMmMK66wYjQ8QQVOq/gz6i0au60= X-Google-Smtp-Source: AK7set9mH0FctwjtkXKU8qd1tO8CdyxYPAftlv11caSKn2IeP4ozp30ALnOWx6iP0RlT5JCfuYOuTw== X-Received: by 2002:a17:906:66d9:b0:8e3:da5c:4fd4 with SMTP id k25-20020a17090666d900b008e3da5c4fd4mr4725663ejp.10.1677613168440; Tue, 28 Feb 2023 11:39:28 -0800 (PST) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com. [209.85.208.44]) by smtp.gmail.com with ESMTPSA id l24-20020a170906939800b008cf1b61a73esm4793420ejx.41.2023.02.28.11.39.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Feb 2023 11:39:27 -0800 (PST) Received: by mail-ed1-f44.google.com with SMTP id da10so44755639edb.3 for ; Tue, 28 Feb 2023 11:39:27 -0800 (PST) X-Received: by 2002:a17:906:79a:b0:8b8:aef3:f2a9 with SMTP id l26-20020a170906079a00b008b8aef3f2a9mr1780793ejc.0.1677613166904; Tue, 28 Feb 2023 11:39:26 -0800 (PST) MIME-Version: 1.0 References: <20230125155557.37816-1-mjguzik@gmail.com> <97465c08-7b6e-7fd7-488d-0f677ac22f81@schaufler-ca.com> In-Reply-To: From: Linus Torvalds Date: Tue, 28 Feb 2023 11:39:09 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/2] capability: add cap_isidentical To: Mateusz Guzik Cc: Casey Schaufler , Serge Hallyn , viro@zeniv.linux.org.uk, paul@paul-moore.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Content-Type: multipart/mixed; boundary="000000000000e29ed205f5c7c0f8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000e29ed205f5c7c0f8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 28, 2023 at 6:47=E2=80=AFAM Mateusz Guzik w= rote: > > Personally I would only touch it as a result of losing a bet (and I'm > not taking any with this in play), but that's just my $0.05 (adjusted > for inflation). Heh. I took that as a challenge. It wasn't actually all that bad (famous last words). For type safety reasons I decided to use a struct wrapper typedef struct { u64 val; } kernel_cap_t; to avoid any nasty silent integer value conversions. But then it was literally just a matter of cleaning up some of the insanity. I think the fs/proc/array.c modification is an example of just how bad things used to be: --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -300,13 +300,8 @@ static inline void task_sig(struct seq_file *m, static void render_cap_t(struct seq_file *m, const char *header, kernel_cap_t *a) { - unsigned __capi; - seq_puts(m, header); - CAP_FOR_EACH_U32(__capi) { - seq_put_hex_ll(m, NULL, - a->cap[CAP_LAST_U32 - __capi], 8); - } + seq_put_hex_ll(m, NULL, a->val, 16); seq_putc(m, '\n'); } note how the code literally did that odd CAP_LAST_U32 - __capi in there just to get the natural "high word first" that is exactly what you get if you just print out the value as a hex number. Now, the actual user mode conversions still exist, but even those often got simplified. Have I actually *tested* this? Of course not. I'm lazy, and everything I write obviously always works on the first try anyway, so why should I? So take this patch with a healthy dose of salt, but it looks sane to me, and it does build cleanly (and with our type system, that actually does say quite a lot). This actually looks sane enough that I might even boot it. Call me crazy. Linus --000000000000e29ed205f5c7c0f8 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_leonjmao0 IGZzL3Byb2MvYXJyYXkuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICA3 ICstCiBpbmNsdWRlL2xpbnV4L2NhcGFiaWxpdHkuaCAgICAgICAgICAgICAgICAgICAgICAgICB8 IDEyOCArKysrKy0tLS0tLS0tLS0tLS0tLS0KIGlvX3VyaW5nL2ZkaW5mby5jICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHwgICA0ICstCiBrZXJuZWwvYXVkaXRzYy5jICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgNiArLQoga2VybmVsL2NhcGFiaWxpdHkuYyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgOTcgKysrKysrKystLS0tLS0tLQoga2Vy bmVsL3VtaC5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgNDEgKysr LS0tLQogc2VjdXJpdHkvYXBwYXJtb3IvcG9saWN5X3VucGFjay5jICAgICAgICAgICAgICAgICAg fCAgNDAgKysrKystLQogc2VjdXJpdHkvY29tbW9uY2FwLmMgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgfCAgNDkgKysrKy0tLS0KIC4uLi9zZWxmdGVzdHMvYnBmL3Byb2dzL3Rlc3RfZGVu eV9uYW1lc3BhY2UuYyAgICAgIHwgICA3ICstCiA5IGZpbGVzIGNoYW5nZWQsIDE1MCBpbnNlcnRp b25zKCspLCAyMjkgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZnMvcHJvYy9hcnJheS5jIGIv ZnMvcHJvYy9hcnJheS5jCmluZGV4IDQ5MjgzYjgxMDNjNy4uOWIwMzE1ZDM0YzU4IDEwMDY0NAot L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ICAgICAgICAgICAgICAgICAgICBcCi0JdW5zaWduZWQgX19jYXBpOyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCUNBUF9GT1JfRUFDSF9V MzIoX19jYXBpKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQkJYy5jYXBb X19jYXBpXSA9IGEuY2FwW19fY2FwaV0gT1AgYi5jYXBbX19jYXBpXTsgICAgIFwKLQl9ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi19 IHdoaWxlICgwKQotCi0jZGVmaW5lIENBUF9VT1BfQUxMKGMsIGEsIE9QKSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFwKLWRvIHsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXVuc2lnbmVkIF9fY2Fw aTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlDQVBfRk9S X0VBQ0hfVTMyKF9fY2FwaSkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0J CWMuY2FwW19fY2FwaV0gPSBPUCBhLmNhcFtfX2NhcGldOyAgICAgICAgICAgICAgICAgICBcCi0J fSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgXAotfSB3aGlsZSAoMCkKKyNkZWZpbmUgY2FwX3JhaXNlKGMsIGZsYWcpICAoKGMpLnZhbCB8 PSBCSVRfVUxMKGZsYWcpKQorI2RlZmluZSBjYXBfbG93ZXIoYywgZmxhZykgICgoYykudmFsICY9 IH5CSVRfVUxMKGZsYWcpKQorI2RlZmluZSBjYXBfcmFpc2VkKGMsIGZsYWcpICgoKGMpLnZhbCAm IEJJVF9VTEwoZmxhZykpICE9IDApCiAKIHN0YXRpYyBpbmxpbmUga2V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