Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3547285pxk; Mon, 21 Sep 2020 17:26:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLO8FyaTG8q7HQ9eFxqQydXvptFb46t5he8K37CxkaZjCJJtQmrKHLvCRpEZ5H5V4pTSDe X-Received: by 2002:a17:906:7f06:: with SMTP id d6mr2057228ejr.553.1600734399390; Mon, 21 Sep 2020 17:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600734399; cv=none; d=google.com; s=arc-20160816; b=UEd5FLfO6Jil5xlbc9q1cCd4TZSK2IXyR5dSY9d3jb+A8WrOlLdUd6OTEX2LjzcavW xOKCvYWQCfmPlzLUHOY/L9b7ONXRg+ZlKD9UldLSpfXkWpNp2fYc1UAFScjDszd32t8B LufhE/J9xnVEjUhJzUqfSVefauqgCi4MNjztGNn1ilAaMdoleCsLJYlD+9/82paiYRu0 McfBhM8o7gr9wTi4boZjDw5i6HqJI3uxcxe+6kB8/84xaHStsDX2OFGGCMUw+6+M51si 2u/vpWtWOLOUw7mSxCKcESg2An4N+ZEmnjuRRO0DrDBMp6wZwMXaqjr6OZs50ZchzI3y n/yQ== 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=lBfBHyTFdB0GrrgRVq0oHDvf2JAuR+4dHuUo0HlID4Y=; b=kgUMbRbdFYkjqSJXoV4/U5JTa+P+Mhnjksl4jyMwcpYTKiLa2S7hlc3x5/7XnApN5N o6tZq1wieI0IBNa2Sczfo6K03LtmkNtyA0dV7HftvDb1rqCCPLKMGWePI9WmMpxDa436 cj7nNSrATK/+0mM99WIJfos6ACLHhbxccwNjbhPQQ+W2ccRNrVvVOdndEclTzQ5dbove A6UYMPfnK7Z/I9UWiNWx7dnk7KwvXXb7wcc6RKCFkcWyGlZl3K18d8FslGKqhOwJTL4W hX9BYIfu36e6GniID7JM4FYwzGP7eis6Ap7yHCEPjZ0MqAYPMCn2zMPXMwqw5ZvPnEQr sOFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r5sE+p/X"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si9842519ejp.711.2020.09.21.17.26.15; Mon, 21 Sep 2020 17:26:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r5sE+p/X"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728720AbgIUXIM (ORCPT + 99 others); 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-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