Facing problem while running the audit2allow command

2018-02-14 Thread Aman Sharma
Hi All, I am getting one issue while running the command *audit2allow *and below is the logs for the same : After switching back to lower version, running "audit2allow -a" command show below errors repeteadly and the command does not return: libsepol.context_from_record: invalid security context:

Re: [PATCH V6 0/4] Add SELinux SCTP protocol support

2018-02-14 Thread Marcelo Ricardo Leitner
On Wed, Feb 14, 2018 at 02:19:03PM -0500, Paul Moore wrote: > On Tue, Feb 13, 2018 at 3:52 PM, Richard Haines > wrote: > > These patches have been built on Fedora 27 with kernel-4.16.0-0.rc1 plus > > the following userspace patches to enable testing: > > > > 1) Updates to libsepol 2.7 to support t

[PATCH 3/3] python/sepolicy: Fix translated strings with parameters

2018-02-14 Thread Nicolas Iooss
When a translated string takes parameters with %, the % and the parameters need to be after the call to the underline function in order to work properly. Signed-off-by: Nicolas Iooss --- python/sepolicy/sepolicy/generate.py | 2 +- python/sepolicy/sepolicy/gui.py | 28 ++-

[PATCH 2/3] python/sepolicy: Initialize policy.ports as a dict in generate.py

2018-02-14 Thread Nicolas Iooss
in class policy, ports is usually initialized with the result of get_all_ports(), which is a dict. If this function failed, the error was not fatal but ports was left initialized as a list, which would trigger other errors when accessing it. Initialize ports as an empty dict in order to fix this i

[PATCH 1/3] python/sepolicy: Support non-MLS policy

2018-02-14 Thread Nicolas Iooss
When using sepolgen GUI on a system with a non-MLS policy, sepolicy.info(sepolicy.PORT) does not define "range" attributes (since commit 908340e8e7a9 ("sepolicy: support non-MLS policy in manpage")). Replace them with None in get_all_ports() result. Signed-off-by: Nicolas Iooss --- python/sepoli

Re: [PATCH V6 2/4] sctp: Add ip option support

2018-02-14 Thread Marcelo Ricardo Leitner
Hi, On Tue, Feb 13, 2018 at 08:54:44PM +, Richard Haines wrote: ... > diff --git a/net/sctp/socket.c b/net/sctp/socket.c > index bf271f8..8307968 100644 > --- a/net/sctp/socket.c > +++ b/net/sctp/socket.c > @@ -3138,6 +3138,7 @@ static int sctp_setsockopt_mappedv4(struct sock *sk, > char __us

Re: [PATCH V6 0/4] Add SELinux SCTP protocol support

2018-02-14 Thread David Miller
SCTP folks, please review the SCTP parts that add the IP option support. Thank you.

Re: [PATCH V6 0/4] Add SELinux SCTP protocol support

2018-02-14 Thread Paul Moore
On Tue, Feb 13, 2018 at 3:52 PM, Richard Haines wrote: > These patches have been built on Fedora 27 with kernel-4.16.0-0.rc1 plus > the following userspace patches to enable testing: > > 1) Updates to libsepol 2.7 to support the sctp portcon statement. >The patch is available from: >

[PATCH Rework of makefiles v5 16/15] Travis-CI: do not duplicate $DESTDIR in $PYSITEDIR

2018-02-14 Thread Nicolas Iooss
Recent commits removed $DESTDIR from $PYSITEDIR in libselinux and libsemanage: -PYSITEDIR ?= $(DESTDIR)$(shell $(PYTHON) -c 'import site; print(site.getsitepackages()[0])') +PYSITEDIR ?= $(shell $(PYTHON) -c 'import site; print(site.getsitepackages()[0])') As "site.getsitepackages

Re: Rework of makefiles v5

2018-02-14 Thread Nicolas Iooss
On Wed, Feb 14, 2018 at 10:57 AM, Marcus Folkesson wrote: > I have updated the patchset. > > The biggest change is that $(DESTDIR) is now used in the > install stage only. > > Also some overidden CFLAGS/LDFLAGS has been removed since we now have > explicit build rules. > > I have moved the changel

Re: [PATCH] netlabel: If PF_INET6, check sk_buff ip header version

2018-02-14 Thread Paul Moore
On Mon, Nov 13, 2017 at 5:13 PM, Paul Moore wrote: > On Mon, Nov 13, 2017 at 3:54 PM, Richard Haines > wrote: >> When resolving a fallback label, check the sk_buff version as it >> is possible (e.g. SCTP) to have family = PF_INET6 while >> receiving ip_hdr(skb)->version = 4. >> >> Signed-off-by:

Re: [PATCH v5 07/15] policycoreutils: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Nicolas Iooss
On Wed, Feb 14, 2018 at 10:57 AM, Marcus Folkesson wrote: > Signed-off-by: Marcus Folkesson > --- > > Notes: > v5: > - Only use $(DESTDIR) in install > v2: > - Rework all packages (not just selinux/sepol/semanage) > > policycoreutils/hll/pp/Makefile | 9 +++-- >

Re: KASAN: use-after-free Read in selinux_inode_free_security

2018-02-14 Thread Dmitry Vyukov via Selinux
On Wed, Feb 14, 2018 at 3:25 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on upstream commit > b89e32ccd1be92a3643df3908d3026b09e271616 (Fri Feb 2 21:46:21 2018 +) > Merge branch 'for-linus' of > git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha > > Unfortunately, I

Re: KASAN: use-after-free Read in do_raw_spin_lock

2018-02-14 Thread Dmitry Vyukov via Selinux
On Fri, Nov 3, 2017 at 10:04 AM, Dmitry Vyukov wrote: >>> On Thu, Nov 2, 2017 at 1:52 PM, syzbot >>> >>> wrote: Hello, syzkaller hit the following crash on ebe6e90ccc6679cb01d2b280e4b61e6092d4bedb git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master >>>

[PATCH v5 12/15] secilc: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v5: - Only use $(DESTDIR) in install v2: - Rework all packages (not just selinux/sepol/semanage) secilc/Makefile | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/secilc/Makefile b/secilc/Makef

[PATCH v5 01/15] libsepol: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
This patch solves the following issues: - The pkg-config files generates odd paths when using DESTDIR without PREFIX - DESTDIR is needed during compile time to compute library and header paths which it should not. - Installing with both DESTDIR and PREFIX set gives us odd paths - Make usage of DES

[PATCH v5 15/15] build: setup buildpaths if DESTDIR is specified

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v4: - add LIBDIR to LDFLAGS if DESTDIR is specified - export LIBSEPOLA if DESTDIR is specified v3: - Add default prefix Makefile | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile

[PATCH v5 05/15] gui: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v5: - Only use $(DESTDIR) in install v2: - Rework all packages (not just selinux/sepol/semanage) gui/Makefile | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git

[PATCH v5 03/15] libsemanage: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
This patch solves the following issues: - DESTDIR is needed during compile time to compute library and header paths which it should not. - Installing with both DESTDIR and PREFIX set gives us odd paths - Make usage of DESTDIR and PREFIX more standard Signed-off-by: Marcus Folkesson --- Notes:

[PATCH v5 14/15] dbus: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- dbus/Makefile | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dbus/Makefile b/dbus/Makefile index 9a6cc90e..53143aff 100644 --- a/dbus/Makefile +++ b/dbus/Makefile @@ -1,3 +1,5 @@ +PREFIX ?= /usr + all: clean: @@ -5,12 +7,

[PATCH v5 11/15] sandbox: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v5: - Only use $(DESTDIR) in install v2: - Rework all packages (not just selinux/sepol/semanage) sandbox/Makefile | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/sand

[PATCH v5 09/15] python: build: move modules from platform-specific to platform-shared

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- python/semanage/Makefile | 2 +- python/sepolgen/src/sepolgen/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/semanage/Makefile b/python/semanage/Makefile index a8465e62..5fc1998e 100644 --- a/python/semanage/

[PATCH v5 10/15] restorecond: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v5: - Only use $(DESTDIR) in install v2: - Rework all packages (not just selinux/sepol/semanage) restorecond/Makefile | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/restorec

[PATCH v5 13/15] semodule-utils: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v5: - Only use $(DESTDIR) in install v2: - Rework all packages (not just selinux/sepol/semanage) semodule-utils/semodule_expand/Makefile | 12 +--- semodule-utils/semodule_link/Makefile| 12 +--- semodule-ut

[PATCH v5 07/15] policycoreutils: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v5: - Only use $(DESTDIR) in install v2: - Rework all packages (not just selinux/sepol/semanage) policycoreutils/hll/pp/Makefile | 9 +++-- policycoreutils/load_policy/Makefile | 16 policycoreutils/ma

[PATCH v5 08/15] python: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v5: - Only use $(DESTDIR) in install - Remove CFLAGS from linking rule v4: - move platform from platform specific to platform shared installation directory v3: - Add missing slash - keep the

[PATCH v5 06/15] mcstrans: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Notes: v5: - Only use $(DESTDIR) in install - Remove CFLAGS from linking rule - Do not override CFLAGS v3: - keep the possibility to specify LIBSEPOLA to make depending component recompile on change. If not s

Rework of makefiles v5

2018-02-14 Thread Marcus Folkesson
I have updated the patchset. The biggest change is that $(DESTDIR) is now used in the install stage only. Also some overidden CFLAGS/LDFLAGS has been removed since we now have explicit build rules. I have moved the changelog into patches. Please test to compile with: make DESTDIR=/tmp/myroot PR

[PATCH v5 04/15] checkpolicy: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
This patch solves the following issues: - DESTDIR is needed during compile time to compute library and header paths which it should not. - Installing with both DESTDIR and PREFIX set gives us odd paths - Make usage of DESTDIR and PREFIX more standard Signed-off-by: Marcus Folkesson --- Notes:

[PATCH v5 02/15] libselinux: build: follow standard semantics for DESTDIR and PREFIX

2018-02-14 Thread Marcus Folkesson
This patch solves the following issues: - The pkg-config files generates odd paths when using DESTDIR without PREFIX - DESTDIR is needed during compile time to compute library and header paths which it should not. - Installing with both DESTDIR and PREFIX set gives us odd paths - Make usage of DES

[PATCH 4/4] python/sepolicy: Do not use types.BooleanType

2018-02-14 Thread Petr Lautrbach
It was removed from Python 3 Fixes: File "polgengui.py", line 390, in forward self.generate_policy() File "polgengui.py", line 491, in generate_policy my_policy.set_use_syslog(self.syslog_checkbutton.get_active() == 1) File "/home/plautrba/devel/github/bachradsusi/SELinuxProject-selinux/pytho

[PATCH 1/4] gui/polgengui.py: Fix sepolicy.generate import in polgengui.py

2018-02-14 Thread Petr Lautrbach
b43991f9 added direct import of sepolicy but it forgot to import sepolicy.generate and didn't change use of generate to sepolicy.generate Fixes: Traceback (most recent call last): File "/usr/bin/selinux-polgengui", line 778, in app = childWindow() File "/usr/bin/selinux-polgengui", line

[PATCH 3/4] python/sepolicy: Use list instead of map

2018-02-14 Thread Petr Lautrbach
map() returns an iterator in python3, list in python2 Fixes: File "/usr/lib/python3.6/site-packages/sepolicy/generate.py", line 114, in get_all_users users.remove("system_u") AttributeError: 'map' object has no attribute 'remove' Signed-off-by: Petr Lautrbach --- python/sepolicy/sepolicy/gen

Update selinux-sepolgengui to be compatible with Gtk3, Python 3

2018-02-14 Thread Petr Lautrbach
Hi, The following set of patches update polgengui.py, rename polgen.glade to polgen.ui, convert it to new format, and fix some other sepolicy Python 3 related issues. Thanks, Petr