mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-24 15:02:44 +00:00
4df9f89cb1
During resolution of classcommon statements (cil_resolve_classcommon), we add the number of class common permissions to the values of the class permissions. This way, the internal CIL values of the common permission go from 0 to N, and the values of class permissions start at N+1 (where N is the number of common permissions). When we reset a class due to reresolve (cil_reset_class), we must then reverse this process by subtracting the number of common permissions from the class permission values. However, there is a bug when resetting classes in which we subtract the number of common permissions from the common permissions value rather than the class permissions value. This means that class permissions could be too high (since they are not reduced on reset) and common permissions underflowed (since they are reduced, but should not be). In most cases, this didn't actually matter since these permission values aren't used when creating the binary. Additionally, we always access the permissions via a hash table lookup or map, and then use whatever value they have to set bits in bitmaps. As long as the bits in the bitmap match the values, things work as expected. However, the one case where these values do matter is if you use 'all' in a class permission set. In this case, we enable bits 0 through number of permissions in a bitmap. But because our permission values are all mixed up, these enabled bits do not correspond to the permission values. This results in making it look like no permissions were set in a class permission set, and the rule is essentially ignored. This patch fixes the bug so that the values of class permissions are properly reset, allowing one to use 'all' in class permission sets in a policy that reresolves. Signed-off-by: Steve Lawrence <slawrence@tresys.com> Signed-off-by: James Carter <jwcart2@tycho.nsa.gov> |
||
---|---|---|
checkpolicy | ||
libselinux | ||
libsemanage | ||
libsepol | ||
policycoreutils | ||
scripts | ||
secilc | ||
sepolgen | ||
.gitignore | ||
Android.mk | ||
CleanSpec.mk | ||
Makefile | ||
README |
Please submit all bug reports and patches to selinux@tycho.nsa.gov. Subscribe via selinux-join@tycho.nsa.gov. Build dependencies on Fedora: yum install audit-libs-devel bison bzip2-devel dbus-devel dbus-glib-devel flex flex-devel flex-static glib2-devel libcap-devel libcap-ng-devel pam-devel pcre-devel python-devel setools-devel swig ustr-devel To build and install everything under a private directory, run: make DESTDIR=~/obj install install-pywrap To install as the default system libraries and binaries (overwriting any previously installed ones - dangerous!), on x86_64, run: make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap relabel or on x86 (32-bit), run: make install install-pywrap relabel This may render your system unusable if the upstream SELinux userspace lacks library functions or other dependencies relied upon by your distribution. If it breaks, you get to keep both pieces.