]> git.baikalelectronics.ru Git - kernel.git/commit
smackfs: do not trust `count' in inodes write()s
authorAhmed S. Darwish <darwish.07@gmail.com>
Thu, 13 Mar 2008 19:32:34 +0000 (12:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Mar 2008 20:11:43 +0000 (13:11 -0700)
commit8cf6976919c48b10135b7acdae0da4b0bb49829c
tree17b6084b29434a968f787e238548a843126e2ec3
parentcd029e45a485cb7b06583bcd65f6601a044d8d3c
smackfs: do not trust `count' in inodes write()s

Smackfs write() implementation does not put a higher bound on the number of
bytes to copy from user-space.  This may lead to a DOS attack if a malicious
`count' field is given.

Assure that given `count' is exactly the length needed for a /smack/load rule.
 In case of /smack/cipso where the length is relative, assure that `count'
does not exceed the size needed for a buffer representing maximum possible
number of CIPSO 2.2 categories.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
security/smack/smack.h
security/smack/smackfs.c