Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1493310ybp; Wed, 9 Oct 2019 15:13:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEL2sLkgIZSkU9lhEz9wYEbWpFW5Qs5tb7mMA8fIqu3YeA4IzOzpQ6I3L1pNAVKuFRXR8K X-Received: by 2002:aa7:d28d:: with SMTP id w13mr5071277edq.184.1570659219246; Wed, 09 Oct 2019 15:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570659219; cv=none; d=google.com; s=arc-20160816; b=KizdKh/DGkSMYUbYI10JOq6nBImUZw/vtLdXgn/mzAm8nrei/1Xqm/8mf77o3IdQcD yHd3SbZwWDjSE1AxohEsoG0+EUdEIH4+QsVdHRzd0pvIxTYxgoFj30B3CiuI96jtNSfa JdN4uW71qTzX6GllqUoh22f0mBcIuoGOvL+s4QqVrxjTYRb+F3vcK9gg2t1lsh0Jbitd qGkRnnGxNOQyakyFNEDeFnmJMHmQu/03j7EFisAwQvWCJmiwmEmC5SZ0QvtBaBk9yzEK 1xkSloZxhaapQ+rNCA8t5tZon/to57ALMHWQsHow8HiicX2wt3fZ9pO78DMpE5F/5EYd Vt8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=e5tfAmjilRkeTs4rFRDcni2lNIFSfdE1eaRCgAX+EEI=; b=buo1Mj9OkuS/5nKI5fa7UVBW0L+Kq5m9YmCHiFRkM7Ev3Kbu5MZ0eOJIEZTkPrI6RF MPVtnQkRJchzfOAGferQRYn6ItOW3QHNszd+UOMUY+wd0MKziSVVaIso1xugTB90bWXM zRGvw/pcH57p8SqPi39lNnwF9dyJo+rBlpaH9XZhE94Ju8ElHm7R9GMuodZOW0Dta2RM MLFaaLjKTg02xQ7tNxugn7ASR+IBHaj33lSA1nTlW100kTXBM20GhH4fLN+BvmVjLWFN Qg+TCB9HGdE9mCBJBW3eCj2fyFz3Rs07WwRQ+gB66yhHEiLCFioK4vbyXjxR9mulMAwA hdIw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e31si2137157ede.199.2019.10.09.15.13.15; Wed, 09 Oct 2019 15:13:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731784AbfJIWNL (ORCPT + 99 others); Wed, 9 Oct 2019 18:13:11 -0400 Received: from namei.org ([65.99.196.166]:53338 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729535AbfJIWNL (ORCPT ); Wed, 9 Oct 2019 18:13:11 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id x99MBdMw030060; Wed, 9 Oct 2019 22:11:39 GMT Date: Thu, 10 Oct 2019 09:11:39 +1100 (AEDT) From: James Morris To: "Joel Fernandes (Google)" cc: linux-kernel@vger.kernel.org, Peter Zijlstra , rostedt@goodmis.org, primiano@google.com, rsavitski@google.com, jeffv@google.com, kernel-team@android.com, Alexei Starovoitov , Arnaldo Carvalho de Melo , bpf@vger.kernel.org, Daniel Borkmann , Ingo Molnar , Jiri Olsa , Kees Cook , linux-security-module@vger.kernel.org, Matthew Garrett , Namhyung Kim , selinux@vger.kernel.org, Song Liu , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Yonghong Song Subject: Re: [PATCH RFC] perf_event: Add support for LSM and SELinux checks In-Reply-To: <20191009203657.6070-1-joel@joelfernandes.org> Message-ID: References: <20191009203657.6070-1-joel@joelfernandes.org> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Oct 2019, Joel Fernandes (Google) wrote: > > +#ifdef CONFIG_SECURITY > + err = security_perf_event_alloc(event); > + if (err) > + goto err_security; > +#endif You should not need this ifdef. > diff --git a/security/security.c b/security/security.c > index 1bc000f834e2..7639bca1db59 100644 > --- a/security/security.c > +++ b/security/security.c > @@ -2373,26 +2373,32 @@ int security_bpf(int cmd, union bpf_attr *attr, unsigned int size) > { > return call_int_hook(bpf, 0, cmd, attr, size); > } > + > int security_bpf_map(struct bpf_map *map, fmode_t fmode) > { > return call_int_hook(bpf_map, 0, map, fmode); > } > + > int security_bpf_prog(struct bpf_prog *prog) > { > return call_int_hook(bpf_prog, 0, prog); > } > + > int security_bpf_map_alloc(struct bpf_map *map) > { > return call_int_hook(bpf_map_alloc_security, 0, map); > } > + > int security_bpf_prog_alloc(struct bpf_prog_aux *aux) > { > return call_int_hook(bpf_prog_alloc_security, 0, aux); > } > + > void security_bpf_map_free(struct bpf_map *map) > { > call_void_hook(bpf_map_free_security, map); > } > + > void security_bpf_prog_free(struct bpf_prog_aux *aux) > { > call_void_hook(bpf_prog_free_security, aux); > @@ -2404,3 +2410,30 @@ int security_locked_down(enum lockdown_reason what) > return call_int_hook(locked_down, 0, what); > } > EXPORT_SYMBOL(security_locked_down); Please avoid unrelated whitespace changes. -- James Morris