Skip to content
Commit 86dc9693 authored by Mickaël Salaün's avatar Mickaël Salaün Committed by Paul Moore
Browse files

selinux: fix lsm_get_self_attr()

selinux_getselfattr() doesn't properly initialize the string pointer
it passes to selinux_lsm_getattr() which can cause a problem when an
attribute hasn't been explicitly set; selinux_lsm_getattr() returns
0/success, but does not set or initialize the string label/attribute.
Failure to properly initialize the string causes problems later in
selinux_getselfattr() when the function attempts to kfree() the
string.

Cc: Casey Schaufler <casey@schaufler-ca.com>
Fixes: 762c9343

 ("SELinux: Add selfattr hooks")
Suggested-by: default avatarPaul Moore <paul@paul-moore.com>
[PM: description changes as discussed in the thread]
Signed-off-by: default avatarMickaël Salaün <mic@digikod.net>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent d8bdd795
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment