Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp447576pxa; Wed, 19 Aug 2020 06:06:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnv2dXG5EGt04gtm/5MpMxXb5BgoBOlB5EvXil2nh73aizFkVV3VBAbHmYAywcUjwhuoUQ X-Received: by 2002:aa7:c6ce:: with SMTP id b14mr25755747eds.208.1597842393162; Wed, 19 Aug 2020 06:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597842393; cv=none; d=google.com; s=arc-20160816; b=pNAznf8QodQZA+ETy1X+u28tJwor0U7Je0SfngfsEFGWJj8ILbS9vH9o9p2pd66Tsm JhvgU8bmdV8ibpkiyYmmRTlF28RrQEfXc1KKZOjFnD3P3mIRF6u8E9EyLtVELnaHy190 Es9MyQ3xVrO15fcGDsllE42ccgv6MFKOVZOD5hPET9aXatU5WKe9wJSVIm8koveiNB4A zea6GHmIRy4RvCU5+PCWCzz93j36qeCQBBBuDGmzMuK4HO/SBUs6ugx044y1rMgmktdp NYD2Mg8Egrz9cW8lillNVnh6Hw9JyeKLmw2xj3vqKVdL66ujSSuFcVc1AAdz55sboxSu dPGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=S08efVGlFbnCRWAooQ5BgeOCyESGGd5F97xt8fYK1v0=; b=KaNr+c7hSWCUcxU1WSGTzQjM8zH0P4Js/dktQWUBQxqVi20vaTnbAmjapC/2n6aX8b EXeBaUwU4cVNaZKwUhnARr8ZVXZqbOJazo7q+JNKUqFLadJQklTjheoRFwqBtrlmS+Wt Fn2jKDZqlynsr8ihGKNvafQLU6e2R5ZRjlFeVcC/RvmFaoXkMmaX3taWLrqJIfcEE0D1 dQXJNMQEew6D4kEqqnPwcwTf0uWr7YFm9W8/w3i/QIjF8V5+bKb45U7Ei+2WprW0KYb0 lbqlPEtPoqGB0hmEwWW4WOUJEuYk+Q9aSfibMSsui7oLwloHrDo2+PHzpzOsVNgdZqpR H3IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gXzVlZtv; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox11si15263192ejb.727.2020.08.19.06.06.04; Wed, 19 Aug 2020 06:06:33 -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=@chromium.org header.s=google header.b=gXzVlZtv; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728608AbgHSNE4 (ORCPT + 99 others); Wed, 19 Aug 2020 09:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728523AbgHSNCK (ORCPT ); Wed, 19 Aug 2020 09:02:10 -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 391BDC06134B for ; Wed, 19 Aug 2020 06:01:20 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id kq25so26178113ejb.3 for ; Wed, 19 Aug 2020 06:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=S08efVGlFbnCRWAooQ5BgeOCyESGGd5F97xt8fYK1v0=; b=gXzVlZtvnou0mDkrZAK2Fnuw9dSHO7Edi/cQP/i3F+AAbHgN3yCpdOvzogBHylOWmq Qc0FKLbxNWpaTbSaQEuwm+ujFF001aQbadp4GYn5t3ogCQHV/SqT1EaYeGyGK5d1Zyc7 esDQ142rLIroj8edGg4TAizj7oV8OgZaOxosM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=S08efVGlFbnCRWAooQ5BgeOCyESGGd5F97xt8fYK1v0=; b=V2rcZ021wWFNBGii0a9IsbUPrFjnOOvG7zkzjRZmiRKxRzn2g9Kq+f1CYHtGTMP5E6 vlyrUX3HMoFjqbtSWhRxaWyG2IwcZB4psTDNQo1OA3DdSelNib6iWw2Ov43s8bjDn8je 3+u2zpZfiizVHklidLRP9MAkTq32tgI3rhVzM0uvzc7zmiT7b7cdem9vKGdiJfH4lty4 JknAGfE1YyUo8Gxa6mWcULpZhMI8xi/bwFwYgTiENz+Y5Z/37erCNOQcXERPNBsu02K2 AQJ9LI/d1l9vUNVo/QoiIBgCbnNvUEQat3Bnt2k9Ctjj89gfwc4yRppzgTPuk4BvWMGE 4j2Q== X-Gm-Message-State: AOAM5310Yf84r82I1HcZk4XzuEuuSPetcYPBI6x2m+viUHdaYM4ieKYF UuCOBxfcECLlchFt7V/psxVQzw== X-Received: by 2002:a17:906:1f15:: with SMTP id w21mr24281904ejj.152.1597842078291; Wed, 19 Aug 2020 06:01:18 -0700 (PDT) Received: from [192.168.2.66] ([81.6.44.51]) by smtp.gmail.com with ESMTPSA id o25sm18529498ejm.34.2020.08.19.06.01.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Aug 2020 06:01:17 -0700 (PDT) Subject: Re: [PATCH bpf-next v8 6/7] bpf: Allow local storage to be used from LSM programs To: Martin KaFai Lau Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-security-module@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Paul Turner , Jann Horn , Florent Revest References: <20200803164655.1924498-1-kpsingh@chromium.org> <20200803164655.1924498-7-kpsingh@chromium.org> <20200818041638.2dv5cewlgwerd7hm@kafai-mbp.dhcp.thefacebook.com> From: KP Singh Message-ID: <87e6c97f-5d72-ddb9-331a-4a79ccab11c1@chromium.org> Date: Wed, 19 Aug 2020 15:01:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200818041638.2dv5cewlgwerd7hm@kafai-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/18/20 6:16 AM, Martin KaFai Lau wrote: > On Mon, Aug 03, 2020 at 06:46:54PM +0200, KP Singh wrote: >> From: KP Singh >> >> Adds support for both bpf_{sk, inode}_storage_{get, delete} to be used >> in LSM programs. These helpers are not used for tracing programs [...] >> @@ -2823,6 +2823,10 @@ union bpf_attr { >> * "type". The bpf-local-storage "type" (i.e. the *map*) is >> * searched against all bpf-local-storages residing at *sk*. >> * >> + * For socket programs, *sk* should be a **struct bpf_sock** pointer >> + * and an **ARG_PTR_TO_BTF_ID** of type **struct sock** for LSM >> + * programs. > I found it a little vague on what "socket programs" is. May be: > > *sk* is a kernel **struct sock** pointer for LSM program. > *sk* is a **struct bpf_sock** pointer for other program types. This is better, Thanks! - KP > > Others LGTM > > Acked-by: Martin KaFai Lau >