Re: [PATCH] apparmor: avoid -Wempty-body warning

2021-04-03 Thread John Johansen
; an 'else' statement [-Werror=empty-body] > 2096 | AA_BUG(labels_ns(label) != labels_ns(new)); > > Change the macro defintion to use no_printk(), which improves > format string checking and avoids the warning. > > Signed-off-by: Arnd Bergmann Aked-by: John Johans

Re: [PATCH] apparmor: fix error check

2021-02-07 Thread John Johansen
On 10/4/20 7:24 AM, t...@redhat.com wrote: > From: Tom Rix > > clang static analysis reports this representative problem: > > label.c:1463:16: warning: Assigned value is garbage or undefined > label->hname = name; > ^ > > In aa_update_label_name(), this the

Re: [RFC][PATCH] apparmor: Enforce progressively tighter permissions for no_new_privs

2021-01-20 Thread John Johansen
On 1/20/21 2:56 PM, Eric W. Biederman wrote: > > TL;DR selinux and apparmor ignore no_new_privs > > What? > AppArmor does not ignore no_new_privs. Its mediation is bounded and it doesn't grant anything that wasn't allowed when NNP was set. > > John Johanse

Re: [RFC][PATCH] apparmor: Enforce progressively tighter permissions for no_new_privs

2021-01-20 Thread John Johansen
On 1/20/21 1:26 PM, Eric W. Biederman wrote: > > The current understanding of apparmor with respect to no_new_privs is at > odds with how no_new_privs is implemented and understood by the rest of > the kernel. > > The documentation of no_new_privs states: >> With ``no_new_privs`` set,

Re: [PATCH v2] security: apparmor: delete repeated words in comments

2020-12-20 Thread John Johansen
On 12/20/20 7:27 PM, Randy Dunlap wrote: > Drop repeated words in comments. > {a, then, to} > > Signed-off-by: Randy Dunlap > Cc: John Johansen > Cc: appar...@lists.ubuntu.com > Cc: James Morris > Cc: "Serge E. Hallyn" > Cc: linux-security-mod...@vger.

Re: [PATCH v2 00/10] allow unprivileged overlay mounts

2020-12-15 Thread John Johansen
On 12/10/20 1:39 AM, Miklos Szeredi wrote: > On Thu, Dec 10, 2020 at 10:00 AM John Johansen > wrote: >> >> On 12/8/20 2:27 AM, Tetsuo Handa wrote: >>> On 2020/12/08 1:32, Miklos Szeredi wrote: >>>> A general observation is that overlayfs doe

Re: [PATCH v2 00/10] allow unprivileged overlay mounts

2020-12-10 Thread John Johansen
On 12/8/20 2:27 AM, Tetsuo Handa wrote: > On 2020/12/08 1:32, Miklos Szeredi wrote: >> A general observation is that overlayfs does not call security_path_*() >> hooks on the underlying fs. I don't see this as a problem, because a >> simple bind mount done inside a private mount namespace also

Re: [PATCH v1] apparmor: Remove duplicate macro list_entry_is_head()

2020-12-08 Thread John Johansen
thus remove it from apparmor code. > > Signed-off-by: Andy Shevchenko oh nice, I will pull into the apparmor tree Acked-by: John Johansen > --- > security/apparmor/apparmorfs.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/security/apparmor/apparmorfs.c b/secur

Re: [PATCH v22 12/23] LSM: Specify which LSM to display

2020-11-09 Thread John Johansen
On 11/9/20 2:28 PM, Casey Schaufler wrote: > On 11/7/2020 2:05 PM, John Johansen wrote: >> On 11/7/20 1:15 AM, Greg KH wrote: >>> On Fri, Nov 06, 2020 at 04:20:43PM -0800, Casey Schaufler wrote: >>>> On 11/5/2020 1:22 AM, Greg KH wrote: >>>>> On

Re: [PATCH v22 12/23] LSM: Specify which LSM to display

2020-11-07 Thread John Johansen
t;>>> provided to get the display slot for a task_struct. >>>> >>>> Setting the "display" requires that all security modules using >>>> setprocattr hooks allow the action. Each security module is >>>> responsible for defining its policy.

Re: [PATCH v6 1/4] IMA: Add func to measure LSM state and policy

2020-08-05 Thread John Johansen
On 8/5/20 8:43 AM, Stephen Smalley wrote: > On 8/5/20 11:07 AM, Tyler Hicks wrote: > >> On 2020-08-05 10:27:43, Stephen Smalley wrote: >>> On Wed, Aug 5, 2020 at 9:20 AM Mimi Zohar wrote: On Wed, 2020-08-05 at 09:03 -0400, Stephen Smalley wrote: > On Wed, Aug 5, 2020 at 8:57 AM Mimi

Re: [PATCH ghak84 v4] audit: purge audit_log_string from the intra-kernel audit API

2020-07-21 Thread John Johansen
On 7/21/20 8:19 AM, Paul Moore wrote: > On Tue, Jul 14, 2020 at 5:00 PM Richard Guy Briggs wrote: >> On 2020-07-14 16:29, Paul Moore wrote: >>> On Tue, Jul 14, 2020 at 1:44 PM Richard Guy Briggs wrote: On 2020-07-14 12:21, Paul Moore wrote: > On Mon, Jul 13, 2020 at 3:52 PM Richard Guy

Re: [PATCH] Replace HTTP links with HTTPS ones: security

2020-07-05 Thread John Johansen
through and double checked all the https urls are good Acked-by: John Johansen > --- > Continuing my work started at 93431e0607e5. > > If there are any URLs to be removed completely or at least not HTTPSified: > Just clearly say so and I'll *undo my change*. > See also https://l

Re: [PATCH 4/5] LSM: Define SELinux function to measure security state

2020-06-16 Thread John Johansen
On 6/15/20 10:44 AM, Mimi Zohar wrote: > (Cc'ing John) > > On Mon, 2020-06-15 at 10:33 -0700, Casey Schaufler wrote: >> On 6/15/2020 9:45 AM, Lakshmi Ramasubramanian wrote: >>> On 6/15/20 4:57 AM, Stephen Smalley wrote: >>> >>> Hi Stephen, >>> >>> Thanks for reviewing the patches. >>> > +void

[GIT PULL] apparmor updates for 5.8

2020-06-07 Thread John Johansen
. Silva (1): apparmor: Replace zero-length array with flexible-array John Johansen (11): apparmor: add a valid state flags check apparmor: add consistency check between state and dfa diff encode flags apparmor: add proc subdir to attrs apparmor: remove useless

[GIT PULL] apparmor bug fixes for v5.7-rc6

2020-05-21 Thread John Johansen
Hi Linus, Can you please pull the following bug fixes for apparmor Thanks! - John The following changes since commit b85051e755b0e9d6dd8f17ef1da083851b83287d: Merge tag 'fixes-for-5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux (2020-05-20 13:23:55 -0700) are

Re: [PATCH 0/4] Relocate execve() sanity checks

2020-05-19 Thread John Johansen
On 5/19/20 2:17 PM, Kees Cook wrote: > On Tue, May 19, 2020 at 01:42:28PM -0500, Eric W. Biederman wrote: >> Kees Cook writes: >> >>> On Tue, May 19, 2020 at 12:41:27PM -0500, Eric W. Biederman wrote: Kees Cook writes: > and given the LSM hooks, I think the noexec check is too late as

Re: WARNING: suspicious RCU usage with PROVE_RCU_LIST=y

2020-05-18 Thread John Johansen
On 4/6/20 4:41 AM, Amol Grover wrote: > Hello, > > With respect to the patch https://lore.kernel.org/patchwork/patch/1202512/ > I boot tested with CONFIG_PROVE_RCU_LIST=y and encountered a susppicious RCU > usage warning in "security/apparmor/include/lib.h". I thought of going forward > and fix

Re: [PATCH -next] apparmor: Use true and false for bool variable

2020-05-15 Thread John Johansen
On 4/28/20 4:52 AM, Zou Wei wrote: > Fixes coccicheck warnings: > > security/apparmor/file.c:162:9-10: WARNING: return of 0/1 in function > 'is_deleted' with return type bool > security/apparmor/file.c:362:9-10: WARNING: return of 0/1 in function > 'xindex_is_subset' with return type bool >

Re: [PATCH] apparmor: Replace zero-length array with flexible-array

2020-05-15 Thread John Johansen
le. > > [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html > [2] https://github.com/KSPP/linux/issues/21 > [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") > > Signed-off-by: Gustavo A. R. Silva Acked-by: John Johansen I have pulled this into my tree

Re: WARNING: suspicious RCU usage with PROVE_RCU_LIST=y

2020-05-14 Thread John Johansen
On 5/14/20 11:24 AM, Amol Grover wrote: > On Mon, Apr 06, 2020 at 05:11:34PM +0530, Amol Grover wrote: >> Hello, >> >> With respect to the patch https://lore.kernel.org/patchwork/patch/1202512/ >> I boot tested with CONFIG_PROVE_RCU_LIST=y and encountered a susppicious RCU >> usage warning in

Re: [PATCH v3 6/6] security: apparmor: default KUNIT_* fragments to KUNIT_ALL_TESTS

2020-05-12 Thread John Johansen
vid Gow > Signed-off-by: Anders Roxell Acked-by: John Johansen

Re: [PATCH] apparmor: Fix use-after-free in aa_audit_rule_init

2019-10-20 Thread John Johansen
On 10/20/19 7:16 AM, Markus Elfring wrote: >> … But after this release the the return statement >> tries to access the label field of the rule which results in >> use-after-free. Before releaseing the rule, copy errNo and return it >> after releasing rule. > Navid thanks for finding this, and

Re: [WTF?] aafs_create_symlink() weirdness

2019-09-24 Thread John Johansen
p it is below or feel free to cons up an alternate version. --- commit 5dbc63d4a0aa819be8ecf21a67a352dd377b0221 Author: John Johansen Date: Tue Sep 24 09:46:33 2019 -0700 apparmor: remove useless aafs_create_symlink 1180b4c757aa ("apparmor: fix dangling symlinks to policy rawdata a

Re: [PATCH V34 00/29] Lockdown as an LSM

2019-06-25 Thread John Johansen
On 6/24/19 4:01 PM, James Morris wrote: > On Fri, 21 Jun 2019, Matthew Garrett wrote: > >> Minor updates over V33 - security_is_locked_down renamed to >> security_locked_down, return value of security_locked_down is returned >> in most cases, one unnecessary patch was dropped, couple of minor

[GIT PULL] apparmor bug fixes for v5.3-rc6

2019-06-18 Thread John Johansen
- Fix PROFILE_MEDIATES for untrusted input - enforce nullbyte at end of tag string - reset pos on failure to unpack for various functions Jann Horn (1): apparmor: enforce nullbyte at end of tag string John Johansen (1

[GIT PULL] apparmor bug fixes for v5.3-rc4

2019-06-06 Thread John Johansen
) + Bug Fixes - Fix PROFILE_MEDIATES for untrusted input - enforce nullbyte at end of tag string Jann Horn (1): apparmor: enforce nullbyte at end of tag string John Johansen (1): apparmor: fix PROFILE_MEDIATES

Re: [PATCH] apparmor: enforce nullbyte at end of tag string

2019-05-28 Thread John Johansen
nds accesses. > > Make sure that the tag string is null-terminated before passing it to > strcmp(). > > Cc: sta...@vger.kernel.org > Signed-off-by: Jann Horn gah! yes! Acked-by: John Johansen > --- > Warning: The existence of this bug has not been verified at runtim

Re: [PATCH] apparmor: Force type-casting of current->real_cred

2019-05-07 Thread John Johansen
On 4/23/19 9:53 AM, Bharath Vedartham wrote: > This patch fixes the sparse warning: > warning: cast removes address space '' of expression. > > Signed-off-by: Bharath Vedartham Acked-by: John Johansen I will pull this into my tree > --- > security/apparmor/lsm.c | 2 +- &g

Re: kernel BUG at kernel/cred.c:434!

2019-04-17 Thread John Johansen
On 4/17/19 4:39 PM, Paul Moore wrote: > On Wed, Apr 17, 2019 at 12:27 PM Oleg Nesterov wrote: >> On 04/17, Paul Moore wrote: >>> >>> On Wed, Apr 17, 2019 at 10:57 AM Oleg Nesterov wrote: On 04/17, Paul Moore wrote: > > I'm tempted to simply return an error in selinux_setprocattr()

Re: [PATCH] apparmor: fix spelling mistake "immutible" -> "immutable"

2019-04-16 Thread John Johansen
On 4/16/19 7:42 AM, Colin King wrote: > From: Colin Ian King > > There is a spelling mistake in an information message string, fix it. > > Signed-off-by: Colin Ian King Acked-by: John Johansen I'll pull it into the apparmor tree > --- > security/apparmor/policy.c | 2

[GIT PULL] apparmor regression fix for v5.1-rc5

2019-04-10 Thread John Johansen
Hi Linus, Can you please pull the following regression fix for apparmor Thanks! - John The following changes since commit 771acc7e4a6e5dba779cb1a7fd851a164bc81033: Bluetooth: btusb: request wake pin with NOAUTOEN (2019-04-09 17:38:24 -1000) are available in the Git repository at:

Re: [PATCH] apparmor: Restore Y/N in /sys for apparmor's "enabled"

2019-04-09 Thread John Johansen
On 4/9/19 1:55 PM, Kees Cook wrote: > On Tue, Apr 9, 2019 at 1:12 PM James Morris wrote: >> Actually, JJ usually submits directly to Linus. > > Ah! Right; I forgot. John, can you take and send this? > yep, I'll send it up today

Re: [PATCH] apparmor: Restore Y/N in /sys for apparmor's "enabled"

2019-04-09 Thread John Johansen
On 4/9/19 1:11 PM, James Morris wrote: > On Tue, 9 Apr 2019, Kees Cook wrote: > >> On Mon, Apr 8, 2019 at 11:21 PM David Rheinsberg >> wrote: >>> >>> Hi >>> >>> On Mon, Apr 8, 2019 at 6:07 PM Kees Cook wrote: Before commit c5459b829b71 ("LSM: Plumb visibility into optional "enabled"

Re: [PATCH] apparmor: Restore Y/N in /sys for apparmor's "enabled"

2019-04-08 Thread John Johansen
On 4/8/19 10:25 AM, Kees Cook wrote: > On Mon, Apr 8, 2019 at 9:58 AM John Johansen > wrote: >>> +/* Can only be set before AppArmor is initialized (i.e. on boot cmdline). >>> */ >>> +static int param_set_aaintbool(const char *val, const struct kernel_param

Re: [PATCH] apparmor: Restore Y/N in /sys for apparmor's "enabled"

2019-04-08 Thread John Johansen
On 4/8/19 9:07 AM, Kees Cook wrote: > Before commit c5459b829b71 ("LSM: Plumb visibility into optional "enabled" > state"), /sys/module/apparmor/parameters/enabled would show "Y" or "N" > since it was using the "bool" handler. After being changed to "int", > this switched to "1" or "0", breaking

[GIT PULL] apparmor updates for v5.1

2019-03-12 Thread John Johansen
) + Bug Fixes - fix double when failing to unpack secmark rules in policy - fix leak of dentry when profile is removed Chris Coulson (1): apparmor: delete the dentry in aafs_remove() to avoid a leak John

Re: [PATCH] apparmor: fix build error undefined reference to zlib_*

2019-02-12 Thread John Johansen
On 2/12/19 1:48 AM, Anders Roxell wrote: > With commit 876dd866c084 ("apparmor: Initial implementation of raw > policy blob compression") and SECURITY_APPARMOR is set to '=y' > ZLIB_DEFLATE must be enabled as well for the linker to see the symbols. > > aarch64-linux-gnu-ld:

[GIT PULL] apparmor fixes for 5.0-rc5

2019-02-01 Thread John Johansen
handling for failed merges - Fix warning about unused function apparmor_ipv6_postroute John Johansen (1): apparmor: Fix aa_label_build() error handling for failed merges Petr Vorel (1): apparmor: Fix warning about unused

Re: [PATCH] security: mark expected switch fall-throughs

2019-01-24 Thread John Johansen
t; Warning level 3 was used: -Wimplicit-fallthrough=3 > > This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. > > Signed-off-by: Gustavo A. R. Silva looks good to me Acked-by: John Johansen > --- > security/apparmor/domain.c| 2 +- &g

Re: WARNING in apparmor_cred_free

2019-01-16 Thread John Johansen
fix the problem? > sorry for not responding earlier, yes it does. Acked-by: John Johansen >> --- >> security/security.c | 7 +++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/security/security.c b/security/security.c >> index a618e22

Re: [PATCH] security/apparmor/domain: use PTR_ERR_OR_ZERO

2019-01-16 Thread John Johansen
On 1/4/19 1:17 AM, Peng Hao wrote: > The variable 'new' may be NULL, so use PTR_ERR_OR_ZERO instead > of PTR_ERR. > > Signed-off-by: Peng Hao yep that is a problem unfortunately the fix isn't quite right we don't want to return 0 for an error here. Instead we can do diff --git

Re: WARNING in apparmor_cred_free

2019-01-11 Thread John Johansen
On 1/11/19 2:11 PM, Casey Schaufler wrote: > On 1/11/2019 1:43 AM, syzbot wrote: >> Hello, >> >> syzbot found the following crash on: >> >> HEAD commit:    b808822a75a3 Add linux-next specific files for 20190111 >> git tree:   linux-next >> console output:

[GIT PULL] apparmor updates for v4.20

2018-11-02 Thread John Johansen
to replace stale label in ptraceme check John Johansen (3): apparmor: Fix failure to audit context info in build_change_hat apparmor: remove no-op permission check in policy_unpack apparmor: fix checkpatch error in Parse secmark policy Lance Roy (1): apparmor: Replace

[GIT PULL] apparmor updates for v4.20

2018-11-02 Thread John Johansen
to replace stale label in ptraceme check John Johansen (3): apparmor: Fix failure to audit context info in build_change_hat apparmor: remove no-op permission check in policy_unpack apparmor: fix checkpatch error in Parse secmark policy Lance Roy (1): apparmor: Replace

Re: [PATCH] apparmor: clean an indentation issue, remove extraneous space

2018-10-31 Thread John Johansen
On 10/30/18 7:11 AM, Colin King wrote: > From: Colin Ian King > > Trivial fix to clean up an indentation issue, remove space > > Signed-off-by: Colin Ian King Thanks Colin, I have pulled this into apparmor-next > --- > security/apparmor/apparmorfs.c | 2 +- > 1 file changed, 1

Re: [PATCH] apparmor: clean an indentation issue, remove extraneous space

2018-10-31 Thread John Johansen
On 10/30/18 7:11 AM, Colin King wrote: > From: Colin Ian King > > Trivial fix to clean up an indentation issue, remove space > > Signed-off-by: Colin Ian King Thanks Colin, I have pulled this into apparmor-next > --- > security/apparmor/apparmorfs.c | 2 +- > 1 file changed, 1

Re: [PATCH security-next v5 00/30] LSM: Explict ordering

2018-10-12 Thread John Johansen
On 10/12/2018 04:31 AM, Jordan Glover wrote: > ‐‐‐ Original Message ‐‐‐ > On Friday, October 12, 2018 2:26 AM, John Johansen > wrote: > >> On 10/11/2018 04:53 PM, Jordan Glover wrote: >> >>> ‐‐‐ Original Message ‐‐‐ >>> On Friday,

Re: [PATCH security-next v5 00/30] LSM: Explict ordering

2018-10-12 Thread John Johansen
On 10/12/2018 04:31 AM, Jordan Glover wrote: > ‐‐‐ Original Message ‐‐‐ > On Friday, October 12, 2018 2:26 AM, John Johansen > wrote: > >> On 10/11/2018 04:53 PM, Jordan Glover wrote: >> >>> ‐‐‐ Original Message ‐‐‐ >>> On Friday,

Re: [PATCH] apparmor: add #ifdef checks for secmark filtering

2018-10-05 Thread John Johansen
On 10/05/2018 09:11 AM, Arnd Bergmann wrote: > The newly added code fails to build when either SECMARK or > NETFILTER are disabled: > > security/apparmor/lsm.c: In function 'apparmor_socket_sock_rcv_skb': > security/apparmor/lsm.c:1138:12: error: 'struct sk_buff' has no member named > 'secmark';

Re: [PATCH] apparmor: add #ifdef checks for secmark filtering

2018-10-05 Thread John Johansen
On 10/05/2018 09:11 AM, Arnd Bergmann wrote: > The newly added code fails to build when either SECMARK or > NETFILTER are disabled: > > security/apparmor/lsm.c: In function 'apparmor_socket_sock_rcv_skb': > security/apparmor/lsm.c:1138:12: error: 'struct sk_buff' has no member named > 'secmark';

Re: [PATCH security-next v4 23/32] selinux: Remove boot parameter

2018-10-03 Thread John Johansen
On 10/02/2018 05:12 PM, Kees Cook wrote: > On Tue, Oct 2, 2018 at 5:05 PM, John Johansen > wrote: >> On 10/02/2018 04:54 PM, Kees Cook wrote: >>> That's not how I have it currently. It's a comma-separated a string, >>> including the reserved name

Re: [PATCH security-next v4 23/32] selinux: Remove boot parameter

2018-10-03 Thread John Johansen
On 10/02/2018 05:12 PM, Kees Cook wrote: > On Tue, Oct 2, 2018 at 5:05 PM, John Johansen > wrote: >> On 10/02/2018 04:54 PM, Kees Cook wrote: >>> That's not how I have it currently. It's a comma-separated a string, >>> including the reserved name

Re: [PATCH 15/16] apparmor: Replace spin_is_locked() with lockdep

2018-10-02 Thread John Johansen
On 10/02/2018 10:39 PM, Lance Roy wrote: > lockdep_assert_held() is better suited to checking locking requirements, > since it won't get confused when someone else holds the lock. This is > also a step towards possibly removing spin_is_locked(). > > Signed-off-by: Lance Roy >

Re: [PATCH 15/16] apparmor: Replace spin_is_locked() with lockdep

2018-10-02 Thread John Johansen
On 10/02/2018 10:39 PM, Lance Roy wrote: > lockdep_assert_held() is better suited to checking locking requirements, > since it won't get confused when someone else holds the lock. This is > also a step towards possibly removing spin_is_locked(). > > Signed-off-by: Lance Roy >

Re: [PATCH security-next v4 23/32] selinux: Remove boot parameter

2018-10-02 Thread John Johansen
On 10/02/2018 01:29 PM, Kees Cook wrote: > On Tue, Oct 2, 2018 at 12:47 PM, John Johansen > wrote: >> On 10/02/2018 12:17 PM, Kees Cook wrote: >>> I could define CONFIG_LSM_ENABLE as being "additive" to >>> SECURITY_APPARMOR_BOOTPARAM_VALUE and >>>

Re: [PATCH security-next v4 23/32] selinux: Remove boot parameter

2018-10-02 Thread John Johansen
On 10/02/2018 01:29 PM, Kees Cook wrote: > On Tue, Oct 2, 2018 at 12:47 PM, John Johansen > wrote: >> On 10/02/2018 12:17 PM, Kees Cook wrote: >>> I could define CONFIG_LSM_ENABLE as being "additive" to >>> SECURITY_APPARMOR_BOOTPARAM_VALUE and >>>

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 05:45 PM, Kees Cook wrote: > On Mon, Sep 17, 2018 at 5:24 PM, Casey Schaufler > wrote: >> On 9/17/2018 5:00 PM, Kees Cook wrote: >>> The legacy per-LSM >>> enable/disable ordering is the same, but ordering between >>> lsm.enable/disable and the per-LSM options is NOT ordered. i.e.

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 05:45 PM, Kees Cook wrote: > On Mon, Sep 17, 2018 at 5:24 PM, Casey Schaufler > wrote: >> On 9/17/2018 5:00 PM, Kees Cook wrote: >>> The legacy per-LSM >>> enable/disable ordering is the same, but ordering between >>> lsm.enable/disable and the per-LSM options is NOT ordered. i.e.

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 04:20 PM, Kees Cook wrote: > On Mon, Sep 17, 2018 at 4:10 PM, Mickaël Salaün wrote: >> Landlock, because it target unprivileged users, should only be called >> after all other major (access-control) LSMs. The admin or distro must >> not be able to change that order in any way. This

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 04:20 PM, Kees Cook wrote: > On Mon, Sep 17, 2018 at 4:10 PM, Mickaël Salaün wrote: >> Landlock, because it target unprivileged users, should only be called >> after all other major (access-control) LSMs. The admin or distro must >> not be able to change that order in any way. This

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 04:10 PM, Mickaël Salaün wrote: > << snip >> > If "lsm.enable=apparmor lsm.disable=apparmor" is specified the last value > specified is used giving "lsm.disable=apparmor". > makes sense >>> >>> The rules for modification are pretty obvious. The downside is, as >>>

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 04:10 PM, Mickaël Salaün wrote: > << snip >> > If "lsm.enable=apparmor lsm.disable=apparmor" is specified the last value > specified is used giving "lsm.disable=apparmor". > makes sense >>> >>> The rules for modification are pretty obvious. The downside is, as >>>

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 02:57 PM, Casey Schaufler wrote: > On 9/17/2018 12:55 PM, John Johansen wrote: >> On 09/17/2018 12:23 PM, Casey Schaufler wrote: >>> On 9/17/2018 11:14 AM, Kees Cook wrote: >>>>> Keep security=$lsm with the existing exclusive behavior. >>>

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 02:57 PM, Casey Schaufler wrote: > On 9/17/2018 12:55 PM, John Johansen wrote: >> On 09/17/2018 12:23 PM, Casey Schaufler wrote: >>> On 9/17/2018 11:14 AM, Kees Cook wrote: >>>>> Keep security=$lsm with the existing exclusive behavior. >>>

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 12:23 PM, Casey Schaufler wrote: > On 9/17/2018 11:14 AM, Kees Cook wrote: >> >>> Keep security=$lsm with the existing exclusive behavior. >>> Add lsm=$lsm1,...,$lsmN which requires a full list of modules >>> >>> If you want to be fancy (I don't!) you could add >>> >>>

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 12:23 PM, Casey Schaufler wrote: > On 9/17/2018 11:14 AM, Kees Cook wrote: >> >>> Keep security=$lsm with the existing exclusive behavior. >>> Add lsm=$lsm1,...,$lsmN which requires a full list of modules >>> >>> If you want to be fancy (I don't!) you could add >>> >>>

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 11:14 AM, Kees Cook wrote: > On Mon, Sep 17, 2018 at 10:13 AM, Casey Schaufler > wrote: >> TOMOYO uses the cred blob pointer. When the blob is shared TOMOYO >> has to be allocated a pointer size chunk to store the pointer in. >> Smack has the same behavior on file blobs. > > Oh

Re: [PATCH 16/18] LSM: Allow arbitrary LSM ordering

2018-09-17 Thread John Johansen
On 09/17/2018 11:14 AM, Kees Cook wrote: > On Mon, Sep 17, 2018 at 10:13 AM, Casey Schaufler > wrote: >> TOMOYO uses the cred blob pointer. When the blob is shared TOMOYO >> has to be allocated a pointer size chunk to store the pointer in. >> Smack has the same behavior on file blobs. > > Oh

Re: [PATCH] apparmor: Fix network performance issue in aa_label_sk_perm

2018-09-07 Thread John Johansen
On 09/06/2018 09:33 PM, Tony Jones wrote: > The netperf benchmark shows a 5.73% reduction in throughput for > small (64 byte) transfers by unconfined tasks. > > DEFINE_AUDIT_SK() in aa_label_sk_perm() should not be performed > unconditionally, rather only when the label is confined. > >

Re: [PATCH] apparmor: Fix network performance issue in aa_label_sk_perm

2018-09-07 Thread John Johansen
On 09/06/2018 09:33 PM, Tony Jones wrote: > The netperf benchmark shows a 5.73% reduction in throughput for > small (64 byte) transfers by unconfined tasks. > > DEFINE_AUDIT_SK() in aa_label_sk_perm() should not be performed > unconditionally, rather only when the label is confined. > >

[GIT PULL] apparmor fix for v4.19-rc3

2018-09-06 Thread John Johansen
check when converting secids to secctx John Johansen (1): apparmor: fix bad debug check in apparmor_secid_to_secctx() security/apparmor/secid.c | 1 - 1 file changed, 1 deletion(-)

[GIT PULL] apparmor fix for v4.19-rc3

2018-09-06 Thread John Johansen
check when converting secids to secctx John Johansen (1): apparmor: fix bad debug check in apparmor_secid_to_secctx() security/apparmor/secid.c | 1 - 1 file changed, 1 deletion(-)

Re: [PATCH 0/8] CaitSith LSM module

2018-09-05 Thread John Johansen
On 09/01/2018 06:04 AM, Tetsuo Handa wrote: > On 2017/10/22 2:17, Casey Schaufler wrote: >>> As one year elapsed since I proposed CaitSith for upstream, I'd like to >>> hear the status again. I looked at >>> http://schd.ws/hosted_files/lss2017/8b/201709-LinuxSecuritySummit-Stacking.pdf >>> . >>>

Re: [PATCH 0/8] CaitSith LSM module

2018-09-05 Thread John Johansen
On 09/01/2018 06:04 AM, Tetsuo Handa wrote: > On 2017/10/22 2:17, Casey Schaufler wrote: >>> As one year elapsed since I proposed CaitSith for upstream, I'd like to >>> hear the status again. I looked at >>> http://schd.ws/hosted_files/lss2017/8b/201709-LinuxSecuritySummit-Stacking.pdf >>> . >>>

Re: WARNING in apparmor_secid_to_secctx

2018-09-01 Thread John Johansen
On 09/01/2018 09:33 PM, Dmitry Vyukov wrote: > On Sat, Sep 1, 2018 at 11:18 AM, John Johansen > wrote: >> On 08/29/2018 07:17 PM, syzbot wrote: >>> Hello, >>> >>> syzbot found the following crash on: >>> >>> HEAD commit:817e60a

Re: WARNING in apparmor_secid_to_secctx

2018-09-01 Thread John Johansen
On 09/01/2018 09:33 PM, Dmitry Vyukov wrote: > On Sat, Sep 1, 2018 at 11:18 AM, John Johansen > wrote: >> On 08/29/2018 07:17 PM, syzbot wrote: >>> Hello, >>> >>> syzbot found the following crash on: >>> >>> HEAD commit:817e60a

Re: WARNING in apparmor_secid_to_secctx

2018-09-01 Thread John Johansen
On 08/29/2018 07:17 PM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:    817e60a7a2bb Merge branch 'nfp-add-NFP5000-support' > git tree:   net-next > console output: https://syzkaller.appspot.com/x/log.txt?x=1536d29640 > kernel config: 

Re: WARNING in apparmor_secid_to_secctx

2018-09-01 Thread John Johansen
On 08/29/2018 07:17 PM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:    817e60a7a2bb Merge branch 'nfp-add-NFP5000-support' > git tree:   net-next > console output: https://syzkaller.appspot.com/x/log.txt?x=1536d29640 > kernel config: 

[GIT PULL] apparmor updates for v4.19

2018-08-23 Thread John Johansen
in __aa_create_ns() John Johansen (2): apparmor: Fix failure to audit context info in build_change_hat apparmor: remove no-op permission check in policy_unpack Tyler Hicks (2): apparmor: Check buffer bounds when mapping permissions mask apparmor: Fully initialize aa_perms struct

[GIT PULL] apparmor updates for v4.19

2018-08-23 Thread John Johansen
in __aa_create_ns() John Johansen (2): apparmor: Fix failure to audit context info in build_change_hat apparmor: remove no-op permission check in policy_unpack Tyler Hicks (2): apparmor: Check buffer bounds when mapping permissions mask apparmor: Fully initialize aa_perms struct

Re: [PATCH] apparmor: remove unused label

2018-08-23 Thread John Johansen
On 08/23/2018 07:09 AM, Arnd Bergmann wrote: thank you for the patch, but a fix for this issue was pushed to apparmor-next yesterday > After the corresponding 'goto' was removed, we get a warning > for the 'fail' label: > > security/apparmor/policy_unpack.c: In function 'unpack_dfa': >

Re: [PATCH] apparmor: remove unused label

2018-08-23 Thread John Johansen
On 08/23/2018 07:09 AM, Arnd Bergmann wrote: thank you for the patch, but a fix for this issue was pushed to apparmor-next yesterday > After the corresponding 'goto' was removed, we get a warning > for the 'fail' label: > > security/apparmor/policy_unpack.c: In function 'unpack_dfa': >

Re: [PATCH] apparmor: remove dead code

2018-08-23 Thread John Johansen
On 08/23/2018 06:42 AM, Gustavo A. R. Silva wrote: thank you for the patch, but a fix for this issue was pushed to apparmor-next yesterday > Due to commit fb5841091f28 ("apparmor: remove no-op permission check > in policy_unpack"), there is some leftover code. > > Coverity reports this issue

Re: [PATCH] apparmor: remove dead code

2018-08-23 Thread John Johansen
On 08/23/2018 06:42 AM, Gustavo A. R. Silva wrote: thank you for the patch, but a fix for this issue was pushed to apparmor-next yesterday > Due to commit fb5841091f28 ("apparmor: remove no-op permission check > in policy_unpack"), there is some leftover code. > > Coverity reports this issue

Re: linux-next: build warning after merge of the apparmor tree

2018-08-22 Thread John Johansen
On 08/22/2018 05:20 PM, Stephen Rothwell wrote: > Hi John, > > After merging the apparmor tree, today's linux-next build (x86_64 > allmodconfig) produced this warning: > > security/apparmor/policy_unpack.c: In function 'unpack_dfa': > security/apparmor/policy_unpack.c:426:1: warning: label

Re: linux-next: build warning after merge of the apparmor tree

2018-08-22 Thread John Johansen
On 08/22/2018 05:20 PM, Stephen Rothwell wrote: > Hi John, > > After merging the apparmor tree, today's linux-next build (x86_64 > allmodconfig) produced this warning: > > security/apparmor/policy_unpack.c: In function 'unpack_dfa': > security/apparmor/policy_unpack.c:426:1: warning: label

Re: [PATCH] apparmor: remove redundant pointer 'info'

2018-07-20 Thread John Johansen
On 07/14/2018 09:19 AM, Colin King wrote: > From: Colin Ian King > > Pointer 'info' is being assigned but is never used hence it is > redundant and can be removed. > > Cleans up clang warning: > warning: variable 'info' set but not used [-Wunused-but-set-variable] > NAK, real problem wrong

Re: [PATCH] apparmor: remove redundant pointer 'info'

2018-07-20 Thread John Johansen
On 07/14/2018 09:19 AM, Colin King wrote: > From: Colin Ian King > > Pointer 'info' is being assigned but is never used hence it is > redundant and can be removed. > > Cleans up clang warning: > warning: variable 'info' set but not used [-Wunused-but-set-variable] > NAK, real problem wrong

Re: [PATCH 2/2] apparmor: Fully initialize aa_perms struct when answering userspace query

2018-07-19 Thread John Johansen
On 07/05/2018 10:25 PM, Tyler Hicks wrote: > Fully initialize the aa_perms struct in profile_query_cb() to avoid the > potential of using an uninitialized struct member's value in a response > to a query from userspace. > > Detected by CoverityScan CID#1415126 ("Uninitialized scalar variable") >

Re: [PATCH 2/2] apparmor: Fully initialize aa_perms struct when answering userspace query

2018-07-19 Thread John Johansen
On 07/05/2018 10:25 PM, Tyler Hicks wrote: > Fully initialize the aa_perms struct in profile_query_cb() to avoid the > potential of using an uninitialized struct member's value in a response > to a query from userspace. > > Detected by CoverityScan CID#1415126 ("Uninitialized scalar variable") >

Re: [PATCH 1/2] apparmor: Check buffer bounds when mapping permissions mask

2018-07-19 Thread John Johansen
On 07/05/2018 10:25 PM, Tyler Hicks wrote: > Don't read past the end of the buffer containing permissions > characters or write past the end of the destination string. > > Detected by CoverityScan CID#1415361, 1415376 ("Out-of-bounds access") > > Fixes: e53cfe6c7caa ("apparmor: rework perm

Re: [PATCH 1/2] apparmor: Check buffer bounds when mapping permissions mask

2018-07-19 Thread John Johansen
On 07/05/2018 10:25 PM, Tyler Hicks wrote: > Don't read past the end of the buffer containing permissions > characters or write past the end of the destination string. > > Detected by CoverityScan CID#1415361, 1415376 ("Out-of-bounds access") > > Fixes: e53cfe6c7caa ("apparmor: rework perm

[GIT PULL] apparmor updates for v4.18

2018-06-13 Thread John Johansen
Andy Shevchenko (1): apparmor: Convert to use match_string() helper John Johansen (9): apparmor: add support for mapping secids and using secctxes apparmor: add the ability to get a task's secid apparmor: fix '*seclen' is never less than zero apparmor: improve

[GIT PULL] apparmor updates for v4.18

2018-06-13 Thread John Johansen
Andy Shevchenko (1): apparmor: Convert to use match_string() helper John Johansen (9): apparmor: add support for mapping secids and using secctxes apparmor: add the ability to get a task's secid apparmor: fix '*seclen' is never less than zero apparmor: improve

Re: [PATCH] Use an IDR to allocate apparmor secids

2018-06-05 Thread John Johansen
On 06/05/2018 04:47 AM, Matthew Wilcox wrote: > On Mon, Jun 04, 2018 at 07:35:24PM -0700, John Johansen wrote: >> On 06/04/2018 07:27 PM, Matthew Wilcox wrote: >>> On Mon, Jun 04, 2018 at 06:27:09PM -0700, John Johansen wrote: >>>> hey Mathew, >>>> >>

Re: [PATCH] Use an IDR to allocate apparmor secids

2018-06-05 Thread John Johansen
On 06/05/2018 04:47 AM, Matthew Wilcox wrote: > On Mon, Jun 04, 2018 at 07:35:24PM -0700, John Johansen wrote: >> On 06/04/2018 07:27 PM, Matthew Wilcox wrote: >>> On Mon, Jun 04, 2018 at 06:27:09PM -0700, John Johansen wrote: >>>> hey Mathew, >>>> >>

Re: [PATCH] Use an IDR to allocate apparmor secids

2018-06-04 Thread John Johansen
On 06/04/2018 07:27 PM, Matthew Wilcox wrote: > On Mon, Jun 04, 2018 at 06:27:09PM -0700, John Johansen wrote: >> hey Mathew, >> >> I've pulled this into apparmor-next and done the retuning of >> AA_SECID_INVALID a follow on patch. The reworking of the api to >> r

Re: [PATCH] Use an IDR to allocate apparmor secids

2018-06-04 Thread John Johansen
On 06/04/2018 07:27 PM, Matthew Wilcox wrote: > On Mon, Jun 04, 2018 at 06:27:09PM -0700, John Johansen wrote: >> hey Mathew, >> >> I've pulled this into apparmor-next and done the retuning of >> AA_SECID_INVALID a follow on patch. The reworking of the api to >> r

Re: [PATCH] Use an IDR to allocate apparmor secids

2018-06-04 Thread John Johansen
On 05/28/2018 10:01 AM, Matthew Wilcox wrote: > > ping? > > I have this queued up in my XArray tree. If I don't hear from you before > -rc1, I'll be submitting it as part of the XArray conversion. > hey Mathew, I've pulled this into apparmor-next and done the retuning of AA_SECID_INVALID a

  1   2   3   4   5   >