Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1232510ybb; Wed, 25 Mar 2020 18:57:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtwe+q2gX2E3rcXJrI4egFd9PVwsMJYP/5IjE9yN3KPMsOYxAsdSPHB+y8+hMTohVi+YiYb X-Received: by 2002:a9d:2c64:: with SMTP id f91mr4917098otb.17.1585187858260; Wed, 25 Mar 2020 18:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585187858; cv=none; d=google.com; s=arc-20160816; b=JIOfXKQ1L6VN5lrDw4DnmScNWaRSzGhKwOfWbC7VuIiUJzOd8DQM/Fq4eEeSUAsef2 d8p9cOmvxMjYnw+nFqVo09M0hX+QKAsI1u+/oHn+gqbVIxtH2Ye9oRlw6xK1dNkoP8Vz CoazcY2n1OUWxMfwnBppzG3HEYMwRs7cU/aOTKfxDdb5Dic6PdI0h4xBRNQ4UIpOi74f MXvIiRsdQpKFLGtcR9MKU4qi9D7lGXIEFsc76h3FYt0rEoqXKusQKEaZx41QPxiHl0U2 bB2ljd4KxLrrUYj9tbcJxv6DGup7OFw54JqT5RAxMB/fjSquZtT19YwZmTQiLYnPhb7q WHEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XZom649rD9A2YiwpVukxYNVVAs0uWpwZ9GzmqDRwqNA=; b=uIFa/SQOWDolfz7d/KDFI2KrZ+tkmaEnuXZWLitvozb//E2yUTVj58vYC3Edb3odCe Z7VdCAriUhAwEkhUhgDwNCRIHnM2LaaRQKt9iEiljlVEku6isQTcYEIBWEM46Gi+7hL5 zDxpviOVSYm9hNLmN7PIlEVFciSXCokgYHjEQ6Vx4jDDKzVaIjCpvGVPgye/75TnJY3i 2m9epZVCo9V5ixbRrd8Pm52BTi5ucImPlCd/Tb24q0hJQZznIedTugQ+rSfiXwlBHQuS wg4NftySNP9ZudWy+axbBKnH3CR4hK/wxv94N7I3e61gNQriD7a/1C1GRIGIpJgv0yrX 1WYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bFB7g4KT; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si417927oiy.229.2020.03.25.18.57.25; Wed, 25 Mar 2020 18:57:38 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=bFB7g4KT; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727656AbgCZB5E (ORCPT + 99 others); Wed, 25 Mar 2020 21:57:04 -0400 Received: from mail-qv1-f67.google.com ([209.85.219.67]:45937 "EHLO mail-qv1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727564AbgCZB5D (ORCPT ); Wed, 25 Mar 2020 21:57:03 -0400 Received: by mail-qv1-f67.google.com with SMTP id g4so2179272qvo.12; Wed, 25 Mar 2020 18:57:03 -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=XZom649rD9A2YiwpVukxYNVVAs0uWpwZ9GzmqDRwqNA=; b=bFB7g4KTIRH6+POAgAAyQQICNPW/diAa6HattO/B+IEPIPNsd2YUVkvVJwNRxLQnZo Rlqe021q/IiNZ4xDdUEbkkVrWeaGMSKyGHlmlALSJUgayaC+PGmoUBhtJ/MDAv5ET6Hn AFvfHjKApzJn4paZW5glsyUy9wW7FKbJp7qyueiNlwUtD3QicIexoQeUFuF1v0pRDY0F lzqL0LJJjetTRczXyn9f6fCaUcHwtvhY/XaO4fKzwnOHY5AuUgyDbzcPwN6H0maXwsux gP+FHyHCutE2oQzv6lzmmhszLMhdJIjLsisKrNi/zRWaYrvveABYl+2Bm1fHFulm/uzC p9qg== 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=XZom649rD9A2YiwpVukxYNVVAs0uWpwZ9GzmqDRwqNA=; b=nckudXUkixhIOILWiE6oEINferSL+o2cDcXJcQHOfguYLcL+SWGXAMkMNbl4T0XlxY GPMEu1vymvyUpMAU47hIqu58oVCzjlSHIZJC4FxT4bzAQJ1J8P7ZI+nA6knACtflDjGs g+1alxOGx+dUId+VwF/RQsL0RNCwcxY0cPCpO+CKdGRE+Xc4K2MVnoGO2C6J20sD5fWW NzMxPVKld2bEwkJgQCh8uIOafX0f6316Ld6uqjMFVXQXL5eo8yJnf0LaVAraRWfHPqMQ sEk+ZbszZEeEfNOyDkTKuCrCNCY+2/TPDVZ9NnuilEs8KrqBFRaT+uuURFOLGA05cDe7 J6og== X-Gm-Message-State: ANhLgQ0Z44QlGxmqiwe9UcgIgpPiEXV4PR+BVVLAdHPQvs1W78e61mMG gqMYhaofNYvJjQGeXmwO83iZFM/j31Z0Tyz0y+g= X-Received: by 2002:a0c:ee28:: with SMTP id l8mr6023029qvs.196.1585187823033; Wed, 25 Mar 2020 18:57:03 -0700 (PDT) MIME-Version: 1.0 References: <20200325152629.6904-1-kpsingh@chromium.org> <20200325152629.6904-7-kpsingh@chromium.org> In-Reply-To: <20200325152629.6904-7-kpsingh@chromium.org> From: Andrii Nakryiko Date: Wed, 25 Mar 2020 18:56:52 -0700 Message-ID: Subject: Re: [PATCH bpf-next v6 6/8] tools/libbpf: Add support for BPF_PROG_TYPE_LSM To: KP Singh Cc: open list , bpf , linux-security-module@vger.kernel.org, Brendan Jackman , Florent Revest , Yonghong Song , Alexei Starovoitov , Daniel Borkmann , James Morris , Kees Cook , Paul Turner , Jann Horn , Florent Revest , Brendan Jackman , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2020 at 8:27 AM KP Singh wrote: > > From: KP Singh > > Since BPF_PROG_TYPE_LSM uses the same attaching mechanism as > BPF_PROG_TYPE_TRACING, the common logic is refactored into a static > function bpf_program__attach_btf_id. > > A new API call bpf_program__attach_lsm is still added to avoid userspace > conflicts if this ever changes in the future. > > Signed-off-by: KP Singh > Reviewed-by: Brendan Jackman > Reviewed-by: Florent Revest > Acked-by: Yonghong Song > --- LGTM. Acked-by: Andrii Nakryiko > tools/lib/bpf/bpf.c | 3 ++- > tools/lib/bpf/libbpf.c | 39 +++++++++++++++++++++++++++++++++++---- > tools/lib/bpf/libbpf.h | 4 ++++ > tools/lib/bpf/libbpf.map | 3 +++ > 4 files changed, 44 insertions(+), 5 deletions(-) > [...]