1. Jun 21, 2019
    • Sebastian Andrzej Siewior's avatar
      apparmor: Use a memory pool instead per-CPU caches · df323337
      Sebastian Andrzej Siewior authored
      
      
      The get_buffers() macro may provide one or two buffers to the caller.
      Those buffers are pre-allocated on init for each CPU. By default it
      allocates
      	2* 2 * MAX_PATH * POSSIBLE_CPU
      
      which equals 64KiB on a system with 4 CPUs or 1MiB with 64 CPUs and so
      on.
      
      Replace the per-CPU buffers with a common memory pool which is shared
      across all CPUs. The pool grows on demand and never shrinks. The pool
      starts with two (UP) or four (SMP) elements. By using this pool it is
      possible to request a buffer and keeping preemption enabled which avoids
      the hack in profile_transition().
      
      It has been pointed out by Tetsuo Handa that GFP_KERNEL allocations for
      small amount of memory do not fail. In order not to have an endless
      retry, __GFP_RETRY_MAYFAIL is passed (so the memory allocation is not
      repeated until success) and retried once hoping that in the meantime a
      buffer has been returned to the pool. Since now NULL is possible all
      allocation paths check the buffer pointer and return -ENOMEM on failure.
      
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
      df323337
    • Bharath Vedartham's avatar
      apparmor: Force type-casting of current->real_cred · bf1d2ee7
      Bharath Vedartham authored
      
      
      This patch fixes the sparse warning:
      warning: cast removes address space '<asn:4>' of expression.
      
      Signed-off-by: default avatarBharath Vedartham <linux.bhar@gmail.com>
      Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
      bf1d2ee7
  2. Apr 17, 2019
  3. Apr 12, 2019
  4. Apr 11, 2019
  5. Apr 10, 2019
  6. Apr 09, 2019