selinux: change handling of invalid classes (Was: Re: 2.6.26-rc5-mm1 selinux whine)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 selinux: change handling of invalid classes (Was: Re: 2.6.26-rc5-mm1 selinux whine)
Quoted 8 lines · Andrew Morton
Getting a few of these with FC5:
SELinux:
context_struct_compute_av: unrecognized class 69
SELinux:context_struct_compute_av: unrecognized class 69one came out when I logged in.
No other symptoms, yet.
Change handling of invalid classes by SELinux, reporting class values unknown to the kernel as errors (w/ ratelimit applied) and handling class values unknown to policy as normal denials.
---
security/selinux/ss/services.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
security/selinux/ss/services.c +13 -3
@@ -408,9 +408,19 @@ static int context_struct_compute_av(struct context *scontext,return 0 ; inval_class: -printk (KERN_ERR "SELinux: %s: unrecognized class %d\n" , __func__, - tclass); -return -EINVAL ; +if (!tclass || tclass > kdefs->cts_len || + !kdefs->class_to_string[tclass]) { +if (printk_ratelimit ()) +printk (KERN_ERR "SELinux: %s: unrecognized class %d\n" , + __func__, tclass); +return -EINVAL ; + } + +/* +* Known to the kernel, but not to the policy. +* Handle as a denial (allowed is 0). +*/ +return 0 ; }/*
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 8 lines · Stephen Smalley
Quoted 7 lines · Andrew Morton
Getting a few of these with FC5:
SELinux:
context_struct_compute_av: unrecognized class 69
SELinux:context_struct_compute_av: unrecognized class 69one came out when I logged in.
Quoted 7 lines
Quoted 1 line
No other symptoms, yet.
Change handling of invalid classes by SELinux, reporting class values unknown to the kernel as errors (w/ ratelimit applied) and handling class values unknown to policy as normal denials.
Signed-off-by Stephen Smalley <[email protected]>
Quoted 24 lines
---
security/selinux/ss/services.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)security/selinux/ss/services.c +6
-3@@ -408,9 +408,19 @@ static int context_struct_compute_av(struct context *scontext,return 0 ; inval_class: -printk (KERN_ERR "SELinux: %s: unrecognized class %d\n" , __func__, - tclass); -return -EINVAL ; +if (!tclass || tclass > kdefs->cts_len || + !kdefs->class_to_string[tclass]) { +if (printk_ratelimit ()) +printk (KERN_ERR "SELinux: %s: unrecognized class %d\n" , + __func__, tclass); +return -EINVAL ;
security/selinux/ss/services.c static int context_struct_compute_av(struct context *scontext, · line 426
Quoted 10 lines
security/selinux/ss/services.c +7
-0+ } + +/* +* Known to the kernel, but not to the policy. +* Handle as a denial (allowed is 0). +*/ +return 0 ; }/*
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
James Morris
AppliedApplied.
Signature · 7 lines
James Morris <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.