1. 08 10月, 2016 1 次提交
    • A
      cred: simpler, 1D supplementary groups · 81243eac
      Alexey Dobriyan 提交于
      Current supplementary groups code can massively overallocate memory and
      is implemented in a way so that access to individual gid is done via 2D
      array.
      
      If number of gids is <= 32, memory allocation is more or less tolerable
      (140/148 bytes).  But if it is not, code allocates full page (!)
      regardless and, what's even more fun, doesn't reuse small 32-entry
      array.
      
      2D array means dependent shifts, loads and LEAs without possibility to
      optimize them (gid is never known at compile time).
      
      All of the above is unnecessary.  Switch to the usual
      trailing-zero-len-array scheme.  Memory is allocated with
      kmalloc/vmalloc() and only as much as needed.  Accesses become simpler
      (LEA 8(gi,idx,4) or even without displacement).
      
      Maximum number of gids is 65536 which translates to 256KB+8 bytes.  I
      think kernel can handle such allocation.
      
      On my usual desktop system with whole 9 (nine) aux groups, struct
      group_info shrinks from 148 bytes to 44 bytes, yay!
      
      Nice side effects:
      
       - "gi->gid[i]" is shorter than "GROUP_AT(gi, i)", less typing,
      
       - fix little mess in net/ipv4/ping.c
         should have been using GROUP_AT macro but this point becomes moot,
      
       - aux group allocation is persistent and should be accounted as such.
      
      Link: http://lkml.kernel.org/r/20160817201927.GA2096@p183.telecom.bySigned-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Vasily Kulikov <segoon@openwall.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      81243eac
  2. 16 4月, 2015 1 次提交
  3. 10 12月, 2014 1 次提交
  4. 06 12月, 2014 1 次提交
    • E
      groups: Consolidate the setgroups permission checks · 7ff4d90b
      Eric W. Biederman 提交于
      Today there are 3 instances of setgroups and due to an oversight their
      permission checking has diverged.  Add a common function so that
      they may all share the same permission checking code.
      
      This corrects the current oversight in the current permission checks
      and adds a helper to avoid this in the future.
      
      A user namespace security fix will update this new helper, shortly.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      7ff4d90b
  5. 04 4月, 2014 1 次提交
  6. 31 8月, 2013 1 次提交
  7. 03 5月, 2012 2 次提交
  8. 31 10月, 2011 1 次提交
  9. 24 3月, 2011 1 次提交
  10. 10 9月, 2010 1 次提交
  11. 12 4月, 2010 1 次提交
  12. 17 6月, 2009 1 次提交