20 Jul, 2011

1 commit


27 May, 2011

1 commit

  • Right now security_get_user_sids() will pass in a NULL avd pointer to
    avc_has_perm_noaudit(), which then forces that function to have a dummy
    entry for that case and just generally test it.

    Don't do it. The normal callers all pass a real avd pointer, and this
    helper function is incredibly hot. So don't make avc_has_perm_noaudit()
    do conditional stuff that isn't needed for the common case.

    This also avoids some duplicated stack space.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

24 May, 2011

1 commit


20 May, 2011

2 commits

  • There is no point in counting hits - we can calculate it from the number
    of lookups and misses.

    This makes the avc statistics a bit smaller, and makes the code
    generation better too.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • You can turn off the avc cache stats, but distributions seem to not do
    that (perhaps because several performance tuning how-to's talk about the
    avc cache statistics).

    Which is sad, because the code it generates is truly horrendous, with
    the statistics update being sandwitched between get_cpu/put_cpu which in
    turn causes preemption disables etc. We're talking ten+ instructions
    just to increment a per-cpu variable in some pretty hot code.

    Fix the craziness by just using 'this_cpu_inc()' instead. Suddenly we
    only need a single 'inc' instruction to increment the statistics. This
    is quite noticeable in the incredibly hot avc_has_perm_noaudit()
    function (which triggers all the statistics by virtue of doing an
    avc_lookup() call).

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

26 Apr, 2011

3 commits

  • Now that the security modules can decide whether they support the
    dcache RCU walk or not it's possible to make selinux a bit more
    RCU friendly. The SELinux AVC and security server access decision
    code is RCU safe. A specific piece of the LSM audit code may not
    be RCU safe.

    This patch makes the VFS RCU walk retry if it would hit the non RCU
    safe chunk of code. It will normally just work under RCU. This is
    done simply by passing the VFS RCU state as a flag down into the
    avc_audit() code and returning ECHILD there if it would have an issue.

    Based-on-patch-by: Andi Kleen
    Signed-off-by: Eric Paris
    Signed-off-by: Linus Torvalds

    Eric Paris
     
  • The lsm common audit code has wacky contortions making sure which pieces
    of information are set based on if it was given a path, dentry, or
    inode. Split this into path and inode to get rid of some of the code
    complexity.

    Signed-off-by: Eric Paris
    Acked-by: Casey Schaufler

    Eric Paris
     
  • Now that the security modules can decide whether they support the
    dcache RCU walk or not it's possible to make selinux a bit more
    RCU friendly. The SELinux AVC and security server access decision
    code is RCU safe. A specific piece of the LSM audit code may not
    be RCU safe.

    This patch makes the VFS RCU walk retry if it would hit the non RCU
    safe chunk of code. It will normally just work under RCU. This is
    done simply by passing the VFS RCU state as a flag down into the
    avc_audit() code and returning ECHILD there if it would have an issue.

    Based-on-patch-by: Andi Kleen
    Signed-off-by: Eric Paris

    Eric Paris
     

02 Aug, 2010

2 commits

  • Currently there are a number of applications (nautilus being the main one) which
    calls access() on files in order to determine how they should be displayed. It
    is normal and expected that nautilus will want to see if files are executable
    or if they are really read/write-able. access() should return the real
    permission. SELinux policy checks are done in access() and can result in lots
    of AVC denials as policy denies RWX on files which DAC allows. Currently
    SELinux must dontaudit actual attempts to read/write/execute a file in
    order to silence these messages (and not flood the logs.) But dontaudit rules
    like that can hide real attacks. This patch addes a new common file
    permission audit_access. This permission is special in that it is meaningless
    and should never show up in an allow rule. Instead the only place this
    permission has meaning is in a dontaudit rule like so:

    dontaudit nautilus_t sbin_t:file audit_access

    With such a rule if nautilus just checks access() we will still get denied and
    thus userspace will still get the correct answer but we will not log the denial.
    If nautilus attempted to actually perform one of the forbidden actions
    (rather than just querying access(2) about it) we would still log a denial.
    This type of dontaudit rule should be used sparingly, as it could be a
    method for an attacker to probe the system permissions without detection.

    Signed-off-by: Eric Paris
    Acked-by: Stephen D. Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • Remove all rcu head inits. We don't care about the RCU head state before passing
    it to call_rcu() anyway. Only leave the "on_stack" variants so debugobjects can
    keep track of objects on stack.

    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Paul E. McKenney
    Cc: Stephen Smalley
    Reviewed-by: James Morris
    Cc: Eric Paris
    Signed-off-by: James Morris

    Paul E. McKenney
     

28 Apr, 2010

1 commit


08 Mar, 2010

1 commit


05 Feb, 2010

1 commit


03 Feb, 2010

1 commit

  • Only audit the permissions specified by the policy rules.

    Before:
    type=AVC msg=audit(01/28/2010 14:30:46.690:3250) : avc: denied { read
    append } for pid=14092 comm=foo name=test_file dev=dm-1 ino=132932
    scontext=unconfined_u:unconfined_r:load_policy_t:s0-s0:c0.c1023
    tcontext=unconfined_u:object_r:rpm_tmp_t:s0 tclass=file

    After:
    type=AVC msg=audit(01/28/2010 14:52:37.448:26) : avc: denied
    { append } for pid=1917 comm=foo name=test_file dev=dm-1 ino=132932
    scontext=unconfined_u:unconfined_r:load_policy_t:s0-s0:c0.c1023
    tcontext=unconfined_u:object_r:rpm_tmp_t:s0 tclass=file

    Reference:
    https://bugzilla.redhat.com/show_bug.cgi?id=558499

    Reported-by: Tom London
    Signed-off-by: Stephen D. Smalley
    Signed-off-by: James Morris

    Stephen Smalley
     

18 Jan, 2010

1 commit

  • If allow_unknown==deny, SELinux treats an undefined kernel security
    class as an error condition rather than as a typical permission denial
    and thus does not allow permissions on undefined classes even when in
    permissive mode. Change the SELinux logic so that this case is handled
    as a typical permission denial, subject to the usual permissive mode and
    permissive domain handling.

    Also drop the 'requested' argument from security_compute_av() and
    helpers as it is a legacy of the original security server interface and
    is unused.

    Changes:
    - Handle permissive domains consistently by moving up the test for a
    permissive domain.
    - Make security_compute_av_user() consistent with security_compute_av();
    the only difference now is that security_compute_av() performs mapping
    between the kernel-private class and permission indices and the policy
    values. In the userspace case, this mapping is handled by libselinux.
    - Moved avd_init inside the policy lock.

    Based in part on a patch by Paul Moore .

    Reported-by: Andrew Worsley
    Signed-off-by: Stephen D. Smalley
    Reviewed-by: Paul Moore
    Signed-off-by: James Morris

    Stephen Smalley
     

24 Nov, 2009

1 commit

  • Historically we've seen cases where permissions are requested for classes
    where they do not exist. In particular we have seen CIFS forget to set
    i_mode to indicate it is a directory so when we later check something like
    remove_name we have problems since it wasn't defined in tclass file. This
    used to result in a avc which included the permission 0x2000 or something.
    Currently the kernel will deny the operations (good thing) but will not
    print ANY information (bad thing). First the auditdeny field is no
    extended to include unknown permissions. After that is fixed the logic in
    avc_dump_query to output this information isn't right since it will remove
    the permission from the av and print the phrase "". This takes us
    back to the behavior before the classmap rewrite.

    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     

07 Oct, 2009

1 commit

  • Modify SELinux to dynamically discover class and permission values
    upon policy load, based on the dynamic object class/perm discovery
    logic from libselinux. A mapping is created between kernel-private
    class and permission indices used outside the security server and the
    policy values used within the security server.

    The mappings are only applied upon kernel-internal computations;
    similar mappings for the private indices of userspace object managers
    is handled on a per-object manager basis by the userspace AVC. The
    interfaces for compute_av and transition_sid are split for kernel
    vs. userspace; the userspace functions are distinguished by a _user
    suffix.

    The kernel-private class indices are no longer tied to the policy
    values and thus do not need to skip indices for userspace classes;
    thus the kernel class index values are compressed. The flask.h
    definitions were regenerated by deleting the userspace classes from
    refpolicy's definitions and then regenerating the headers. Going
    forward, we can just maintain the flask.h, av_permissions.h, and
    classmap.h definitions separately from policy as they are no longer
    tied to the policy values. The next patch introduces a utility to
    automate generation of flask.h and av_permissions.h from the
    classmap.h definitions.

    The older kernel class and permission string tables are removed and
    replaced by a single security class mapping table that is walked at
    policy load to generate the mapping. The old kernel class validation
    logic is completely replaced by the mapping logic.

    The handle unknown logic is reworked. reject_unknown=1 is handled
    when the mappings are computed at policy load time, similar to the old
    handling by the class validation logic. allow_unknown=1 is handled
    when computing and mapping decisions - if the permission was not able
    to be mapped (i.e. undefined, mapped to zero), then it is
    automatically added to the allowed vector. If the class was not able
    to be mapped (i.e. undefined, mapped to zero), then all permissions
    are allowed for it if allow_unknown=1.

    avc_audit leverages the new security class mapping table to lookup the
    class and permission names from the kernel-private indices.

    The mdp program is updated to use the new table when generating the
    class definitions and allow rules for a minimal boot policy for the
    kernel. It should be noted that this policy will not include any
    userspace classes, nor will its policy index values for the kernel
    classes correspond with the ones in refpolicy (they will instead match
    the kernel-private indices).

    Signed-off-by: Stephen Smalley
    Signed-off-by: James Morris

    Stephen Smalley
     

24 Sep, 2009

1 commit

  • The security_ops reset done when SELinux is disabled at run time is done
    after the avc cache is freed and after the kmem_cache for the avc is also
    freed. This means that between the time the selinux disable code destroys
    the avc_node_cachep another process could make a security request and could
    try to allocate from the cache. We are just going to leave the cachep around,
    like we always have.

    SELinux: Disabled at runtime.
    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] kmem_cache_alloc+0x9a/0x185
    PGD 0
    Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    last sysfs file:
    CPU 1
    Modules linked in:
    Pid: 12, comm: khelper Not tainted 2.6.31-tip-05525-g0eeacc6-dirty #14819
    System Product Name
    RIP: 0010:[] []
    kmem_cache_alloc+0x9a/0x185
    RSP: 0018:ffff88003f9258b0 EFLAGS: 00010086
    RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000078c0129e
    RDX: 0000000000000000 RSI: ffffffff8130b626 RDI: ffffffff81122528
    RBP: ffff88003f925900 R08: 0000000078c0129e R09: 0000000000000001
    R10: 0000000000000000 R11: 0000000078c0129e R12: 0000000000000246
    R13: 0000000000008020 R14: ffff88003f8586d8 R15: 0000000000000001
    FS: 0000000000000000(0000) GS:ffff880002b00000(0000)
    knlGS:0000000000000000
    CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
    CR2: 0000000000000000 CR3: 0000000001001000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: ffffffff827bd420 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process khelper (pid: 12, threadinfo ffff88003f924000, task
    ffff88003f928000)
    Stack:
    0000000000000246 0000802000000246 ffffffff8130b626 0000000000000001
    0000000078c0129e 0000000000000000 ffff88003f925a70 0000000000000002
    0000000000000001 0000000000000001 ffff88003f925960 ffffffff8130b626
    Call Trace:
    [] ? avc_alloc_node+0x36/0x273
    [] avc_alloc_node+0x36/0x273
    [] ? avc_latest_notif_update+0x7d/0x9e
    [] avc_insert+0x51/0x18d
    [] avc_has_perm_noaudit+0x9d/0x128
    [] avc_has_perm+0x45/0x88
    [] current_has_perm+0x52/0x6d
    [] selinux_task_create+0x2f/0x45
    [] security_task_create+0x29/0x3f
    [] copy_process+0x82/0xdf0
    [] ? register_lock_class+0x2f/0x36c
    [] ? mark_lock+0x2e/0x1e1
    [] do_fork+0x16e/0x382
    [] ? register_lock_class+0x2f/0x36c
    [] ? probe_workqueue_execution+0x57/0xf9
    [] ? mark_lock+0x2e/0x1e1
    [] ? probe_workqueue_execution+0x57/0xf9
    [] kernel_thread+0x82/0xe0
    [] ? ____call_usermodehelper+0x0/0x139
    [] ? child_rip+0x0/0x20
    [] ? __call_usermodehelper+0x65/0x9a
    [] run_workqueue+0x171/0x27e
    [] ? run_workqueue+0x11d/0x27e
    [] ? __call_usermodehelper+0x0/0x9a
    [] worker_thread+0xe8/0x10f
    [] ? autoremove_wake_function+0x0/0x63
    [] ? worker_thread+0x0/0x10f
    [] kthread+0x91/0x99
    [] child_rip+0xa/0x20
    [] ? restore_args+0x0/0x30
    [] ? kthread+0x0/0x99
    [] ? child_rip+0x0/0x20
    Code: 0f 85 99 00 00 00 9c 58 66 66 90 66 90 49 89 c4 fa 66 66 90 66 66 90
    e8 83 34 fb ff e8 d7 e9 26 00 48 98 49 8b 94 c6 10 01 00 00 8b 1a 44
    8b 7a 18 48 85 db 74 0f 8b 42 14 48 8b 04 c3 ff 42
    RIP [] kmem_cache_alloc+0x9a/0x185
    RSP
    CR2: 0000000000000000
    ---[ end trace 42f41a982344e606 ]---

    Reported-by: Ingo Molnar
    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     

14 Sep, 2009

2 commits


17 Aug, 2009

1 commit

  • Convert avc_audit in security/selinux/avc.c to use lsm_audit.h,
    for better maintainability.

    - changed selinux to use common_audit_data instead of
    avc_audit_data
    - eliminated code in avc.c and used code from lsm_audit.h instead.

    Had to add a LSM_AUDIT_NO_AUDIT to lsm_audit.h so that avc_audit
    can call common_lsm_audit and do the pre and post callbacks without
    doing the actual dump. This makes it so that the patched version
    behaves the same way as the unpatched version.

    Also added a denied field to the selinux_audit_data private space,
    once again to make it so that the patched version behaves like the
    unpatched.

    I've tested and confirmed that AVCs look the same before and after
    this patch.

    Signed-off-by: Thomas Liu
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Thomas Liu
     

13 Jul, 2009

2 commits

  • This reverts commit 8113a8d80f4c6a3dc3724b39b470f3fee9c426b6.

    The patch causes a stack overflow on my system during boot.

    Signed-off-by: James Morris

    James Morris
     
  • Convert avc_audit in security/selinux/avc.c to use lsm_audit.h,
    for better maintainability and for less code duplication.

    - changed selinux to use common_audit_data instead of
    avc_audit_data
    - eliminated code in avc.c and used code from lsm_audit.h instead.

    I have tested to make sure that the avcs look the same before and
    after this patch.

    Signed-off-by: Thomas Liu
    Acked-by: Eric Paris
    Signed-off-by: James Morris

    Thomas Liu
     

25 Jun, 2009

1 commit


19 Jun, 2009

1 commit


18 Jun, 2009

1 commit

  • The attached patch adds support to generate audit messages on two cases.

    The first one is a case when a multi-thread process tries to switch its
    performing security context using setcon(3), but new security context is
    not bounded by the old one.

    type=SELINUX_ERR msg=audit(1245311998.599:17): \
    op=security_bounded_transition result=denied \
    oldcontext=system_u:system_r:httpd_t:s0 \
    newcontext=system_u:system_r:guest_webapp_t:s0

    The other one is a case when security_compute_av() masked any permissions
    due to the type boundary violation.

    type=SELINUX_ERR msg=audit(1245312836.035:32): \
    op=security_compute_av reason=bounds \
    scontext=system_u:object_r:user_webapp_t:s0 \
    tcontext=system_u:object_r:shadow_t:s0:c0 \
    tclass=file perms=getattr,open

    Signed-off-by: KaiGai Kohei
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    KaiGai Kohei
     

02 Apr, 2009

1 commit

  • This patch enables applications to handle permissive domain correctly.

    Since the v2.6.26 kernel, SELinux has supported an idea of permissive
    domain which allows certain processes to work as if permissive mode,
    even if the global setting is enforcing mode.
    However, we don't have an application program interface to inform
    what domains are permissive one, and what domains are not.
    It means applications focuses on SELinux (XACE/SELinux, SE-PostgreSQL
    and so on) cannot handle permissive domain correctly.

    This patch add the sixth field (flags) on the reply of the /selinux/access
    interface which is used to make an access control decision from userspace.
    If the first bit of the flags field is positive, it means the required
    access control decision is on permissive domain, so application should
    allow any required actions, as the kernel doing.

    This patch also has a side benefit. The av_decision.flags is set at
    context_struct_compute_av(). It enables to check required permissions
    without read_lock(&policy_rwlock).

    Signed-off-by: KaiGai Kohei
    Acked-by: Stephen Smalley
    Acked-by: Eric Paris
    --
    security/selinux/avc.c | 2 +-
    security/selinux/include/security.h | 4 +++-
    security/selinux/selinuxfs.c | 4 ++--
    security/selinux/ss/services.c | 30 +++++-------------------------
    4 files changed, 11 insertions(+), 29 deletions(-)
    Signed-off-by: James Morris

    KaiGai Kohei
     

14 Feb, 2009

6 commits

  • We do not need O(1) access to the tail of the avc cache lists and so we are
    wasting lots of space using struct list_head instead of struct hlist_head.
    This patch converts the avc cache to use hlists in which there is a single
    pointer from the head which saves us about 4k of global memory.

    Resulted in about a 1.5% decrease in time spent in avc_has_perm_noaudit based
    on oprofile sampling of tbench. Although likely within the noise....

    Signed-off-by: Eric Paris
    Reviewed-by: Paul Moore
    Signed-off-by: James Morris

    Eric Paris
     
  • The code making use of struct avc_cache was not easy to read thanks to liberal
    use of &avc_cache.{slots_lock,slots}[hvalue] throughout. This patch simply
    creates local pointers and uses those instead of the long global names.

    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     
  • It appears there was an intention to have the security server only decide
    certain permissions and leave other for later as some sort of a portential
    performance win. We are currently always deciding all 32 bits of
    permissions and this is a useless couple of branches and wasted space.
    This patch completely drops the av.decided concept.

    This in a 17% reduction in the time spent in avc_has_perm_noaudit
    based on oprofile sampling of a tbench benchmark.

    Signed-off-by: Eric Paris
    Reviewed-by: Paul Moore
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • we are often needlessly jumping through hoops when it comes to avd
    entries in avc_has_perm_noaudit and we have extra initialization and memcpy
    which are just wasting performance. Try to clean the function up a bit.

    This patch resulted in a 13% drop in time spent in avc_has_perm_noaudit in my
    oprofile sampling of a tbench benchmark.

    Signed-off-by: Eric Paris
    Reviewed-by: Paul Moore
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • Currently SELinux code has an atomic which was intended to track how many
    times an avc entry was used and to evict entries when they haven't been
    used recently. Instead we never let this atomic get above 1 and evict when
    it is first checked for eviction since it hits zero. This is a total waste
    of time so I'm completely dropping ae.used.

    This change resulted in about a 3% faster avc_has_perm_noaudit when running
    oprofile against a tbench benchmark.

    Signed-off-by: Eric Paris
    Reviewed by: Paul Moore
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • The avc update node callbacks do not check the seqno of the caller with the
    seqno of the node found. It is possible that a policy change could happen
    (although almost impossibly unlikely) in which a permissive or
    permissive_domain decision is not valid for the entry found. Simply pass
    and check that the seqno of the caller and the seqno of the node found
    match.

    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     

05 Jan, 2009

1 commit

  • I started playing with pahole today and decided to put it against the
    selinux structures. Found we could save a little bit of space on x86_64
    (and no harm on i686) just reorganizing some structs.

    Object size changes:
    av_inherit: 24 -> 16
    selinux_class_perm: 48 -> 40
    context: 80 -> 72

    Admittedly there aren't many of av_inherit or selinux_class_perm's in
    the kernel (33 and 1 respectively) But the change to the size of struct
    context reverberate out a bit. I can get some hard number if they are
    needed, but I don't see why they would be. We do change which cacheline
    context->len and context->str would be on, but I don't see that as a
    problem since we are clearly going to have to load both if the context
    is to be of any value. I've run with the patch and don't seem to be
    having any problems.

    An example of what's going on using struct av_inherit would be:

    form: to:
    struct av_inherit { struct av_inherit {
    u16 tclass; const char **common_pts;
    const char **common_pts; u32 common_base;
    u32 common_base; u16 tclass;
    };

    (notice all I did was move u16 tclass to the end of the struct instead
    of the beginning)

    Memory layout before the change:
    struct av_inherit {
    u16 tclass; /* 2 */
    /* 6 bytes hole */
    const char** common_pts; /* 8 */
    u32 common_base; /* 4 */
    /* 4 byes padding */

    /* size: 24, cachelines: 1 */
    /* sum members: 14, holes: 1, sum holes: 6 */
    /* padding: 4 */
    };

    Memory layout after the change:
    struct av_inherit {
    const char ** common_pts; /* 8 */
    u32 common_base; /* 4 */
    u16 tclass; /* 2 */
    /* 2 bytes padding */

    /* size: 16, cachelines: 1 */
    /* sum members: 14, holes: 0, sum holes: 0 */
    /* padding: 2 */
    };

    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     

31 Oct, 2008

1 commit


30 Oct, 2008

1 commit


29 Oct, 2008

1 commit

  • The iscsi_ibft.c changes are almost certainly a bugfix as the
    pointer 'ip' is a u8 *, so they never print the last 8 bytes
    of the IPv6 address, and the eight bytes they do print have
    a zero byte with them in each 16-bit word.

    Other than that, this should cause no difference in functionality.

    Signed-off-by: Harvey Harrison
    Signed-off-by: David S. Miller

    Harvey Harrison
     

28 Aug, 2008

1 commit

  • The purpose of this patch is to assign per-thread security context
    under a constraint. It enables multi-threaded server application
    to kick a request handler with its fair security context, and
    helps some of userspace object managers to handle user's request.

    When we assign a per-thread security context, it must not have wider
    permissions than the original one. Because a multi-threaded process
    shares a single local memory, an arbitary per-thread security context
    also means another thread can easily refer violated information.

    The constraint on a per-thread security context requires a new domain
    has to be equal or weaker than its original one, when it tries to assign
    a per-thread security context.

    Bounds relationship between two types is a way to ensure a domain can
    never have wider permission than its bounds. We can define it in two
    explicit or implicit ways.

    The first way is using new TYPEBOUNDS statement. It enables to define
    a boundary of types explicitly. The other one expand the concept of
    existing named based hierarchy. If we defines a type with "." separated
    name like "httpd_t.php", toolchain implicitly set its bounds on "httpd_t".

    This feature requires a new policy version.
    The 24th version (POLICYDB_VERSION_BOUNDARY) enables to ship them into
    kernel space, and the following patch enables to handle it.

    Signed-off-by: KaiGai Kohei
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    KaiGai Kohei
     

28 Apr, 2008

1 commit

  • This patch standardized the string auditing interfaces. No userspace
    changes will be visible and this is all just cleanup and consistancy
    work. We have the following string audit interfaces to use:

    void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf, size_t len);

    void audit_log_n_string(struct audit_buffer *ab, const char *buf, size_t n);
    void audit_log_string(struct audit_buffer *ab, const char *buf);

    void audit_log_n_untrustedstring(struct audit_buffer *ab, const char *string, size_t n);
    void audit_log_untrustedstring(struct audit_buffer *ab, const char *string);

    This may be the first step to possibly fixing some of the issues that
    people have with the string output from the kernel audit system. But we
    still don't have an agreed upon solution to that problem.

    Signed-off-by: Eric Paris
    Signed-off-by: Al Viro

    Eric Paris
     

22 Apr, 2008

1 commit

  • The attached patch needs to move from -rt to mainline given preemptable RCU.
    This patch fixes SELinux code that implicitly assumes that disabling
    preemption prevents an RCU grace period from completing, an assumption that
    is valid for Classic RCU, but not necessarily for preemptable RCU. Explicit
    rcu_read_lock() calls are thus added.

    Signed-off-by: Paul E. McKenney
    Acked-by: Steven Rostedt
    Signed-off-by: James Morris

    Paul E. McKenney