Skip to contentSkip to conversation

Don't crash on unknown S_IFMT file modes

PATCH Applied Miloslav Trmac 3 participants 3 messages Mar 26, 2009 – Apr 6, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't crash on unknown S_IFMT file modes

Hello,
ausearch -i and libauparse currently crash (access NULL) if a mode= field contains an unknown file type. Such records are generated by the kernel for IPC, e.g.

    node=jcdx156 type=IPC msg=audit(1237915952.720:2294): ouid=500 ogid=1106 mode=0600 obj=siterep_u:siterep_r:siterep_t:s0-s15:c0.c1023

The attached patch:
* Modifies ausearch and libauparse to output the file format in octal if it is unknown.
* Modifies libauparse to use the same interpreted field format as ausearch (without a space in the middle).
* Modifies comma handling in libauparse to avoid a strcat() call.

Mirek

#1 lore raw
Quoted 11 lines · Miloslav Trmac

Hello,
ausearch -i and libauparse currently crash (access NULL) if a mode= field contains an unknown file type. Such records are generated by the kernel for IPC, e.g.

    node=jcdx156 type=IPC msg=audit(1237915952.720:2294): ouid=500 ogid=1106 mode=0600 obj=siterep_u:siterep_r:siterep_t:s0-s15:c0.c1023

The attached patch:
* Modifies ausearch and libauparse to output the file format in octal if it is unknown.
* Modifies libauparse to use the same interpreted field format as ausearch (without a space in the middle).
* Modifies comma handling in libauparse to avoid a strcat() call.

Mirek

Mirek,

Thank you for this patch...wherever it may be.
:)
I really appreciate you fixing this!

Do you have a standard auparse test you use to track these down? If so, does it use auparse_feed?

Thanks again,
LCB.

Signature · 2 lines
LC (Lenny) Bruzenak
[email protected]
Applied
#2 lore raw
In reply to Miloslav Trmac
Quoted 5 lines · Miloslav Trmac

The attached patch:
* Modifies ausearch and libauparse to output the file format in octal if it is unknown. * Modifies libauparse to use the same interpreted field format as ausearch (without a space in the middle). * Modifies comma handling in libauparse to avoid a strcat() call.

Applied.

-Steve