From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E823C2D0A8 for ; Thu, 24 Sep 2020 00:46:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F00A23119 for ; Thu, 24 Sep 2020 00:46:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Jm4qQfsF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbgIXAqY (ORCPT ); Wed, 23 Sep 2020 20:46:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbgIXAqO (ORCPT ); Wed, 23 Sep 2020 20:46:14 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA17EC0613D2 for ; Wed, 23 Sep 2020 17:46:12 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id q13so2063459ejo.9 for ; Wed, 23 Sep 2020 17:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IRg8bdIf5EpG+3h++Ew0iu9r6E0witVaxm9lrud8jnM=; b=Jm4qQfsFbsCSvqsbWq7VzfNoNGVob5/4BshRZEiIMaLEiUAXQkk+Y3gcARpDMXU77J RNaw2tpVInTue7BsyBCtZUkwt1eYCijqBRs3vrwEJYWjEAwHJ8jLeLp72F/ENGNnzE/G EKLslOPjHX6mp2Z2Qnz3aMgbngWhizN8kdzLcINc5IUUtx9RxOv0ebO8UbHBC6gSmDIu FMCxqDS4rALBmlhRBAReUsXiYxckjsgN9L9hJAj6XCsRyzlTxLl/Flt+z8WTU64FZVbm sP3KAo4BFVXnMvrmr7UNX6TFr6Ec+XsfqaoZ3kZpDC57gQ1BxVuKxSN63q3jyaZxfJpd B6Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IRg8bdIf5EpG+3h++Ew0iu9r6E0witVaxm9lrud8jnM=; b=le+FDIpyy4I6j3wT9/bsEuh55Tokpr84Dqvdkcgt+RGeQj9O9zzzJs0tI4SvrSDTHe YueVaHaOwr0ZHi/adyUiCQYkWl5GVUWrNC37wG9YJxKcVP2OigAEt4GITLFyu0MCsowN cQ2S37b5tAJUE6s8CjmEFa++f8wTrhXhmCmnxAFgQ2KLHGfjy6Ieb6wGe8+Bk1yPHWuC CY+f70sS7OubqOkVPKXLpiXQoqNb3kgVixbbiNuaRt1Z00RSFDyv2e9g6+KYsRSw2SFr yf3VZNGFuet8oRJ2NQhTXfMs8Bn25Thi6ei6tNwI+1H1sojdsx68VoAHBCBIp/NZw4Py XlEg== X-Gm-Message-State: AOAM531r7Z73W/Xq0ebsJBv3ewGEhzk6701YoRyOW1yeRQWpFnPcxVEj coRkvjaDs/BXWM5tHX7mh5icg+5NiS3auFVZGlRiTA== X-Google-Smtp-Source: ABdhPJzzIXGNXnvZht8wsxEFTZoPCFI82VwWeUCzB6ZEDBf5qTi4KSqQ4F0OnePwzJ5/m1L4tVXPR+clKCQEE2r6v2g= X-Received: by 2002:a17:906:f6c9:: with SMTP id jo9mr2116692ejb.233.1600908371207; Wed, 23 Sep 2020 17:46:11 -0700 (PDT) MIME-Version: 1.0 References: <20200923232923.3142503-1-keescook@chromium.org> <20200923232923.3142503-3-keescook@chromium.org> In-Reply-To: <20200923232923.3142503-3-keescook@chromium.org> From: Jann Horn Date: Thu, 24 Sep 2020 02:45:45 +0200 Message-ID: Subject: Re: [PATCH 2/6] x86: Enable seccomp architecture tracking To: Kees Cook Cc: YiFei Zhu , Christian Brauner , Tycho Andersen , Andy Lutomirski , Will Drewry , Andrea Arcangeli , Giuseppe Scrivano , Tobin Feldman-Fitzthum , Dimitrios Skarlatos , Valentin Rothberg , Hubertus Franke , Jack Chen , Josep Torrellas , Tianyin Xu , bpf , Linux Containers , Linux API , kernel list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Thu, Sep 24, 2020 at 1:29 AM Kees Cook wrote: > Provide seccomp internals with the details to calculate which syscall > table the running kernel is expecting to deal with. This allows for > efficient architecture pinning and paves the way for constant-action > bitmaps. [...] > diff --git a/arch/x86/include/asm/seccomp.h b/arch/x86/include/asm/seccomp.h [...] > +#ifdef CONFIG_X86_64 [...] > +#else /* !CONFIG_X86_64 */ > +# define SECCOMP_ARCH AUDIT_ARCH_I386 > +#endif If we are on a 32-bit kernel, performing architecture number checks in the kernel is completely pointless, because we know that there is only a single architecture identifier under which syscalls can happen. While this patch is useful for enabling the bitmap logic in the following patches, I think it adds unnecessary overhead in the context of the previous patch.