lkml.org 
[lkml]   [2012]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v17 09/15] seccomp: remove duplicated failure logging
    From
    On Fri, Apr 6, 2012 at 4:14 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
    > On Thu, 29 Mar 2012 15:01:54 -0500
    > Will Drewry <wad@chromium.org> wrote:
    >
    >> From: Kees Cook <keescook@chromium.org>
    >>
    >> This consolidates the seccomp filter error logging path and adds more
    >> details to the audit log.
    >>
    >> ...
    >>
    >> --- a/include/linux/audit.h
    >> +++ b/include/linux/audit.h
    >>
    >> ...
    >>
    >>  #define audit_inode(n,d) do { (void)(d); } while (0)
    >>  #define audit_inode_child(i,p) do { ; } while (0)
    >>  #define audit_core_dumps(i) do { ; } while (0)
    >> -#define audit_seccomp(i) do { ; } while (0)
    >> +#define audit_seccomp(i,s,c) do { ; } while (0)
    >
    > Sigh.  Someone please convert all these to C.  That way we get
    > typechecking and don't need dopey party tricks like that "(void)(d)" to
    > squish compilation warnings.
    >
    >> ...
    >> --- a/kernel/auditsc.c
    >> +++ b/kernel/auditsc.c
    >> @@ -67,6 +67,7 @@
    >>  #include <linux/syscalls.h>
    >>  #include <linux/capability.h>
    >>  #include <linux/fs_struct.h>
    >> +#include <linux/compat.h>
    >>
    >>  #include "audit.h"
    >>
    >> @@ -2710,13 +2711,18 @@ void audit_core_dumps(long signr)
    >>       audit_log_end(ab);
    >>  }
    >>
    >> -void __audit_seccomp(unsigned long syscall)
    >> +void __audit_seccomp(unsigned long syscall, long signr, int code)
    >>  {
    >>       struct audit_buffer *ab;
    >>
    >>       ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_ANOM_ABEND);
    >> -     audit_log_abend(ab, "seccomp", SIGKILL);
    >> +     audit_log_abend(ab, "seccomp", signr);
    >>       audit_log_format(ab, " syscall=%ld", syscall);
    >> +#ifdef CONFIG_COMPAT
    >> +     audit_log_format(ab, " compat=%d", is_compat_task());
    >> +#endif
    >
    > We don't need the ifdef for compilation reasons now.
    >
    > The question is: should we emit the compat= record on
    > non-compat-capable architectures?  Doing so would be safer - making it
    > conditional invites people to write x86-only usersapce.

    I'd certainly prefer it always being there for exactly that reason.

    Kees, Eric, any preferences? Unless I hear one, I'll just drop the
    ifdefs in the next revision.

    thanks!
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-04-09 21:29    [W:5.946 / U:1.760 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site