1. 02 8月, 2010 19 次提交
  2. 22 5月, 2010 1 次提交
  3. 17 5月, 2010 1 次提交
  4. 29 4月, 2010 1 次提交
    • S
      selinux: generalize disabling of execmem for plt-in-heap archs · fcaaade1
      Stephen Smalley 提交于
      On Tue, 2010-04-27 at 11:47 -0700, David Miller wrote:
      > From: "Tom \"spot\" Callaway" <tcallawa@redhat.com>
      > Date: Tue, 27 Apr 2010 14:20:21 -0400
      >
      > > [root@apollo ~]$ cat /proc/2174/maps
      > > 00010000-00014000 r-xp 00000000 fd:00 15466577
      > >  /sbin/mingetty
      > > 00022000-00024000 rwxp 00002000 fd:00 15466577
      > >  /sbin/mingetty
      > > 00024000-00046000 rwxp 00000000 00:00 0
      > >  [heap]
      >
      > SELINUX probably barfs on the executable heap, the PLT is in the HEAP
      > just like powerpc32 and that's why VM_DATA_DEFAULT_FLAGS has to set
      > both executable and writable.
      >
      > You also can't remove the CONFIG_PPC32 ifdefs in selinux, since
      > because of the VM_DATA_DEFAULT_FLAGS setting used still in that arch,
      > the heap will always have executable permission, just like sparc does.
      > You have to support those binaries forever, whether you like it or not.
      >
      > Let's just replace the CONFIG_PPC32 ifdef in SELINUX with CONFIG_PPC32
      > || CONFIG_SPARC as in Tom's original patch and let's be done with
      > this.
      >
      > In fact I would go through all the arch/ header files and check the
      > VM_DATA_DEFAULT_FLAGS settings and add the necessary new ifdefs to the
      > SELINUX code so that other platforms don't have the pain of having to
      > go through this process too.
      
      To avoid maintaining per-arch ifdefs, it seems that we could just
      directly use (VM_DATA_DEFAULT_FLAGS & VM_EXEC) as the basis for deciding
      whether to enable or disable these checks.   VM_DATA_DEFAULT_FLAGS isn't
      constant on some architectures but instead depends on
      current->personality, but we want this applied uniformly.  So we'll just
      use the initial task state to determine whether or not to enable these
      checks.
      Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      fcaaade1
  5. 28 4月, 2010 1 次提交
  6. 21 4月, 2010 1 次提交
  7. 15 4月, 2010 1 次提交
  8. 09 4月, 2010 1 次提交
  9. 08 4月, 2010 1 次提交
  10. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  11. 16 3月, 2010 1 次提交
  12. 08 3月, 2010 1 次提交
  13. 04 3月, 2010 1 次提交
  14. 03 3月, 2010 2 次提交
  15. 26 2月, 2010 1 次提交
  16. 25 2月, 2010 1 次提交
  17. 24 2月, 2010 1 次提交
    • W
      Security: add static to security_ops and default_security_ops variable · 189b3b1c
      wzt.wzt@gmail.com 提交于
      Enhance the security framework to support resetting the active security
      module. This eliminates the need for direct use of the security_ops and
      default_security_ops variables outside of security.c, so make security_ops
      and default_security_ops static. Also remove the secondary_ops variable as
      a cleanup since there is no use for that. secondary_ops was originally used by
      SELinux to call the "secondary" security module (capability or dummy),
      but that was replaced by direct calls to capability and the only
      remaining use is to save and restore the original security ops pointer
      value if SELinux is disabled by early userspace based on /etc/selinux/config.
      Further, if we support this directly in the security framework, then we can
      just use &default_security_ops for this purpose since that is now available.
      Signed-off-by: NZhitong Wang <zhitong.wangzt@alibaba-inc.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      189b3b1c
  18. 22 2月, 2010 1 次提交
  19. 16 2月, 2010 1 次提交
  20. 09 2月, 2010 1 次提交
    • X
      selinux: fix memory leak in sel_make_bools · 8007f102
      Xiaotian Feng 提交于
      In sel_make_bools, kernel allocates memory for bool_pending_names[i]
      with security_get_bools. So if we just free bool_pending_names, those
      memories for bool_pending_names[i] will be leaked.
      
      This patch resolves dozens of following kmemleak report after resuming
      from suspend:
      unreferenced object 0xffff88022e4c7380 (size 32):
        comm "init", pid 1, jiffies 4294677173
        backtrace:
          [<ffffffff810f76b5>] create_object+0x1a2/0x2a9
          [<ffffffff810f78bb>] kmemleak_alloc+0x26/0x4b
          [<ffffffff810ef3eb>] __kmalloc+0x18f/0x1b8
          [<ffffffff811cd511>] security_get_bools+0xd7/0x16f
          [<ffffffff811c48c0>] sel_write_load+0x12e/0x62b
          [<ffffffff810f9a39>] vfs_write+0xae/0x10b
          [<ffffffff810f9b56>] sys_write+0x4a/0x6e
          [<ffffffff81011b82>] system_call_fastpath+0x16/0x1b
          [<ffffffffffffffff>] 0xffffffffffffffff
      Signed-off-by: NXiaotian Feng <dfeng@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      8007f102
  21. 05 2月, 2010 1 次提交