linux/security
José Bollo 9598f4c9e7 SMACK: Fix handling value==NULL in post setxattr
The function `smack_inode_post_setxattr` is called each
time that a setxattr is done, for any value of name.
The kernel allow to put value==NULL when size==0
to set an empty attribute value. The systematic
call to smk_import_entry was causing the dereference
of a NULL pointer hence a KERNEL PANIC!

The problem can be produced easily by issuing the
command `setfattr -n user.data file` under bash prompt
when SMACK is active.

Moving the call to smk_import_entry as proposed by this
patch is correcting the behaviour because the function
smack_inode_post_setxattr is called for the SMACK's
attributes only if the function smack_inode_setxattr validated
the value and its size (what will not be the case when size==0).

It also has a benefical effect to not fill the smack hash
with garbage values coming from any extended attribute
write.

Change-Id: Iaf0039c2be9bccb6cee11c24a3b44d209101fe47
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
2014-04-11 14:35:05 -07:00
..
apparmor security: replace strict_strto*() with kstrto*() 2014-02-06 19:11:04 +11:00
integrity evm: enable key retention service automatically 2014-03-07 12:15:49 -05:00
keys security: replace strict_strto*() with kstrto*() 2014-02-06 19:11:04 +11:00
selinux selinux: correctly label /proc inodes in use before the policy is loaded 2014-03-19 16:46:18 -04:00
smack SMACK: Fix handling value==NULL in post setxattr 2014-04-11 14:35:05 -07:00
tomoyo
yama
capability.c security: have cap_dentry_init_security return error 2014-03-07 11:50:01 +11:00
commoncap.c capabilities: allow nice if we are privileged 2013-08-30 23:44:09 -07:00
device_cgroup.c device_cgroup: remove can_attach 2013-10-24 06:56:56 -04:00
inode.c
Kconfig
lsm_audit.c Merge git://git.infradead.org/users/eparis/audit 2013-11-21 19:18:14 -08:00
Makefile security: cleanup Makefiles to use standard syntax for specifying sub-directories 2014-02-17 11:08:04 +11:00
min_addr.c
security.c Linux 3.12 2013-11-26 17:32:55 -05:00