Re: [PATCH] libsepol: Fully expand neverallowxperm rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-by: Jeff Vander Stoep <jeffv@xxxxxxxxxx>

On Sat, Nov 21, 2015 at 8:30 AM Richard Haines <richard_c_haines@xxxxxxxxxxxxxx> wrote:
Currently neverallowxperm rules will be resolved correctly when
building policy, however they are not detectable when using tools
such as an updated version of setools. This patch will allow
these to be viewed in the same way as neverallow rules are in a
text based kernel policy file (e.g. policy.conf).

Signed-off-by: Richard Haines <richard_c_haines@xxxxxxxxxxxxxx>
---
 libsepol/src/expand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libsepol/src/expand.c b/libsepol/src/expand.c
index 9047c6d..9cb7965 100644
--- a/libsepol/src/expand.c
+++ b/libsepol/src/expand.c
@@ -1811,6 +1811,8 @@ static int expand_avrule_helper(sepol_handle_t * handle,
                if (handle && handle->disable_dontaudit)
                        return EXPAND_RULE_SUCCESS;
                spec = AVTAB_XPERMS_DONTAUDIT;
+       } else if (specified & AVRULE_XPERMS_NEVERALLOW) {
+               spec = AVTAB_XPERMS_NEVERALLOW;
        } else {
                assert(0);      /* unreachable */
        }
@@ -1948,7 +1950,7 @@ static int convert_and_expand_rule(sepol_handle_t * handle,

        if (!do_neverallow && source_rule->specified & AVRULE_NEVERALLOW)
                return EXPAND_RULE_SUCCESS;
-       if (source_rule->specified & AVRULE_XPERMS_NEVERALLOW)
+       if (!do_neverallow && source_rule->specified & AVRULE_XPERMS_NEVERALLOW)
                return EXPAND_RULE_SUCCESS;

        ebitmap_init(&stypes);
--
2.5.0

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.
_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux