]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "capabitlies: ns_capable can use the cap helpers rather than lsm call"
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 17 Jan 2012 18:19:41 +0000 (10:19 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 17 Jan 2012 18:19:41 +0000 (10:19 -0800)
commit7f2d371ec59e944ff26d98187c824bac16de46f5
treeb23ec5a95cd72083227ed5b7396e2f8799f4a58c
parent3c6ccec6c2cef3ba42c9296ece69e8529deab1b5
Revert "capabitlies: ns_capable can use the cap helpers rather than lsm call"

This reverts commit 7ae3e7b2fb536c12e1146449eaa0da91bdc2b46f.

J. R. Okajima explains:

 "After this commit, I am afraid access(2) on NFS may not work
  correctly.  The scenario based upon my guess.
   - access(2) overrides the credentials.
   - calls inode_permission() -- ... -- generic_permission() --
      ns_capable().
   - while the old ns_capable() calls security_capable(current_cred()),
     the new ns_capable() calls has_ns_capability(current) --
     security_capable(__task_cred(t)).

  current_cred() returns current->cred which is effective (overridden)
  credentials, but __task_cred(current) returns current->real_cred (the
  NFSD's credential).  And the overridden credentials by access(2) lost."

Requested-by: J. R. Okajima <hooanon05@yahoo.co.jp>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/capability.c