Skip to contentSkip to conversation

Null pointer dereference in mls_compute_sid()

next Eric Paris 2 participants 2 messages Mar 22, 2012 1 message not in the archive SELinux security module

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Eric Paris

author
#1 lore raw

It should be fixed in today's linux-next! I'm so sorry about that!

Quoted 24 lines · Martin Nyhus

Hi,

while running next-20120321 the class passed in to mls_compute_sid() (tclass) is sometimes 0 which leads to a read from policydb.class_val_to_struct[-1] causing a null pointer dereference when cladatum is used (at mls.c:535).

The crash happens on every boot, just after mounting the filesystem.

Calltrace:
security_compute_sid.part.7
security_compute_sid
security_transition_sid_user
? security_context_to_sid
sel_write_create
? might_fault
? _raw_spin_unlock
? sel_write_member
selinux_transaction_write
vfs_write
sys_write
system_call_fastpath

Quoted 1 line

Martin Nyhus

--
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.

#2 lore raw

I'd still be concerned about why a class value of 0 is getting passed from userspace. Bug in systemd or libselinux?

Quoted 35 lines · Eric Paris

It should be fixed in today's linux-next! I'm so sorry about that!

Quoted 24 lines · Martin Nyhus

Hi,

while running next-20120321 the class passed in to mls_compute_sid() (tclass) is sometimes 0 which leads to a read from policydb.class_val_to_struct[-1] causing a null pointer dereference when cladatum is used (at mls.c:535).

The crash happens on every boot, just after mounting the filesystem.

Calltrace:
security_compute_sid.part.7
security_compute_sid
security_transition_sid_user
? security_context_to_sid
sel_write_create
? might_fault
? _raw_spin_unlock
? sel_write_member
selinux_transaction_write
vfs_write
sys_write
system_call_fastpath

Quoted 1 line

Martin Nyhus

--
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.

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.