Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14267157ybl; Mon, 30 Dec 2019 07:05:28 -0800 (PST) X-Google-Smtp-Source: APXvYqzCY8rwUnYReqm5NFP7jQKAVeKgTD1dPZRKzQXaTNCFtVVv8S3erf9Iw4osUB/5u3A7ZRwh X-Received: by 2002:a05:6830:16d1:: with SMTP id l17mr53179660otr.21.1577718328782; Mon, 30 Dec 2019 07:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577718328; cv=none; d=google.com; s=arc-20160816; b=as6EdogsI/NizWvw+19cdD1X9qy9lCc/kcrfJSwZBnUCdOjx48+IP4JGSPpyLwA1UD Vw2CfjQXS+q9U+KkOp2QTbAAvF84SikTdlA1b7rXpnejWUnuwuhwfnX4xGhIrqtnSpY9 FdiNHqqMeXjexjLmzx55eZVc40+6rb3zXac34u8mXV+bGpKIbnhwwfGKcUfRNQzFpGhT G9gAHuaCgUKB9/SRrK0BxRVk/d8CK+kd+KUaiXYXuR2H4mI5lG0mXpCHxzPMHSVxIGPV l0nrpBkdlphHc5i0e5PpNGArgYOIYExHo5hnt0ueD5HesIOhY1VCM/IOXmTxqAoQ8lgx 6zxw== 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-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=8+MR8QpDYRl1K4CKbQs7az/sCFuxDTT5Mi/1afsWgo4=; b=FZgZiefA5dBGGGyn3KdS5QQhMonfM/ZFlfFx1H0ruRnbGvdkyurBzq+LwmwunhakrC opSsNDfh4sJEeEPtmeN8UDlCdVairoHn9R/txB62oNN328jxBpdHY5G4awuDNbvjjX0B ViRGCZjPDQ6F7DayjQuKNYebf95DVg1UI7MpkUUx7ufF1Qmw7fdPoL/8AHWOAQdM7iwT ZemdZOpVS5hMcoF/Cx8xfYNTC7fRVMWuxws2x4WFSzZbRmw168oZW6gSAXJaRp1S85hD hRJ6LiyiS7jQ8JJsJB/hvnNQQN4jAMUSF8yw14oOh5svfgJcKBbzQBR15cDJEr7SAm8C pA6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Y3AiIw0V; 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 20si26346816otk.283.2019.12.30.07.05.14; Mon, 30 Dec 2019 07:05:28 -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=Y3AiIw0V; 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 S1727580AbfL3PE3 (ORCPT + 99 others); Mon, 30 Dec 2019 10:04:29 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43945 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727543AbfL3PE3 (ORCPT ); Mon, 30 Dec 2019 10:04:29 -0500 Received: by mail-wr1-f68.google.com with SMTP id d16so32886912wre.10 for ; Mon, 30 Dec 2019 07:04:27 -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:in-reply-to:user-agent; bh=8+MR8QpDYRl1K4CKbQs7az/sCFuxDTT5Mi/1afsWgo4=; b=Y3AiIw0VpkhEo5XfGpafqapJfq3WnOagdT57zYHbZqyED5lbTT1s7kqb8CcN1h3Kjk 3UNGbVf5Os5EyNc4IQTTde2lxLW5qbfC5rlmFd29UfLuXDnR6Q/7hxhl9anA3of4XDfz uaIBWT8pF5eFFXHD2GXEPrMrLXoC78nEEJv9Y= 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:in-reply-to:user-agent; bh=8+MR8QpDYRl1K4CKbQs7az/sCFuxDTT5Mi/1afsWgo4=; b=gv48uCSZjXeLu0rv5zjjx/dLh3X+TrOvHsmkikWbsl95wJYflK2vXLjnCHBTfCKxDh ZytZI3V5qD0qybtPhLA7y1viVs1RfYdmHcSjowoTedUVBG0WCz8C+7MrvSz5X/FLcEUg o5BhqlirEyMDvuPQbbbxLp2bMb7iMl6ZRrxM1fyQnEv38EVySgnMLZ5bYwJCVV6iY1NY 9CtUNQhSRA2gMP51ZYgKSp9jJgryUdIhtDkMUyLNhM03rSatjL31ovOMRl7Nw8V6St2L iybMxTIw0GZwXaoaN9iC78lxFEAPyaovw1o++fkmOwSX8P5XkXYiYGHR6oC6ORujAn+A d4UQ== X-Gm-Message-State: APjAAAWDltnBHl7SUGQKRN7KaIzgRFLq5yCRk1TehxtfGGUnVs+Oo2iQ JRxRxcJ21MSUJdiFbUj78JeKlg== X-Received: by 2002:adf:f6c1:: with SMTP id y1mr72512584wrp.17.1577718267244; Mon, 30 Dec 2019 07:04:27 -0800 (PST) Received: from google.com ([2a00:79e0:42:204:8a21:ba0c:bb42:75ec]) by smtp.gmail.com with ESMTPSA id c15sm46419168wrt.1.2019.12.30.07.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Dec 2019 07:04:26 -0800 (PST) From: KP Singh X-Google-Original-From: KP Singh Date: Mon, 30 Dec 2019 16:04:24 +0100 To: Andrii Nakryiko Cc: KP Singh , open list , bpf , linux-security-module@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , James Morris , Kees Cook , Thomas Garnier , Michael Halcrow , Paul Turner , Brendan Gregg , Jann Horn , Matthew Garrett , Christian Brauner , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Florent Revest , Brendan Jackman , Martin KaFai Lau , Song Liu , Yonghong Song , "Serge E. Hallyn" , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Nicolas Ferre , Stanislav Fomichev , Quentin Monnet , Andrey Ignatov , Joe Stringer Subject: Re: [PATCH bpf-next v1 00/13] MAC and Audit policy using eBPF (KRSI) Message-ID: <20191230150424.GB70684@google.com> References: <20191220154208.15895-1-kpsingh@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 23-Dec 22:51, Andrii Nakryiko wrote: > On Fri, Dec 20, 2019 at 7:42 AM KP Singh wrote: > > > > From: KP Singh > > > > This patch series is a continuation of the KRSI RFC > > (https://lore.kernel.org/bpf/20190910115527.5235-1-kpsingh@chromium.org/) > > > > [...] > > > # Usage Examples > > > > A simple example and some documentation is included in the patchset. > > > > In order to better illustrate the capabilities of the framework some > > more advanced prototype code has also been published separately: > > > > * Logging execution events (including environment variables and arguments): > > https://github.com/sinkap/linux-krsi/blob/patch/v1/examples/samples/bpf/lsm_audit_env.c > > * Detecting deletion of running executables: > > https://github.com/sinkap/linux-krsi/blob/patch/v1/examples/samples/bpf/lsm_detect_exec_unlink.c > > * Detection of writes to /proc//mem: > > https://github.com/sinkap/linux-krsi/blob/patch/v1/examples/samples/bpf/lsm_audit_env.c > > Are you planning on submitting these examples for inclusion into > samples/bpf or selftests/bpf? It would be great to have more examples > and we can review and suggest nicer ways to go about writing them > (e.g., BPF skeleton and global data Alexei mentioned earlier). Eventually, yes and in selftest/bpf. But these examples depend on using security blobs and some non-atomic calls in the BPF helpers which are not handled as a part of the initial patch-set. Once we have the initial framework finalized, I will update the examples and the helpers they are based on and send these separate patch-sets on the list for review. - KP > > > > > We have updated Google's internal telemetry infrastructure and have > > started deploying this LSM on our Linux Workstations. This gives us more > > confidence in the real-world applications of such a system. > > > > KP Singh (13): > > bpf: Refactor BPF_EVENT context macros to its own header. > > bpf: lsm: Add a skeleton and config options > > bpf: lsm: Introduce types for eBPF based LSM > > bpf: lsm: Allow btf_id based attachment for LSM hooks > > tools/libbpf: Add support in libbpf for BPF_PROG_TYPE_LSM > > bpf: lsm: Init Hooks and create files in securityfs > > bpf: lsm: Implement attach, detach and execution. > > bpf: lsm: Show attached program names in hook read handler. > > bpf: lsm: Add a helper function bpf_lsm_event_output > > bpf: lsm: Handle attachment of the same program > > tools/libbpf: Add bpf_program__attach_lsm > > bpf: lsm: Add selftests for BPF_PROG_TYPE_LSM > > bpf: lsm: Add Documentation > > > > [...]