linux-stable/security/selinux/ss
Ondrej Mosnacek 5df275cd4c selinux: policydb - fix byte order and alignment issues
Do the LE conversions before doing the Infiniband-related range checks.
The incorrect checks are otherwise causing a failure to load any policy
with an ibendportcon rule on BE systems. This can be reproduced by
running (on e.g. ppc64):

cat >my_module.cil <<EOF
(type test_ibendport_t)
(roletype object_r test_ibendport_t)
(ibendportcon mlx4_0 1 (system_u object_r test_ibendport_t ((s0) (s0))))
EOF
semodule -i my_module.cil

Also, fix loading/storing the 64-bit subnet prefix for OCON_IBPKEY to
use a correctly aligned buffer.

Finally, do not use the 'nodebuf' (u32) buffer where 'buf' (__le32)
should be used instead.

Tested internally on a ppc64 machine with a RHEL 7 kernel with this
patch applied.

Cc: Daniel Jurgens <danielj@mellanox.com>
Cc: Eli Cohen <eli@mellanox.com>
Cc: James Morris <jmorris@namei.org>
Cc: Doug Ledford <dledford@redhat.com>
Cc: <stable@vger.kernel.org> # 4.13+
Fixes: a806f7a161 ("selinux: Create policydb version for Infiniband support")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2018-11-05 15:25:50 -05:00
..
avtab.c selinux: Cleanup printk logging in avtab 2018-06-19 13:00:48 -04:00
avtab.h selinux: wrap global selinux state 2018-03-01 18:48:02 -05:00
conditional.c selinux: Cleanup printk logging in conditional 2018-06-19 11:39:12 -04:00
conditional.h selinux: extended permissions for ioctls 2015-07-13 13:31:58 -04:00
constraint.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
context.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ebitmap.c selinux: Cleanup printk logging in ebitmap 2018-06-19 11:47:46 -04:00
ebitmap.h selinux: wrap global selinux state 2018-03-01 18:48:02 -05:00
hashtab.c selinux: wrap global selinux state 2018-03-01 18:48:02 -05:00
hashtab.h selinux: wrap global selinux state 2018-03-01 18:48:02 -05:00
mls.c selinux: refactor mls_context_to_sid() and make it stricter 2018-09-05 17:47:09 -04:00
mls.h selinux: refactor mls_context_to_sid() and make it stricter 2018-09-05 17:47:09 -04:00
mls_types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
policydb.c selinux: policydb - fix byte order and alignment issues 2018-11-05 15:25:50 -05:00
policydb.h selinux: update my email address 2017-08-17 15:32:55 -04:00
services.c selinux: refactor mls_context_to_sid() and make it stricter 2018-09-05 17:47:09 -04:00
services.h selinux: wrap global selinux state 2018-03-01 18:48:02 -05:00
sidtab.c selinux: Cleanup printk logging in sidtab 2018-06-19 13:37:58 -04:00
sidtab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
status.c selinux: rename the {is,set}_enforcing() functions 2018-03-02 14:18:55 -05:00
symtab.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
symtab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00