]> git.baikalelectronics.ru Git - kernel.git/commit
security: cap_inode_getsecctx returning garbage
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 8 May 2013 22:05:41 +0000 (18:05 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 13 May 2013 14:11:46 +0000 (10:11 -0400)
commitd836a1f978bb3df17f741753789d5e5d4bcddb65
tree3452717e0d811102b87ad71e9039df39cf7ef112
parent6fd3f7a2b0b096face704312d788269e40a698ba
security: cap_inode_getsecctx returning garbage

We shouldn't be returning success from this function without also
filling in the return values ctx and ctxlen.

Note currently this doesn't appear to cause bugs since the only
inode_getsecctx caller I can find is fs/sysfs/inode.c, which only calls
this if security_inode_setsecurity succeeds.  Assuming
security_inode_setsecurity is set to cap_inode_setsecurity whenever
inode_getsecctx is set to cap_inode_getsecctx, this function can never
actually called.

So I noticed this only because the server labeled NFS patches add a real
caller.

Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
security/capability.c