]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
SELinux: properly handle empty tty_files list
authorEric Paris <eparis@redhat.com>
Fri, 31 Oct 2008 21:40:00 +0000 (17:40 -0400)
committerJames Morris <jmorris@namei.org>
Fri, 31 Oct 2008 22:38:48 +0000 (09:38 +1100)
SELinux has wrongly (since 2004) had an incorrect test for an empty
tty->tty_files list.  With an empty list selinux would be pointing to part
of the tty struct itself and would then proceed to dereference that value
and again dereference that result.  An F10 change to plymouth on a ppc64
system is actually currently triggering this bug.  This patch uses
list_empty() to handle empty lists rather than looking at a meaningless
location.

[note, this fixes the oops reported in
https://bugzilla.redhat.com/show_bug.cgi?id=469079]

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>

No differences found