Re: [RFC PATCH 1/3] selinux: refactor sidtab conversion

2018-11-20 Thread Paul Moore
hitespace fixes (inherited from code you cut n' pasted). Please remember to run your patches through scripts/checkpatch.pl before submission. -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send ema

Re: [PATCH v3] selinux: simplify mls_context_to_sid()

2018-11-20 Thread Paul Moore
present, > +* copy the MLS field of the associated default context. > +* Used for upgrading to MLS systems where objects may lack > +* MLS fields. > +*/ > + struct context *defcon; > + > + rc = -EINVAL; &g

Re: [PATCH v3] selinux: simplify mls_context_to_sid()

2018-11-13 Thread Paul Moore
5,9 +1425,35 @@ static int string_to_context_struct(struct policydb > > *pol, > > > > ctx->type = typdatum->value; > > > > - rc = mls_context_to_sid(pol, oldc, p, ctx, sidtabp, def_sid); > > - if (rc) > > - goto out; &

Re: [PATCH 1/2] selinux: use separate table for initial SID lookup

2018-11-05 Thread Paul Moore
this logic inside of sidtab_search() instead of > > splitting it out. > > My intention was to not hide too much complexity under sidtab, but > rethinking it now I agree it would probably make sense to just hide > isidtab under sidtab. It would need to have a separate insert functio

Re: [PATCH v6] selinux: policydb - fix byte order and alignment issues

2018-11-05 Thread Paul Moore
> - add reproducer to commit message > - update e-mail address of James Morris > - better Cc also the old SELinux ML You know what they say: sixth time is the charm :) Merged into selinux/next, thanks all. -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Re: [PATCH] libsepol: fix endianity in ibpkey range checks

2018-10-17 Thread Paul Moore
xProject/selinux/jobs/442750208 > > Build fail with gcc: > > policydb.c:2839:31: error: comparison is always false due to limited > range of data type [-Werror=type-limits] > if (c->u.ibpkey.low_pkey > 0x || >^ > policydb.c:2840:31: error: comparison is always false due to limited > range of data type [-Werror=type-limits] > c->u.ibpkey.high_pkey > 0x) -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

[GIT PULL] SELinux fixes for v4.19 (#1)

2018-10-15 Thread Paul Moore
ges up to 073c1a781e4a1217d572506621434cd6d750969b: MAINTAINERS: update the SELinux mailing list location (2018-10-10 01:50:15 -0400) selinux/stable-4.19 PR 20181015 -------

Re: [PATCH v7 3/6] seccomp: add a way to get a listener fd from ptrace

2018-10-10 Thread Paul Moore
d subvert those. The only capability I > know of that lets you bypass LSM checks by design (if no LSM blocks > the capability itself) is CAP_SYS_ADMIN. > > > One more thing. Citing from [1] > > > > > I think there's a security problem here. Imagine the following scenario: &

Re: [PATCH] MAINTAINERS: update the SELinux mailing list location

2018-10-09 Thread Paul Moore
On Wed, Oct 10, 2018 at 1:55 AM Paul Moore wrote: > > Signed-off-by: Paul Moore > --- > MAINTAINERS |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Since we want to get everyone on to the new list as soon as possible, I've merged this into the selinux/stable-4.

[PATCH] MAINTAINERS: update the SELinux mailing list location

2018-10-09 Thread Paul Moore
Signed-off-by: Paul Moore --- MAINTAINERS |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 67e4c4f92ba9..fd060218baa8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12775,7 +12775,7 @@ SELINUX SECURITY MODULE M: Paul Moore M

[PATCH] selinux-testsuite: update the dependencies in README.md

2018-10-03 Thread Paul Moore
The overlayfs tests require setfattr and getfattr which are part of the attr package in Fedora. Signed-off-by: Paul Moore --- README.md |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c871d3..cf90ef6 100644 --- a/README.md +++ b/README.md

Re: [RFC PATCH] selinux: add a fallback to defcontext for native labeling

2018-09-25 Thread Paul Moore
On Tue, Sep 25, 2018 at 9:58 AM Stephen Smalley wrote: > On 09/25/2018 01:45 AM, Taras Kondratiuk wrote: > > Quoting Paul Moore (2018-09-24 20:46:57) > >> On Fri, Sep 21, 2018 at 10:39 AM Stephen Smalley > >> wrote: > >>> On 09/20/2018 06:59 PM, Taras K

Re: [RFC PATCH] selinux: add a fallback to defcontext for native labeling

2018-09-25 Thread Paul Moore
On Tue, Sep 25, 2018 at 1:45 AM Taras Kondratiuk wrote: > Quoting Paul Moore (2018-09-24 20:46:57) > > On Fri, Sep 21, 2018 at 10:39 AM Stephen Smalley wrote: > > > On 09/20/2018 06:59 PM, Taras Kondratiuk wrote: > > > > Quoting Stephen Smalley (2018-09-20 07:49:12

Re: [RFC PATCH] selinux: add a fallback to defcontext for native labeling

2018-09-24 Thread Paul Moore
n the filesystem is mounted. We could add a toggle somewhere in selinuxfs, but I really dislike that idea, and would prefer to find a different solution if possible. I'm not sure how much flak we would get for introducing a new mount option, but perhaps

Re: [RFC PATCH] selinux: add a fallback to defcontext for native labeling

2018-09-19 Thread Paul Moore
isec->sclass = > inode_mode_to_security_class(inode->i_mode); > + isec->sid = sbsec->def_sid; > + isec->initialized = 1; > + } > + rc = 0; > + } > + } > +

FYI: email change

2018-09-19 Thread Paul Moore
A quick note that my @redhat.com email address is going to stop working in the next day or two, so if you are using my Red Hat email address to reach me please start using my @paul-moore.com address. Everything else, e.g. my community involvement, will remain unaffected. -- paul moore www.paul

Re: [PATCH 10/10] LSM: Blob sharing support for S.A.R.A and LandLock

2018-09-14 Thread Paul Moore
On Thu, Sep 13, 2018 at 5:52 PM Kees Cook wrote: > On Thu, Sep 13, 2018 at 2:38 PM, Paul Moore wrote: > > The infrastructure bits aren't really my concern; in fact I *like* > > that the infrastructure is always exercised, it makes > > testing/debugging easier. I also

Re: [PATCH 10/10] LSM: Blob sharing support for S.A.R.A and LandLock

2018-09-14 Thread Paul Moore
On Thu, Sep 13, 2018 at 4:58 PM Jordan Glover wrote: > > On Thursday, September 13, 2018 9:12 PM, Paul Moore > wrote: > > > On Thu, Sep 13, 2018 at 11:19 AM Kees Cook keesc...@chromium.org wrote: > > > > > On Thu, Sep 13, 2018 at 6:16 AM, Paul Moore p...@paul-

Re: [PATCH 10/10] LSM: Blob sharing support for S.A.R.A and LandLock

2018-09-14 Thread Paul Moore
On Thu, Sep 13, 2018 at 5:01 PM Kees Cook wrote: > On Thu, Sep 13, 2018 at 12:12 PM, Paul Moore wrote: > > None of the above deals with the user experience or support burden a > > distro would have by forcing stacking on. If we make it an option the > > Just to make sure w

Re: [PATCH] selinux: Add __GFP_NOWARN to allocation at str_read()

2018-09-13 Thread Paul Moore
On Thu, Sep 13, 2018 at 8:55 AM peter enderborg wrote: > On 09/13/2018 01:11 PM, Michal Hocko wrote: > > On Thu 13-09-18 09:12:04, peter enderborg wrote: > >> On 09/13/2018 08:26 AM, Tetsuo Handa wrote: > >>> On 2018/09/13 12:02, Paul Moore wrote: > >>&g

Re: [PATCH] selinux: Add __GFP_NOWARN to allocation at str_read()

2018-09-13 Thread Paul Moore
On Thu, Sep 13, 2018 at 3:12 AM peter enderborg wrote: > On 09/13/2018 08:26 AM, Tetsuo Handa wrote: > > On 2018/09/13 12:02, Paul Moore wrote: > >> On Fri, Sep 7, 2018 at 12:43 PM Tetsuo Handa > >> wrote: > >>> syzbot is hitting warning at str_read() [1]

Re: [PATCH] selinux: Add __GFP_NOWARN to allocation at str_read()

2018-09-13 Thread Paul Moore
On Thu, Sep 13, 2018 at 2:26 AM Tetsuo Handa wrote: > On 2018/09/13 12:02, Paul Moore wrote: > > On Fri, Sep 7, 2018 at 12:43 PM Tetsuo Handa > > wrote: > >> syzbot is hitting warning at str_read() [1] because len parameter can > >> become larger than KMALLO

Re: [PATCH 10/10] LSM: Blob sharing support for S.A.R.A and LandLock

2018-09-13 Thread Paul Moore
On Thu, Sep 13, 2018 at 11:19 AM Kees Cook wrote: > On Thu, Sep 13, 2018 at 6:16 AM, Paul Moore wrote: > > On Thu, Sep 13, 2018 at 12:19 AM Kees Cook wrote: > >> On Tue, Sep 11, 2018 at 9:42 AM, Casey Schaufler > >> wrote: > >> > Two proposed

Re: [PATCH 10/10] LSM: Blob sharing support for S.A.R.A and LandLock

2018-09-13 Thread Paul Moore
how to answer this question, answer N. > > I don't see a good reason to make this a config. Why shouldn't this > always be enabled? I do. From a user perspective it is sometimes difficult to determine the reason behind a failed operation; its is a DAC based denial, the LSM, or som

Re: [PATCH] selinux: Add __GFP_NOWARN to allocation at str_read()

2018-09-12 Thread Paul Moore
always does the right thing based on size of the allocation and the different slab allocators ... are we sure that this will always return NULL when (len + 1) is greater than KMALLOC_MAX_SIZE for the different slab allocator configurations? -- paul moore www.paul-moore.com __

Re: [PATCH 3/6] selinux: convert to kvmalloc

2018-09-12 Thread Paul Moore
id *), GFP_KERNEL); > > > if (!h->htable) > > > return -ENOMEM; > > > > > > > kvmalloc_array() does not imply __GFP_ZERO. > > Thanks, fixed When you resubmit this patch, please make sure you submit it to the SELinux

Re: [PATCH] selinux: refactor mls_context_to_sid() and make it stricter

2018-09-05 Thread Paul Moore
On Fri, Aug 31, 2018 at 11:47 AM Jann Horn wrote: > On Thu, Aug 9, 2018 at 3:56 AM Paul Moore wrote: > > On Mon, Aug 6, 2018 at 5:19 PM Jann Horn wrote: ... > > In the case where we have a MLS policy loaded (pol->mls_enabled != 0) > > and scontext is empty (scontext[

Re: WARNING in apparmor_secid_to_secctx

2018-09-05 Thread Paul Moore
rule in policy to just mark the inode unlabeled and not return an error to the caller. This permits mounting and access if allowed by policy, e.g. to unconfined domains. I also considered changing the behavior of security_genfs_sid() to never return -ENOENT, but the current behavior is relied upon by other callers to perform caller-specific handling. Fixes: 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs") CC: Reported-by: Dmitry Vyukov Reported-by: Waiman Long Signed-off-by: Stephen Smalley Tested-by: Waiman Long Signed-off-by: Paul Moore -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Re: [PATCH] selinux: fix mounting of cgroup2 under older policies

2018-09-05 Thread Paul Moore
On Tue, Sep 4, 2018 at 6:18 PM Paul Moore wrote: > On Tue, Sep 4, 2018 at 4:49 PM Stephen Smalley wrote: > > > > commit 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs") > > broke mounting of cgroup2 under older SELinux policies which lacked > &g

Re: [PATCH] selinux: fix mounting of cgroup2 under older policies

2018-09-04 Thread Paul Moore
if (rc == -ENOENT) { > + /* No match in policy, mark as unlabeled. */ > + *sid = SECINITSID_UNLABELED; > + rc = 0; > + } > } > free_page((unsigned long)buffer); > return rc; > --

Re: [PATCH] SELinux: allow other LSMs to use custom mount args

2018-08-28 Thread Paul Moore
DEFCONTEXT_STR "defcontext=" > -#define LABELSUPP_STR "seclabel" > +#define CONTEXT_STR "context=" > +#define FSCONTEXT_STR "fscontext=" > +#define ROOTCONTEXT_STR "rootcontext=" > +#define DEFCONTEXT_STR "defcon

[GIT PULL] SELinux patches for v4.19

2018-08-14 Thread Paul Moore
018-08-07 17:26:25 -0400) selinux/stable-4.18 PR 20180814 Eric Biggers (1): selinux: constify write_op[] Paul Moore (1): MAINTAINERS: update the LSM and SELi

Re: [PATCH] selinux: refactor mls_context_to_sid() and make it stricter

2018-08-13 Thread Paul Moore
On Fri, Aug 10, 2018 at 7:01 PM Jann Horn wrote: > On Thu, Aug 9, 2018 at 4:07 AM Paul Moore wrote: > > On Wed, Aug 8, 2018 at 9:56 PM Paul Moore wrote: > > > On Mon, Aug 6, 2018 at 5:19 PM Jann Horn wrote: > > > > > > > > The intended behavior

Re: [PATCH] selinux: refactor mls_context_to_sid() and make it stricter

2018-08-08 Thread Paul Moore
On Wed, Aug 8, 2018 at 9:56 PM Paul Moore wrote: > > On Mon, Aug 6, 2018 at 5:19 PM Jann Horn wrote: > > > > The intended behavior change for this patch is to reject any MLS strings > > that contain (trailing) garbage if p->mls_enabled is true. > > >

Re: [PATCH] selinux: refactor mls_context_to_sid() and make it stricter

2018-08-08 Thread Paul Moore
On Mon, Aug 6, 2018 at 5:19 PM Jann Horn wrote: > > The intended behavior change for this patch is to reject any MLS strings > that contain (trailing) garbage if p->mls_enabled is true. > > As suggested by Paul Moore, change mls_context_to_sid() so that the two > parts of th

Re: [PATCH] selinuxfs: Fix the resource leak in the failed branch of sel_make_inode

2018-08-08 Thread Paul Moore
On Tue, Aug 7, 2018 at 5:35 PM Paul Moore wrote: > > On Sun, Aug 5, 2018 at 5:48 AM nixiaoming wrote: > > If the resource requested by d_alloc_name is not added to the linked > > list through d_add, then dput needs to be called to release the > > subsequent abnormal

Re: [PATCH] selinuxfs: Fix the resource leak in the failed branch of sel_make_inode

2018-08-07 Thread Paul Moore
inode = sel_make_inode(sb, S_IFCHR | S_IRUGO | S_IWUGO); > - if (!inode) > + if (!inode) { > + dput(dentry); > goto err; > + } > > inode->i_ino = ++fsi->last_ino; > isec = (struct inode_security_struct

Re: [PATCH] selinux: stricter parsing in mls_context_to_sid()

2018-08-03 Thread Paul Moore
ss/mls.c > @@ -344,7 +344,7 @@ int mls_context_to_sid(struct policydb *pol, > break; > } > } > - if (delim == '-') { > + if (delim == '-' && l == 0) { > /

Re: maybe resource leak in security/selinux/selinuxfs.c

2018-08-03 Thread Paul Moore
_make_bools > Sel_make_avc_files > Sel_make_initcon_files > Sel_make_perm_files > Sel_make_class_dir_entries > Sel_make_policycap > Sel_fill_super > Sel_make_policy_nodes > Sel_make_classes -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Re: [PATCH] selinux: constify write_op[]

2018-07-17 Thread Paul Moore
*, char *, size_t) = { > [SEL_ACCESS] = sel_write_access, > [SEL_CREATE] = sel_write_create, > [SEL_RELABEL] = sel_write_relabel, > -- > 2.18.0.203.gfac676dfb9-goog -- paul moore www.paul-moore.com ___ Selinux mailing list Seli

[RFC PATCH v3] ipv6: make ipv6_renew_options() interrupt/kernel safe

2018-07-04 Thread Paul Moore
From: Paul Moore At present the ipv6_renew_options_kern() function ends up calling into access_ok() which is problematic if done from inside an interrupt as access_ok() calls WARN_ON_IN_IRQ() on some (all?) architectures (x86-64 is affected). Example warning/backtrace is shown below: WARNING

Re: [RFC PATCH v2] ipv6: make ipv6_renew_options() interrupt/kernel safe

2018-07-04 Thread Paul Moore
On Wed, Jul 4, 2018 at 1:29 AM David Miller wrote: > From: Paul Moore > Date: Mon, 02 Jul 2018 14:20:52 -0400 > > > -static int ipv6_renew_option(void *ohdr, > > - struct ipv6_opt_hdr __user *newopt, int > > newoptlen, > > -

Re: [PATCH] selinux: Use pr_fmt to prefix "SELinux: "

2018-07-02 Thread Paul Moore
On Mon, Jul 2, 2018 at 10:10 PM Joe Perches wrote: > On Mon, 2018-07-02 at 21:15 -0400, Paul Moore wrote: > > On Mon, Jul 2, 2018 at 5:31 PM Joe Perches wrote: > > > On Mon, 2018-07-02 at 16:51 -0400, Paul Moore wrote: > > > > On Wed, Jun 20, 2018 at 2:39 AM Joe Pe

Re: [PATCH] selinux: Use pr_fmt to prefix "SELinux: "

2018-07-02 Thread Paul Moore
On Mon, Jul 2, 2018 at 5:31 PM Joe Perches wrote: > On Mon, 2018-07-02 at 16:51 -0400, Paul Moore wrote: > > On Wed, Jun 20, 2018 at 2:39 AM Joe Perches wrote: > > > pr_fmt can be used with the pr_ macros to prefix > > > arbitrary content to logging messages. > &g

Re: [PATCH] selinux: Use pr_fmt to prefix "SELinux: "

2018-07-02 Thread Paul Moore
gt; (dev %s, type %s) errno=%d\n", > + mount_options[i], > + sb->s_id, sb->s_type->name, rc); > goto inval; > } What tree did you base your patch on? Please base SELinux pa

[RFC PATCH v2] ipv6: make ipv6_renew_options() interrupt/kernel safe

2018-07-02 Thread Paul Moore
From: Paul Moore At present the ipv6_renew_options_kern() function ends up calling into access_ok() which is problematic if done from inside an interrupt as access_ok() calls WARN_ON_IN_IRQ() on some (all?) architectures (x86-64 is affected). Example warning/backtrace is shown below: WARNING

Re: [RFC PATCH] ipv6: make ipv6_renew_options() interrupt/kernel safe

2018-07-02 Thread Paul Moore
On July 1, 2018 11:01:04 PM Paul Moore wrote: > From: Paul Moore > > At present the ipv6_renew_options_kern() function ends up calling into > access_ok() which is problematic if done from inside an interrupt as > access_ok() calls WARN_ON_IN_IRQ() on some (all?) architectur

[RFC PATCH] ipv6: make ipv6_renew_options() interrupt/kernel safe

2018-07-01 Thread Paul Moore
From: Paul Moore At present the ipv6_renew_options_kern() function ends up calling into access_ok() which is problematic if done from inside an interrupt as access_ok() calls WARN_ON_IN_IRQ() on some (all?) architectures (x86-64 is affected). Example warning/backtrace is shown below: WARNING

[GIT PULL] SELinux fixes for v4.18 (#1)

2018-06-29 Thread Paul Moore
Jann Horn (1): selinux: move user accesses in selinuxfs out of locked regions security/selinux/selinuxfs.c | 78 +--- 1 file changed, 33 insertions(+), 45 deletions(-) -- paul moore www.paul-moore.com

Re: [PATCH] selinux: move user accesses in selinuxfs out of locked regions

2018-06-28 Thread Paul Moore
On Thu, Jun 28, 2018 at 8:38 PM Paul Moore wrote: > On Thu, Jun 28, 2018 at 8:23 PM Paul Moore wrote: > > On Tue, Jun 26, 2018 at 8:15 AM Stephen Smalley wrote: > > > On 06/25/2018 12:34 PM, Jann Horn wrote: > > > > If a user is accessing a file in selinuxfs

Re: [PATCH] selinux: move user accesses in selinuxfs out of locked regions

2018-06-28 Thread Paul Moore
On Thu, Jun 28, 2018 at 8:23 PM Paul Moore wrote: > On Tue, Jun 26, 2018 at 8:15 AM Stephen Smalley wrote: > > On 06/25/2018 12:34 PM, Jann Horn wrote: > > > If a user is accessing a file in selinuxfs with a pointer to a userspace > > > buffer that is backed by e.g. a

Re: [PATCH] selinux: move user accesses in selinuxfs out of locked regions

2018-06-28 Thread Paul Moore
d. Even the RHEL-5.x based systems are at least on v2.6.18. Regardless, I think this is fine to merge as-is; thanks everyone. > Otherwise, you can add my > Acked-by: Stephen Smalley -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@t

Re: [PATCH] selinux: move user accesses in selinuxfs out of locked regions

2018-06-28 Thread Paul Moore
On Mon, Jun 25, 2018 at 6:40 PM Jann Horn wrote: > > On Tue, Jun 26, 2018 at 12:36 AM Paul Moore wrote: > > > > On Mon, Jun 25, 2018 at 12:34 PM Jann Horn wrote: > > > If a user is accessing a file in selinuxfs with a pointer to a userspace > > > buffer that

Re: [PATCH] selinux: move user accesses in selinuxfs out of locked regions

2018-06-25 Thread Paul Moore
c ssize_t sel_commit_bools_write(struct file > *filep, > if (length) > goto out; > > - length = -ENOMEM; > - if (count >= PAGE_SIZE) > - goto out; > - > - /* No partial writes. */ > - length = -EINVAL; &g

Re: [PATCH] ipv6: avoid copy_from_user() via ipv6_renew_options_kern()

2018-06-25 Thread Paul Moore
to ipv6_renew_option() and have it > do this pointer dance instead? > > That's going to definitely be easier to read. I agree, that struck me as a little odd. I'll rework that too. I'll send you guys something this week to take a look at. Thanks. > I don't know

Re: [PATCH] ipv6: avoid copy_from_user() via ipv6_renew_options_kern()

2018-06-23 Thread Paul Moore
On Sat, Jun 23, 2018 at 8:16 AM David Miller wrote: > > From: Paul Moore > Date: Fri, 22 Jun 2018 17:18:20 -0400 > > > From: Paul Moore > > > > The ipv6_renew_options_kern() function eventually called into > > copy_from_user(), despite it not using

[PATCH] ipv6: avoid copy_from_user() via ipv6_renew_options_kern()

2018-06-22 Thread Paul Moore
From: Paul Moore The ipv6_renew_options_kern() function eventually called into copy_from_user(), despite it not using any userspace buffers, which was problematic as that ended up calling access_ok() which emited a warning on x86 (and likely other arches as well). ipv6_renew_options_kern

Re: [PATCH 11/13] selinux: Cleanup printk logging in netif

2018-06-19 Thread Paul Moore
work interface label (%d)\n", > - ifindex); > + pr_warn("SELinux: failure in %s(), unable to determine > network interface label (%d)\n", > + __func__, ifindex); > kfree(new); > } >

Re: [PATCH 12/13] selinux: Cleanup printk logging in avc

2018-06-19 Thread Paul Moore
est_notif %d\n", >seqno, avc->avc_cache.latest_notif); > ret = -EAGAIN; > } > -- > 2.15.1 > -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.

Re: [PATCH 10/13] selinux: Cleanup printk logging in netport

2018-06-19 Thread Paul Moore
pr_warn("SELinux: failure in %s(), unable to determine > network port label\n", > + __func__); > kfree(new); > } > return ret; > -- > 2.15.1 -- paul moore www.paul-moore.com

Re: [PATCH 13/13] selinux: Cleanup printk logging in netnode

2018-06-19 Thread Paul Moore
pr_warn("SELinux: failure in %s(), unable to determine > network node label\n", > + __func__); > kfree(new); > } > return ret; > -- > 2.15.1 > -- paul moore www.paul-moore.com _

Re: [PATCH 09/13] selinux: Cleanup printk logging in sidtab

2018-06-19 Thread Paul Moore
rintk(KERN_DEBUG "%s: %d entries and %d/%d buckets used, longest " > + pr_debug("%s: %d entries and %d/%d buckets used, longest " > "chain length %d\n", tag, h->nel, slots_used, SIDTAB_SIZE, >max_chain_len); > } >

Re: [PATCH 08/13] selinux: Cleanup printk logging in netlink

2018-06-19 Thread Paul Moore
kb(skb); > oom: > - printk(KERN_ERR "SELinux: OOM in %s\n", __func__); > + pr_err("SELinux: OOM in %s\n", __func__); > goto out; > } > > -- > 2.15.1 > -- paul moore www.paul-moore.com __

Re: [PATCH 07/13] selinux: Cleanup printk logging in selinuxfs

2018-06-19 Thread Paul Moore
atic int __init init_sel_fs(void) > > selinux_null.mnt = selinuxfs_mount = kern_mount(&sel_fs_type); > if (IS_ERR(selinuxfs_mount)) { > - printk(KERN_ERR "selinuxfs: could not mount!\n"); > + pr_err("selinuxfs: c

Re: [PATCH 06/13] selinux: Cleanup printk logging in services

2018-06-19 Thread Paul Moore
e *state, > rc = -EINVAL; > context1 = sidtab_search(sidtab, sid); > if (!context1) { > - printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n", > + pr_err("SELinux: %s: unrecognized SID %d\n", >

Re: [PATCH 05/13] selinux: Cleanup printk logging in avtab

2018-06-19 Thread Paul Moore
return insertf(a, &key, &datum, p); > @@ -562,12 +563,12 @@ int avtab_read(struct avtab *a, void *fp, struct > policydb *pol) > > rc = next_entry(buf, fp, sizeof(u32)); > if (rc < 0) { > - printk(KERN_ERR "SELinux: avtab:

Re: [PATCH 02/13] selinux: Cleanup printk logging in ebitmap

2018-06-19 Thread Paul Moore
); > goto bad; > @@ -426,7 +425,7 @@ int ebitmap_read(struct ebitmap *e, void *fp) > > rc = next_entry(&map, fp, sizeof(u64)); > if (rc < 0) { > - printk(KERN_ERR "SELinux: ebitmap: truncated map\n"

Re: [PATCH 04/13] selinux: Cleanup printk logging in hooks

2018-06-19 Thread Paul Moore
ot;); > + pr_debug("SELinux: Starting in enforcing mode\n"); > else > - printk(KERN_DEBUG "SELinux: Starting in permissive mode\n"); > + pr_debug("SELinux: Starting in permissive mode\n"); > >

Re: [PATCH 03/13] selinux: Cleanup printk logging in policydb

2018-06-19 Thread Paul Moore
On Tue, Jun 19, 2018 at 12:45 PM Joe Perches wrote: > > On Tue, 2018-06-19 at 12:41 -0400, Paul Moore wrote: > > On Tue, Jun 12, 2018 at 4:09 AM Peter Enderborg > > wrote: > > > > > > Replace printk with pr_* to avoid checkpatch warnings and > >

Re: [PATCH 03/13] selinux: Cleanup printk logging in policydb

2018-06-19 Thread Paul Moore
pr_err("SELinux: security policydb version %d " > "(MLS) not backwards compatible\n", > p->policyvers); > goto bad; > @@ -2381,7 +2382,7 @@ int policydb_read(struct policydb *p, void *fp) > rc = -EINVAL; > info = policydb_lookup_compat(p->policyvers); > if (!info) { > - printk(KERN_ERR "SELinux: unable to find policy compat info " > + pr_err("SELinux: unable to find policy compat info " >"for version %d\n", p->policyvers); > goto bad; > } > @@ -2389,7 +2390,7 @@ int policydb_read(struct policydb *p, void *fp) > rc = -EINVAL; > if (le32_to_cpu(buf[2]) != info->sym_num || > le32_to_cpu(buf[3]) != info->ocon_num) { > - printk(KERN_ERR "SELinux: policydb table sizes (%d,%d) do " > + pr_err("SELinux: policydb table sizes (%d,%d) do " >"not match mine (%d,%d)\n", le32_to_cpu(buf[2]), > le32_to_cpu(buf[3]), >info->sym_num, info->ocon_num); > @@ -3417,7 +3418,7 @@ int policydb_write(struct policydb *p, void *fp) > * careful if you ever try to remove this restriction > */ > if (p->policyvers < POLICYDB_VERSION_AVTAB) { > - printk(KERN_ERR "SELinux: refusing to write policy version > %d." > + pr_err("SELinux: refusing to write policy version %d." >" Because it is less than version %d\n", > p->policyvers, >POLICYDB_VERSION_AVTAB); > return -EINVAL; > @@ -3446,7 +3447,7 @@ int policydb_write(struct policydb *p, void *fp) > /* Write the version, config, and table sizes. */ > info = policydb_lookup_compat(p->policyvers); > if (!info) { > - printk(KERN_ERR "SELinux: compatibility lookup failed for > policy " > + pr_err("SELinux: compatibility lookup failed for policy " > "version %d", p->policyvers); > return -EINVAL; > } > -- > 2.15.1 > -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Re: [PATCH 01/13] selinux: Cleanup printk logging in conditional

2018-06-19 Thread Paul Moore
others have mentioned, I think this patch is still a step forward so I'm going to go ahead and merge it; thanks Peter. As far as the prefix, or lack of, is concerned, that's probably an oversight that we should fix at some point, but we would need to look at each instance to verify. -- pau

[PATCH] MAINTAINERS: update the LSM and SELinux subsystems

2018-06-18 Thread Paul Moore
From: Paul Moore The SELinux code, security/selinux/, already has a MAINTAINERS entry so exclude it from the security subsystem entry in an effort to better reflect current practices. Signed-off-by: Paul Moore --- MAINTAINERS |1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS

selinux/next rebased to v4.18-rc1

2018-06-18 Thread Paul Moore
/blog/d/2017/07/kernel_repo_process.html -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Re: [-next PATCH] security: use octal not symbolic permissions

2018-06-14 Thread Paul Moore
On Wed, Jun 13, 2018 at 5:14 PM, Casey Schaufler wrote: > On 6/13/2018 12:57 PM, Paul Moore wrote: >> On Wed, Jun 13, 2018 at 3:30 PM, Joe Perches wrote: >>> On Wed, 2018-06-13 at 12:19 -0400, Paul Moore wrote: >>>> On Wed, Jun 13, 2018 at 12:04 PM, Joe Perches w

Re: [-next PATCH] security: use octal not symbolic permissions

2018-06-13 Thread Paul Moore
On Wed, Jun 13, 2018 at 3:30 PM, Joe Perches wrote: > On Wed, 2018-06-13 at 12:19 -0400, Paul Moore wrote: >> On Wed, Jun 13, 2018 at 12:04 PM, Joe Perches wrote: >> > On Wed, 2018-06-13 at 11:49 -0400, Paul Moore wrote: >> > > On Tue, Jun 12, 2018 at 8:29 PM, Joe P

Re: [PATCH] selinux-testsuite: Enhance inet_socket tests

2018-06-13 Thread Paul Moore
On Wed, Jun 13, 2018 at 12:46 PM, Richard Haines wrote: > On Tue, 2018-06-12 at 18:02 -0400, Paul Moore wrote: >> On Fri, Apr 13, 2018 at 6:13 AM, Richard Haines via Selinux >> wrote: >> > Enhance the tests as follows: >> > 1) Determine number of tests to run

Re: [-next PATCH] security: use octal not symbolic permissions

2018-06-13 Thread Paul Moore
On Wed, Jun 13, 2018 at 12:04 PM, Joe Perches wrote: > On Wed, 2018-06-13 at 11:49 -0400, Paul Moore wrote: >> On Tue, Jun 12, 2018 at 8:29 PM, Joe Perches wrote: >> > On Tue, 2018-06-12 at 17:12 -0400, Paul Moore wrote: >> > > Joe, in general I really appreciate

Re: [-next PATCH] security: use octal not symbolic permissions

2018-06-13 Thread Paul Moore
On Tue, Jun 12, 2018 at 8:29 PM, Joe Perches wrote: > On Tue, 2018-06-12 at 17:12 -0400, Paul Moore wrote: >> Joe, in general I really appreciate the fixes you send, but these >> patches that cross a lot of subsystem boundaries (this isn't the first >> one that doe

Re: [-next PATCH] security: use octal not symbolic permissions

2018-06-13 Thread Paul Moore
ame for the AppArmor patches, but take his work for it, not mine. Joe, in general I really appreciate the fixes you send, but these patches that cross a lot of subsystem boundaries (this isn't the first one that does this) causes unnecessary conflicts in -next and during the merge window. Could y

Re: [PATCH] selinux-testsuite: Enhance inet_socket tests

2018-06-12 Thread Paul Moore
s. > -$result = system > - "runcon -t test_inet_client_t $basedir/client -e nopeer dgram ::1 65535"; > -ok( $result eq 0 ); > +# This test now passes. > +$result = system > + "runcon -t test_inet_client_t $basedir/client -e nopeer dgram ::1 > 6

Re: selinux-testsuite inet_socket test failure

2018-06-11 Thread Paul Moore
On Sun, Jun 10, 2018 at 11:55 AM, Paul Moore wrote: > On Sat, Jun 9, 2018 at 1:12 AM, Sgeeta Dhundale wrote: >> Thank you Paul for looking at the issue. >> Yes I am using RHEL6.9/6.10 and OL6.9/6.10. >> I would wait for the fix, hope it will be fixed soon. > > As a FY

[PATCH] selinux-testsuite: fix the inet_socket tests on older policy releases

2018-06-11 Thread Paul Moore
From: Paul Moore Ensure that we apply MCS constraints to the test_inet_server_t domain, this was causing test failures on RHEL-6.x based systems. Thanks to Stephen Smalley and Lukas Vrabec for some off-list discussion related to this problem and its solution. Signed-off-by: Paul Moore

Re: selinux-testsuite inet_socket test failure

2018-06-10 Thread Paul Moore
tsuites's SELinux policy, I don't believe this is a problem with the kernel or userspace on RHEL-6.x based systems. I have some time set aside on Monday and Tuesday to work on SELinux policy, I'm hopeful that I'll have a fix then. > On Fri, Jun 8, 2018 at 10:11 PM, Paul M

Re: selinux-testsuite inet_socket test failure

2018-06-08 Thread Paul Moore
On Fri, Jun 8, 2018 at 12:35 PM, Paul Moore wrote: > On Fri, Jun 8, 2018 at 9:17 AM, Sgeeta Dhundale wrote: >> Hi, >> While running selinux testsuits I am seeing some of the inet_socket tests >> failure. >> Googled alotbut couldnt see any similler issue reported as

Re: selinux-testsuite inet_socket test failure

2018-06-08 Thread Paul Moore
at what RHEL-6.x based kernels are currently doing to ensure they are "correct" (I'm going to assume yes, but that is an assumption), and perhaps update the test suite to reflect the RHEL-6.x behavior. -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Re: [PATCH V2] selinux-testsuite: Add SCTP test support

2018-06-06 Thread Paul Moore
n my test system now so that's good :) Thanks again for all the time and effort that went into the SCTP patches/tests, I know how difficult stuff like this can be at times. -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tyc

[GIT PULL] SELinux patches for v4.18

2018-06-05 Thread Paul Moore
Guy Briggs (2): audit: normalize MAC_STATUS record audit: normalize MAC_POLICY_LOAD record Souptick Joarder (1): security: selinux: Change return type to vm_fault_t security/selinux/selinuxfs.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) -- paul moore

Re: [PATCH] selinux-testsuite: Add SCTP test support

2018-05-30 Thread Paul Moore
dr show up scope global' and using that instead of 'hostname -I'. -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

[GIT PULL] SELinux fixes for v4.17 (#2)

2018-05-30 Thread Paul Moore
inux/stable-4.17 PR 20180530 Sachin Grover (1): selinux: KASAN: slab-out-of-bounds in xattr_getsecurity security/selinux/ss/services.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- paul moore www.paul-moore.com ___

Re: [PATCH] selinux: KASAN: slab-out-of-bounds in xattr_getsecurity

2018-05-30 Thread Paul Moore
On Wed, May 30, 2018 at 11:23 AM, Stephen Smalley wrote: > On 05/30/2018 11:19 AM, Paul Moore wrote: >> On Fri, May 25, 2018 at 4:31 AM, Sachin Grover >> wrote: >>> Call trace: >>> [] dump_backtrace+0x0/0x428 >>> [] show_sta

Re: [PATCH] selinux: KASAN: slab-out-of-bounds in xattr_getsecurity

2018-05-30 Thread Paul Moore
&context, def_sid); > if (rc == -EINVAL && force) { > context.str = str; > - context.len = scontext_len; > + context.len = strlen(str) + 1; > str = NULL; > } else if (rc) >

[PATCH] selinux-testsuite: fix the mode bits for the binder tests

2018-05-30 Thread Paul Moore
From: Paul Moore Signed-off-by: Paul Moore --- tests/binder/test |0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/binder/test diff --git a/tests/binder/test b/tests/binder/test old mode 100644 new mode 100

[PATCH] selinux-testsuite: fix some style problems in the binder tests

2018-05-30 Thread Paul Moore
From: Paul Moore Fixes done by 'tools/check-syntax -f'. Signed-off-by: Paul Moore --- tests/binder/test_binder.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/binder/test_binder.c b/tests/binder/test_binder.c index 0d10a58..11fa358 100644 --- a/te

Re: [RFC V4 PATCH 1/1] selinux-testsuite: Add binder tests

2018-05-23 Thread Paul Moore
On Tue, May 22, 2018 at 3:52 PM, Paul Moore wrote: > On Tue, May 22, 2018 at 10:35 AM, Stephen Smalley wrote: >> On 05/22/2018 07:37 AM, Richard Haines wrote: >>> Add binder tests. See tests/binder/test_binder.c for details on >>> message flows to test s

Re: [RFC V4 PATCH 1/1] selinux-testsuite: Add binder tests

2018-05-22 Thread Paul Moore
look. I'll merge this now ... >> +brexit: I found this bit particularly amusing considering your email domain :) -- paul moore www.paul-moore.com ___ Selinux mailing list Selinux@tycho.nsa.gov To unsubscribe, send email to selinux-le...

Re: [PATCH ghak81 V3 3/3] audit: collect audit task parameters

2018-05-18 Thread Paul Moore
audit_kill_trees(&context->killed_trees); > > @@ -2071,8 +2104,8 @@ int audit_set_loginuid(kuid_t loginuid) > sessionid = (unsigned > int)atomic_inc_return(&session_id); > } > > - task->sessionid = sessionid; > - task->loginuid = loginuid; > + task->audit->sessionid = sessionid; > + task->audit->loginuid = loginuid; > out: > audit_log_set_loginuid(oldloginuid, loginuid, oldsessionid, > sessionid, rc); > return rc; > diff --git a/kernel/fork.c b/kernel/fork.c > index cd18448..92ab849 100644 > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -1713,7 +1713,7 @@ static __latent_entropy struct task_struct > *copy_process( > p->start_time = ktime_get_ns(); > p->real_start_time = ktime_get_boot_ns(); > p->io_context = NULL; > - audit_set_context(p, NULL); > + p->audit = NULL; > cgroup_fork(p); > #ifdef CONFIG_NUMA > p->mempolicy = mpol_dup(p->mempolicy); > -- > 1.8.3.1 -- paul moore www.paul-moore.com

Re: [PATCH ghak81 V3 2/3] audit: normalize loginuid read access

2018-05-18 Thread Paul Moore
t; (sig == SIGTERM || sig == SIGHUP || > sig == SIGUSR1 || sig == SIGUSR2)) { > audit_sig_pid = task_tgid_nr(current); > - if (uid_valid(current->loginuid)) > - audit_sig_uid = current->loginuid; > + auid = audit_get_loginuid(current); > + if (uid_valid(auid)) > + audit_sig_uid = auid; > else > audit_sig_uid = uid; > security_task_getsecid(current, &audit_sig_sid); > -- > 1.8.3.1 > -- paul moore www.paul-moore.com

Re: [PATCH ghak81 V3 1/3] audit: use new audit_context access funciton for seccomp_actions_logged

2018-05-18 Thread Paul Moore
t, GFP_KERNEL, > + ab = audit_log_start(audit_context(), GFP_KERNEL, > AUDIT_CONFIG_CHANGE); > if (unlikely(!ab)) > return; > -- > 1.8.3.1 -- paul moore www.paul-moore.com

Re: [PATCH 00/23] LSM: Full security module stacking

2018-05-17 Thread Paul Moore
On Wed, May 16, 2018 at 9:05 PM, Casey Schaufler wrote: > On 5/16/2018 5:19 PM, Paul Moore wrote: >> On Wed, May 16, 2018 at 1:42 PM, Casey Schaufler >> wrote: >>> On 5/15/2018 2:49 PM, James Morris wrote: >>>> On Tue, 15 May 2018, Casey Schaufler wrote: &

Re: Re: [RFC PATCH] selinux-testsuite: check the "expand-check" setting in semanage.conf

2018-05-17 Thread Paul Moore
On Wed, May 16, 2018 at 8:48 AM, Stephen Smalley wrote: > On 05/16/2018 03:31 AM, Petr Lautrbach wrote: >> On Tue, May 15, 2018 at 05:03:42PM -0400, Paul Moore wrote: >>> From: Paul Moore >>> >>> If expand-check is non-zero in semanage.conf the policy lo

  1   2   3   4   5   6   7   8   >