From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Olsa Subject: Re: [PATCHv3] bpf: Emit audit messages upon successful prog load and unload Date: Tue, 10 Dec 2019 16:36:52 +0100 Message-ID: <20191210153652.GA14123@krava> References: <20191206214934.11319-1-jolsa@kernel.org> <20191209121537.GA14170@linux.fritz.box> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline Sender: netdev-owner@vger.kernel.org To: Paul Moore Cc: Daniel Borkmann , Jiri Olsa , Alexei Starovoitov , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-audit@redhat.com, Andrii Nakryiko , Yonghong Song , Martin KaFai Lau , Jakub Kicinski , Steve Grubb , David Miller , Eric Paris , Jiri Benc List-Id: linux-audit@redhat.com On Mon, Dec 09, 2019 at 06:53:23PM -0500, Paul Moore wrote: > On Mon, Dec 9, 2019 at 6:19 PM Daniel Borkmann wro= te: > > On 12/9/19 3:56 PM, Paul Moore wrote: > > > On Mon, Dec 9, 2019 at 7:15 AM Daniel Borkmann = wrote: > > >> On Fri, Dec 06, 2019 at 10:49:34PM +0100, Jiri Olsa wrote: > > >>> From: Daniel Borkmann > > >>> > > >>> Allow for audit messages to be emitted upon BPF program load and > > >>> unload for having a timeline of events. The load itself is in > > >>> syscall context, so additional info about the process initiating > > >>> the BPF prog creation can be logged and later directly correlated > > >>> to the unload event. > > >>> > > >>> The only info really needed from BPF side is the globally unique > > >>> prog ID where then audit user space tooling can query / dump all > > >>> info needed about the specific BPF program right upon load event > > >>> and enrich the record, thus these changes needed here can be kept > > >>> small and non-intrusive to the core. > > >>> > > >>> Raw example output: > > >>> > > >>> # auditctl -D > > >>> # auditctl -a always,exit -F arch=3Dx86_64 -S bpf > > >>> # ausearch --start recent -m 1334 > > >>> ... > > >>> ---- > > >>> time->Wed Nov 27 16:04:13 2019 > > >>> type=3DPROCTITLE msg=3Daudit(1574867053.120:84664): proctitle=3D= "./bpf" > > >>> type=3DSYSCALL msg=3Daudit(1574867053.120:84664): arch=3Dc000003= e syscall=3D321 \ > > >>> success=3Dyes exit=3D3 a0=3D5 a1=3D7ffea484fbe0 a2=3D70 a3=3D0= items=3D0 ppid=3D7477 \ > > >>> pid=3D12698 auid=3D1001 uid=3D1001 gid=3D1001 euid=3D1001 suid= =3D1001 fsuid=3D1001 \ > > >>> egid=3D1001 sgid=3D1001 fsgid=3D1001 tty=3Dpts2 ses=3D4 comm= =3D"bpf" \ > > >>> exe=3D"/home/jolsa/auditd/audit-testsuite/tests/bpf/bpf" = \ > > >>> subj=3Dunconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 k= ey=3D(null) > > >>> type=3DUNKNOWN[1334] msg=3Daudit(1574867053.120:84664): prog-id= =3D76 op=3DLOAD > > >>> ---- > > >>> time->Wed Nov 27 16:04:13 2019 > > >>> type=3DUNKNOWN[1334] msg=3Daudit(1574867053.120:84665): prog-id= =3D76 op=3DUNLOAD > > >>> ... > > >>> > > >>> Signed-off-by: Daniel Borkmann > > >>> Co-developed-by: Jiri Olsa > > >>> Signed-off-by: Jiri Olsa > > >> > > >> Paul, Steve, given the merge window is closed by now, does this vers= ion look > > >> okay to you for proceeding to merge into bpf-next? > > > > > > Given the change to audit UAPI I was hoping to merge this via the > > > audit/next tree, is that okay with you? > > > > Hm, my main concern is that given all the main changes are in BPF core = and > > usually the BPF subsystem has plenty of changes per release coming in t= hat we'd > > end up generating unnecessary merge conflicts. Given the include/uapi/l= inux/audit.h > > UAPI diff is a one-line change, my preference would be to merge via bpf= -next with > > your ACK or SOB added. Does that work for you as well as? >=20 > I regularly (a few times a week) run the audit and SELinux tests > against Linus+audit/next+selinux/next to make sure things are working > as expected and that some other subsystem has introduced a change > which has broken something. If you are willing to ensure the tests > get run, including your new BPF audit tests I would be okay with that; > is that acceptable? hi, would you please let me know which tree this landed at the end? thanks, jirka