OpenSolaris

Printable Version Enter a New Search
Bug ID 6558641
Synopsis setauid(2) should audit correct audit id not the argument address
State 10-Fix Delivered (Fix available in build)
Category:Subcategory audit:kernel
Keywords CC_Evaluation
Responsible Engineer Tomas Zeman
Reported Against
Duplicate Of
Introduced In solaris_2.6
Commit to Fix snv_67
Fixed In snv_67
Release Fixed solaris_nevada(snv_67)
Related Bugs
Submit Date 17-May-2007
Last Update Date 13-May-2009
Description
While doing code inspection of copyin() usage in the audit module, I noticed difference in what setauid(2) does and what is audited in aus_auditsys():

$SRC/uts/common/c2/audit_syscalls.c:setauid():

248	if (copyin(auid_p, &auid, sizeof (au_id_t))) {
249		return (EFAULT);
250	}

While in aus_auditsys() the address, not value of the argument is written to the audit trail:
$SRC/uts/common/c2/audit_event.c: aus_auditsys()

2755	case AUE_SETAUID:
2756		au_uwrite(au_to_arg32(2, "setauid", (uint32_t)a1));

This is consistent with the following audit records generated by auditconfig -setauid and auditconfig -setaudit:

bash-3.00# auditconfig -setauid 1 auditconfig -getaudit
audit id = daemon(1)
process preselection mask = all(0xffffffff,0xffffffff)
terminal id (maj,min,host) = 10545,5632,car-not(10.6.39.105)
audit session id = 2756141207

produces:

header,111,2,setauid(2),sp,snare,2007-05-17 01:16:20.825 -07:00
argument,2,0x8047d80,setauid
subject,daemon,root,root,root,root,100887,2756141207,10545 5632 car-not
use of privilege,successful use of priv,sys_audit
return,success,0


bash-3.00# auditconfig -setaudit 1 all 10545,5632,10.6.39.105 1234 auditconfig -getaudit
audit id = daemon(1)
process preselection mask = all(0xffffffff,0xffffffff)
terminal id (maj,min,host) = 10545,5632,car-not(10.6.39.105)
audit session id = 1234

produces:
header,194,2,setaudit_addr(2),sp,snare,2007-05-17 01:20:54.866 -07:00
argument,1,0x1,auid
argument,1,0xa4c41600,port
argument,1,0x4,type
ip address,car-not
argument,1,0xffffffff,as_success
argument,1,0xffffffff,as_failure
argument,1,0x4d2,asid
subject,daemon,root,root,root,root,100900,1234,10545 5632 car-not
use of privilege,successful use of priv,sys_audit
return,success,0

Note in the second case auid is audited correctly as daemon(1) while in the first case address of the argument is written, not value of 1.

bsmrecord(1m) tells "audit user ID" for both cases.
Work Around
N/A
Comments
N/A