From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BB0172 for ; Thu, 13 May 2021 05:26:31 +0000 (UTC) Received: by mail-pg1-f172.google.com with SMTP id m190so20306234pga.2 for ; Wed, 12 May 2021 22:26:31 -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=y4PJcU19svcp9/MR6WVhgslZEMX/TOTb95M1ykjqumY=; b=kvNPjIHIodRIOmqPVUCvw2VJr1sLnyZ2/BwJCCIPSSU9PlFvNkNEQ4vDjHQxm986Pp KMWl74WGcaCD7dkmdzDG8PsGr4LFXz7m8icZEzE38r8H0RZDWjuBAQuJI9/zCXzoGWHR V2W5GIWIgfxhlU1no0qKTpg1FqmGVEZ63OyIIg1nNE77QXsJuJgecZrWn6UiKrA6mleF 3npXu5/vTLuSnsUF9spv49LSizs79uWTAliScTjTZJRnpF7xIHTym4ruLlZM7kubo86B HtbEjHUcf7gNJrRYjTwp1cO2Jjmc8En4wUhWcAl47wallR/2OjWpBDMFxIfOQb1TIRIn RHhg== 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=y4PJcU19svcp9/MR6WVhgslZEMX/TOTb95M1ykjqumY=; b=hOTbD3cJUvrMOnCnnyclH4pgFa5OfYbKW5Uqct5RF0uAT5/hGb/o+nbhqc5EZwBPo0 mjWNyW/Tptm0zT/lzPFZPmHqpc2q/pVy0cdocyUSdLLs13NjbDuTWkutfs5Hq0JOqdRv P9UdbzT42kkn02GYn5rzJYGF3aWFvplShvxlf6MupLCAOwPElekFAsRSWx+OfhuwdyAw +UOiUi/IhqUzQmTjX7xd5xcGDeJsM9uThmGr0rCYvcxkaUQMvKA7emyrBBMQ48FSSEa1 8Y3fMEtBW98ESlJbdRW5Ha1smEANVgSimGM4HDsd0L1XXAcPDQkGIPbE1BKzko+lKfD3 qVDg== X-Gm-Message-State: AOAM533TNnfY0d5CRa0fyMVfXgHI4YvaDx6cbC0QOobghNgRf9dxjW4s 3c+zP7N6Ukcm97m7UGNr1Pi88NHqkveLgu0+UD4= X-Google-Smtp-Source: ABdhPJwetf7ucCBgJMHapemhtdShZFEnneY9R/qxzx30AscHdVmsjKVKW/KoTs94eio7G5hx0yg6oHunkDwxUsq3Qq4= X-Received: by 2002:a63:465b:: with SMTP id v27mr39714727pgk.445.1620883591109; Wed, 12 May 2021 22:26:31 -0700 (PDT) X-Mailing-List: containers@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <53db70ed544928d227df7e3f3a1f8c53e3665c65.1620499942.git.yifeifz2@illinois.edu> <20210511020425.54nygajvrpxqnfsh@ast-mbp.dhcp.thefacebook.com> <20210512223626.olex7ewf6xd6m2c4@ast-mbp.dhcp.thefacebook.com> In-Reply-To: <20210512223626.olex7ewf6xd6m2c4@ast-mbp.dhcp.thefacebook.com> From: YiFei Zhu Date: Thu, 13 May 2021 00:26:19 -0500 Message-ID: Subject: Re: [RFC PATCH bpf-next seccomp 10/12] seccomp-ebpf: Add ability to read user memory To: Alexei Starovoitov Cc: containers@lists.linux.dev, bpf , YiFei Zhu , LSM List , Alexei Starovoitov , Andrea Arcangeli , Andy Lutomirski , Austin Kuo , Claudio Canella , Daniel Borkmann , Daniel Gruss , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jann Horn , Jinghao Jia , Josep Torrellas , Kees Cook , Sargun Dhillon , Tianyin Xu , Tobin Feldman-Fitzthum , Tom Hromatka , Will Drewry Content-Type: text/plain; charset="UTF-8" On Wed, May 12, 2021 at 5:36 PM Alexei Starovoitov wrote: > Typically the verifier does all the checks at load time to avoid > run-time overhead during program execution. Then at attach time we > check that attach parameters provided at load time match exactly > to those at attach time. ifindex, attach_btf_id, etc fall into this category. > Doing something similar it should be possible to avoid > doing get_dumpable() at run-time. Do you mean to move the check of dumpable to load time instead of runtime? I do not think that makes sense. A process may arbitrarily set its dumpable attribute during execution via prctl. A process could do set itself to non-dumpable, before interacting with sensitive information that would better not be possible to be dumped (eg. ssh-agent does this [1]). Therefore, being dumpable at one point in time does not indicate anything about whether it stays dumpable at a later point in time. Besides, seccomp filters are inherited across clone and exec, attaching to many tasks with no option to detach. What should the load-time check of task dump-ability be against? The current task may only be the tip of an iceburg. [1] https://github.com/openssh/openssh-portable/blob/2dc328023f60212cd29504fc05d849133ae47355/ssh-agent.c#L1398 YiFei Zhu 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=-7.7 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,MENTIONS_GIT_HOSTING, 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 38BB0C433B4 for ; Thu, 13 May 2021 05:26:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F318D61405 for ; Thu, 13 May 2021 05:26:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229935AbhEMF1l (ORCPT ); Thu, 13 May 2021 01:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbhEMF1l (ORCPT ); Thu, 13 May 2021 01:27:41 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C812EC061574; Wed, 12 May 2021 22:26:31 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id e19so2425910pfv.3; Wed, 12 May 2021 22:26:31 -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=y4PJcU19svcp9/MR6WVhgslZEMX/TOTb95M1ykjqumY=; b=kvNPjIHIodRIOmqPVUCvw2VJr1sLnyZ2/BwJCCIPSSU9PlFvNkNEQ4vDjHQxm986Pp KMWl74WGcaCD7dkmdzDG8PsGr4LFXz7m8icZEzE38r8H0RZDWjuBAQuJI9/zCXzoGWHR V2W5GIWIgfxhlU1no0qKTpg1FqmGVEZ63OyIIg1nNE77QXsJuJgecZrWn6UiKrA6mleF 3npXu5/vTLuSnsUF9spv49LSizs79uWTAliScTjTZJRnpF7xIHTym4ruLlZM7kubo86B HtbEjHUcf7gNJrRYjTwp1cO2Jjmc8En4wUhWcAl47wallR/2OjWpBDMFxIfOQb1TIRIn RHhg== 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=y4PJcU19svcp9/MR6WVhgslZEMX/TOTb95M1ykjqumY=; b=JAZKd+G53rEclZFYtoX2/FWj3dXqAt5owV3pIUCJr/6/bo9T6L7M0xHrJNH8/Tsqz4 aF4bCBLauxgBIklDepuJXb7T2FID7WjecqozgJdAZy2GPNAk8cjsRsxPpkngPLizFh6p /5tgF6r/9CJSIEfRqUxY33R3H2zP1x931H6CiVi0omARLWguTB1VirBDjdn5e2SwFh/Y zOxq/bdimy0TELlVVWvsLQ9E8XFHD+m9E0DqQoro9bpng5TUgpK/FuK3I5LZdtfpftXB /jBdgRSuw0rm2uL9YNniw+zmdxIjwKPhs+O5Q6y5K131Q+g2JFDaGgSQtgimogTOKrEV gVkQ== X-Gm-Message-State: AOAM530zW2oUtW5MGmaWGc8WRkhHBgMD9VumQDhN9GxfV+u13sju9+EP d8lM7zUnUUgHM2N26ry/WPHoupTlSqj2DjAdZtk= X-Google-Smtp-Source: ABdhPJwetf7ucCBgJMHapemhtdShZFEnneY9R/qxzx30AscHdVmsjKVKW/KoTs94eio7G5hx0yg6oHunkDwxUsq3Qq4= X-Received: by 2002:a63:465b:: with SMTP id v27mr39714727pgk.445.1620883591109; Wed, 12 May 2021 22:26:31 -0700 (PDT) MIME-Version: 1.0 References: <53db70ed544928d227df7e3f3a1f8c53e3665c65.1620499942.git.yifeifz2@illinois.edu> <20210511020425.54nygajvrpxqnfsh@ast-mbp.dhcp.thefacebook.com> <20210512223626.olex7ewf6xd6m2c4@ast-mbp.dhcp.thefacebook.com> In-Reply-To: <20210512223626.olex7ewf6xd6m2c4@ast-mbp.dhcp.thefacebook.com> From: YiFei Zhu Date: Thu, 13 May 2021 00:26:19 -0500 Message-ID: Subject: Re: [RFC PATCH bpf-next seccomp 10/12] seccomp-ebpf: Add ability to read user memory To: Alexei Starovoitov Cc: containers@lists.linux.dev, bpf , YiFei Zhu , LSM List , Alexei Starovoitov , Andrea Arcangeli , Andy Lutomirski , Austin Kuo , Claudio Canella , Daniel Borkmann , Daniel Gruss , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jann Horn , Jinghao Jia , Josep Torrellas , Kees Cook , Sargun Dhillon , Tianyin Xu , Tobin Feldman-Fitzthum , Tom Hromatka , Will Drewry Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Wed, May 12, 2021 at 5:36 PM Alexei Starovoitov wrote: > Typically the verifier does all the checks at load time to avoid > run-time overhead during program execution. Then at attach time we > check that attach parameters provided at load time match exactly > to those at attach time. ifindex, attach_btf_id, etc fall into this category. > Doing something similar it should be possible to avoid > doing get_dumpable() at run-time. Do you mean to move the check of dumpable to load time instead of runtime? I do not think that makes sense. A process may arbitrarily set its dumpable attribute during execution via prctl. A process could do set itself to non-dumpable, before interacting with sensitive information that would better not be possible to be dumped (eg. ssh-agent does this [1]). Therefore, being dumpable at one point in time does not indicate anything about whether it stays dumpable at a later point in time. Besides, seccomp filters are inherited across clone and exec, attaching to many tasks with no option to detach. What should the load-time check of task dump-ability be against? The current task may only be the tip of an iceburg. [1] https://github.com/openssh/openssh-portable/blob/2dc328023f60212cd29504fc05d849133ae47355/ssh-agent.c#L1398 YiFei Zhu