Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4609295ybf; Wed, 4 Mar 2020 07:15:29 -0800 (PST) X-Google-Smtp-Source: ADFU+vvl6MQTrdDFUr3Ndil9doQQMRVy65VB2TMasn+kp6nLJBNJB/iVC4L/uG07sbZ3Z5lSGEA0 X-Received: by 2002:a05:6808:2c4:: with SMTP id a4mr2091236oid.79.1583334929795; Wed, 04 Mar 2020 07:15:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583334929; cv=none; d=google.com; s=arc-20160816; b=FbIsL1FknR8HX90lAyS7wnYQCpN4GR8PBeDEj0drqs/WJkpvKqL7V7eLe4jo7V7sze Uci2d2FVTfRcYMl5zPNXn29rVADpvPi5tIkjb2PsW69KlcJyLIl/LsL9RoLQNh5UDexd ti/0soO+83IIAd4ZScKJxsSOClBJrFA05G3KSmA1IZ478ET/1e3F/FMnRY55D3J9ysBN NEQYPwg6dLqr3OlcXDAiuqKzx+kGaxNnZnjn2eP7QLo7AaDUrnHXn8lhVNGRM1SXulxn icKlCKrsDWdUUhFXOOg7af1is6UyrceR2qcPKTHE2M9ILgJu6fDx6sZd8Q3Qdipr8jaU l1QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=fsgJGQMpQ1G9tftbB0Mps00ljMhlrkE3dAL7nSnd3vo=; b=FySTweRge1vBQkUO3x6ry/NG0UxrtXVJPsd0tFEwUNkbakf/K0e3cTjxvRelJnNibA z8C0Tnba2QFDvmePSjPPoARavCUBsFhNKzM9S2QzA6HShb0G0BB5xV+RySA/Ec0bdiYS hS/unCrbVcXlJhn96P1zKzH+7K1xNYVzvP12B3MO9ib2t8aPEeQdg67EXeWtEus/2aUi BJMlLZrC7+O301BkMMU2/J6XL6dANxsdgJvQpacx6ARbU0QQZmQ/CKQrwfqOVhH6B7lS VgYb0ZeMwCHGEIUjiqqnCFi1d8YDf5qpVJue/pmSShhSz/R3UGcGA+3iy+R4b808l3z3 rPRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SUIT7ybv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si1214407otr.265.2020.03.04.07.15.12; Wed, 04 Mar 2020 07:15:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SUIT7ybv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387432AbgCDPNl (ORCPT + 99 others); Wed, 4 Mar 2020 10:13:41 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35697 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbgCDPNk (ORCPT ); Wed, 4 Mar 2020 10:13:40 -0500 Received: by mail-wr1-f65.google.com with SMTP id r7so2863053wro.2 for ; Wed, 04 Mar 2020 07:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=fsgJGQMpQ1G9tftbB0Mps00ljMhlrkE3dAL7nSnd3vo=; b=SUIT7ybvralMQlOhJIjHu6ly0ZrFuMBji/zcuoM0lUme2+qnQIfCnvpMGvJy4bjzqE jjLsZAJziFoMM3AKjRXlddNWJPUuwwfWaOPOVzfgJtf0tPyS9kXqW/KaApFrz19w6HHu nskZiLoYB7+X9+SdAd9lrYl3Rtsa3eW2hwYXI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=fsgJGQMpQ1G9tftbB0Mps00ljMhlrkE3dAL7nSnd3vo=; b=NpdeXgdKgtCWQRRxHz9bIDle0gS7BgIHXR9mgaUKvxTvcrE4u3Jj97Wxyh6Is306h9 /bLVnfYD1bslYMQv48e/tgJnXHCRiGDlv93lF68WYEBqmCqLm7RdLV6zu0VCLdNcIIy+ 4X8Ithy2hctQEjLPDd2pKv+SBkumtFvTlqjWy3j1AN2IGrAa7BF+0OZQYI5BwVi3xx3i ttI6d7RvstZKUbFmsxvPHAhvPcAQ2knCysuXH64Bz2PyR0MeJOA6mVKdFrqk81hho8qW FIYF5rs3pjwXukCJwLNWHs98G7Jsuya276Nszw4fiYPhojw5z9w5aErF6rMpb/RuwIfU rGpQ== X-Gm-Message-State: ANhLgQ1aD+gT8MNZ2mI/h5jyaNcaSoeexnjdUxdJ9/uAZpEtpWbC9thP sM88Apf7hIOLscH31Ez2a7UtLA== X-Received: by 2002:a5d:6086:: with SMTP id w6mr4494482wrt.224.1583334819160; Wed, 04 Mar 2020 07:13:39 -0800 (PST) Received: from chromium.org ([2a00:79e1:abc:308:8ca0:6f80:af01:b24]) by smtp.gmail.com with ESMTPSA id x13sm69264wmi.35.2020.03.04.07.13.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 07:13:38 -0800 (PST) From: KP Singh X-Google-Original-From: KP Singh Date: Wed, 4 Mar 2020 16:13:37 +0100 To: Andrii Nakryiko Cc: linux-security-module@vger.kernel.org, open list , bpf , Alexei Starovoitov , Daniel Borkmann , Paul Turner , Jann Horn , Florent Revest , Brendan Jackman Subject: Re: [PATCH bpf-next v2 4/7] bpf: Attachment verification for BPF_MODIFY_RETURN Message-ID: <20200304151337.GD9984@chromium.org> References: <20200304015528.29661-1-kpsingh@chromium.org> <20200304015528.29661-5-kpsingh@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03-M?r 21:12, Andrii Nakryiko wrote: > On Tue, Mar 3, 2020 at 5:56 PM KP Singh wrote: > > > > From: KP Singh > > > > - Allow BPF_MODIFY_RETURN attachment only to functions that are: > > > > * Whitelisted by for error injection i.e. by checking > > within_error_injection_list. Similar disucssions happened for the > > bpf_overrie_return helper. > > 2 typos: discussions and bpf_override_return ;) /me bows his head in shame ;) Fixed. -KP > > > > > * security hooks, this is expected to be cleaned up with the LSM > > changes after the KRSI patches introduce the LSM_HOOK macro: > > > > https://lore.kernel.org/bpf/20200220175250.10795-1-kpsingh@chromium.org/ > > > > - The attachment is currently limited to functions that return an int. > > This can be extended later other types (e.g. PTR). > > > > Signed-off-by: KP Singh > > --- > > Acked-by: Andrii Nakryiko > > > kernel/bpf/btf.c | 28 ++++++++++++++++++++-------- > > kernel/bpf/verifier.c | 31 +++++++++++++++++++++++++++++++ > > 2 files changed, 51 insertions(+), 8 deletions(-) > > > > [...]