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=-3.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 2E88DC4727C for ; Mon, 21 Sep 2020 23:08:17 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A66AD21D7D for ; Mon, 21 Sep 2020 23:08:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r5sE+p/X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A66AD21D7D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=containers-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4D3962152A; Mon, 21 Sep 2020 23:08:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iqNoCwqU2nh1; Mon, 21 Sep 2020 23:08:14 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id A810D21509; Mon, 21 Sep 2020 23:08:14 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 83FDEC0889; Mon, 21 Sep 2020 23:08:14 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id E06CDC0051 for ; Mon, 21 Sep 2020 23:08:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A2A132079A for ; Mon, 21 Sep 2020 23:08:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zqhp0kQNRtrH for ; Mon, 21 Sep 2020 23:08:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by silver.osuosl.org (Postfix) with ESMTPS id E8D53203FA for ; Mon, 21 Sep 2020 23:08:11 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id d9so10654696pfd.3 for ; Mon, 21 Sep 2020 16:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lBfBHyTFdB0GrrgRVq0oHDvf2JAuR+4dHuUo0HlID4Y=; b=r5sE+p/X8SNAElkJRkDSnQzx0S4DN0CDeKyfqmDxEhZlwvq/R+7k9LVFWChxQ9/Hga ryFDidiT4m48YQgSv9p5hPAY5WUyK0H4Jht8r+Q3cO7M2jQjVIfPEhnC71loez6a2ipq dMrBgyUI+nW3kxCM9zHIor/Xs9tIECIXv/a8JZ5gyMxb36AWnjPChH2H4S4IzCHmeIp3 l5XL4wmCg4NI91dhdx/ZR4y/2cpik2xT17+wTpZwnU9x1kVRkPwFJoQtgY4xswu0Zbm/ cm/r1o+7/VvvbTq3+smZGlsE5EQSp1p2Ec+rWQn0Y8KDSY709ebTYxieGwqfr17B1NaT EVnw== 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=lBfBHyTFdB0GrrgRVq0oHDvf2JAuR+4dHuUo0HlID4Y=; b=TjWsec4rP4PLCp7iJo5OG7RHoG3bbce1OvYr+HNlBk7YmoB98bGZuQkVcf7oiLkafb PLq5SYoAzk0JTBPNKTO7xUlPSnGoZmR2SQfCUqMdc6DAxFNLr3GkO//yk6k0Z92F7B+I WHuNGaFQEcImZ9qCv+KOnEWibkB+XYDkDSN11OAe7MP7R40+9XiYftlIqtG8J9hTytB3 tzpTemSLRhBzI6Nw1NFoBVkDaY0GKYuI6LfPHkQ0rcDlu1jQA1BtXPcTA5TbBabz2dri gvRd7OcXmA3NVkqvrgwamgPQ/ghMu/G4+Leme1+Q3cyUPjkvGKE5geYupxpMfgAxpYNV M9nQ== X-Gm-Message-State: AOAM533QfsMMl3XORKNSK7USjUIgIZyLBo9B9TsFWSyAn9fNSo8J+zBt Xskh/Y1MLp4UzCG/hSd0YhUhLV4YBZSsu92EPwc= X-Google-Smtp-Source: ABdhPJwy4fPLgzwON5U2AO0MT+kd18TdzvBlPldd1/YW/sgykFmO9ubSe4y6iUOpS3BqvX1ZvjhjxEcbVPrH0iq/ghM= X-Received: by 2002:a17:902:ed4b:b029:d1:cbfc:6382 with SMTP id y11-20020a170902ed4bb02900d1cbfc6382mr1911724plb.24.1600729691515; Mon, 21 Sep 2020 16:08:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: YiFei Zhu Date: Mon, 21 Sep 2020 18:08:00 -0500 Message-ID: Subject: Re: [RFC PATCH seccomp 2/2] seccomp/cache: Cache filter results that allow syscalls To: Jann Horn Cc: Andrea Arcangeli , Giuseppe Scrivano , Will Drewry , Kees Cook , YiFei Zhu , kernel list , Linux Containers , Tobin Feldman-Fitzthum , Hubertus Franke , Andy Lutomirski , Valentin Rothberg , Dimitrios Skarlatos , Jack Chen , Josep Torrellas , bpf , Tianyin Xu X-BeenThere: containers@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux Containers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: containers-bounces@lists.linux-foundation.org Sender: "Containers" On Mon, Sep 21, 2020 at 5:58 PM Jann Horn wrote: > > I do agree that an immutable bitmask is faster and easier to reason > > about its correctness. However, I did not find the "code to statically > > evaluate the filter for all syscall numbers" while reading seccomp.c. > > Would you give me a pointer to that and I will see how to best make > > use of it? > > I'm talking about the code you're adding in the other patch ("[RFC > PATCH seccomp 1/2] seccomp/cache: Add "emulator" to check if filter is > arg-dependent"). Sorry, that was a bit unclear. I see, building an immutable accept bitmask when preparing and then just use that when running it. I guess if the arch number issue is resolved this should be more doable. Will do. YiFei Zhu _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/containers 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=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 C402DC4727E for ; Mon, 21 Sep 2020 23:08:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75D582388B for ; Mon, 21 Sep 2020 23:08:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r5sE+p/X" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728751AbgIUXIM (ORCPT ); Mon, 21 Sep 2020 19:08:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbgIUXIM (ORCPT ); Mon, 21 Sep 2020 19:08:12 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC26FC061755; Mon, 21 Sep 2020 16:08:11 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id 7so10318231pgm.11; Mon, 21 Sep 2020 16:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lBfBHyTFdB0GrrgRVq0oHDvf2JAuR+4dHuUo0HlID4Y=; b=r5sE+p/X8SNAElkJRkDSnQzx0S4DN0CDeKyfqmDxEhZlwvq/R+7k9LVFWChxQ9/Hga ryFDidiT4m48YQgSv9p5hPAY5WUyK0H4Jht8r+Q3cO7M2jQjVIfPEhnC71loez6a2ipq dMrBgyUI+nW3kxCM9zHIor/Xs9tIECIXv/a8JZ5gyMxb36AWnjPChH2H4S4IzCHmeIp3 l5XL4wmCg4NI91dhdx/ZR4y/2cpik2xT17+wTpZwnU9x1kVRkPwFJoQtgY4xswu0Zbm/ cm/r1o+7/VvvbTq3+smZGlsE5EQSp1p2Ec+rWQn0Y8KDSY709ebTYxieGwqfr17B1NaT EVnw== 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=lBfBHyTFdB0GrrgRVq0oHDvf2JAuR+4dHuUo0HlID4Y=; b=Vajx3+gjINcYQFKaqqnNL/WzKnAc2G0Ow39l9H8okTRf4YaJEmDcf9beU9+h9GejZb FuH4pgVFBiwz4PGyOd5CC8pLEWKdzqC+BSSGEXqsOzmpA2Bdmi4p+YGkS0eexUO4C2q1 lf1RzLpWT1AP/isM7H9LTzJZxpb0JWQb3p4lOiSiRaJpdYjc+hjss/jVgKgENeUxOC6Y 3Wi5BSz1ylnrftrqCFVTILNzcpFIrB711sYQv15/VPBrzUO7dxyEcMxYktqNsWzSEAWm AXQseDmUorQnGx70bM9ovWji0ZZL5HEaHsEsPGraJW6uPv2uI+tFAg3ZJv82qsT5RAyo Mv7A== X-Gm-Message-State: AOAM5302LImbaqCDmpel4BKJ2Ve6eqsY3LSQTUd9v1UfYvlu4F05sGRB xaYawQotmMuqJ8PqgrPxgpHUOqvm2hqDV3E/rfw= X-Google-Smtp-Source: ABdhPJwy4fPLgzwON5U2AO0MT+kd18TdzvBlPldd1/YW/sgykFmO9ubSe4y6iUOpS3BqvX1ZvjhjxEcbVPrH0iq/ghM= X-Received: by 2002:a17:902:ed4b:b029:d1:cbfc:6382 with SMTP id y11-20020a170902ed4bb02900d1cbfc6382mr1911724plb.24.1600729691515; Mon, 21 Sep 2020 16:08:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: YiFei Zhu Date: Mon, 21 Sep 2020 18:08:00 -0500 Message-ID: Subject: Re: [RFC PATCH seccomp 2/2] seccomp/cache: Cache filter results that allow syscalls To: Jann Horn Cc: Linux Containers , YiFei Zhu , bpf , Andrea Arcangeli , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jack Chen , Josep Torrellas , Kees Cook , Tianyin Xu , Tobin Feldman-Fitzthum , Valentin Rothberg , Andy Lutomirski , Will Drewry , Aleksa Sarai , kernel list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 5:58 PM Jann Horn wrote: > > I do agree that an immutable bitmask is faster and easier to reason > > about its correctness. However, I did not find the "code to statically > > evaluate the filter for all syscall numbers" while reading seccomp.c. > > Would you give me a pointer to that and I will see how to best make > > use of it? > > I'm talking about the code you're adding in the other patch ("[RFC > PATCH seccomp 1/2] seccomp/cache: Add "emulator" to check if filter is > arg-dependent"). Sorry, that was a bit unclear. I see, building an immutable accept bitmask when preparing and then just use that when running it. I guess if the arch number issue is resolved this should be more doable. Will do. YiFei Zhu