Commit bdd481f
audit: fix suffixed '/' filename matching in __audit_inode_child()
When the user specifies a directory to delete with the suffix '/',
the audit record fails to collect the filename, resulting in the
following logs:
type=PATH msg=audit(10/30/2024 14:11:17.796:6304) : item=2 name=(null)
type=PATH msg=audit(10/30/2024 14:11:17.796:6304) : item=1 name=(null)
It happens because the value of the variables dname, and n->name->name
in __audit_inode_child() differ only by the suffix '/'. This commit
treats this corner case by cleaning the input and passing the correct
filename to audit_compare_dname_path().
Steps to reproduce the issue:
# auditctl -w /tmp
$ mkdir /tmp/foo
$ rm -r /tmp/foo/ or rmdir /tmp/foo/
# ausearch -i | grep PATH | tail -3
This patch is based on a GitHub patch/PR by user @hqh2010.
linux-audit/audit-kernel#148
Signed-off-by: Ricardo Robaina <rrobaina@redhat.com>1 parent 89282be commit bdd481f
1 file changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2419 | 2419 | | |
2420 | 2420 | | |
2421 | 2421 | | |
2422 | | - | |
| 2422 | + | |
| 2423 | + | |
2423 | 2424 | | |
2424 | 2425 | | |
2425 | 2426 | | |
| |||
2443 | 2444 | | |
2444 | 2445 | | |
2445 | 2446 | | |
| 2447 | + | |
2446 | 2448 | | |
2447 | 2449 | | |
2448 | 2450 | | |
2449 | 2451 | | |
2450 | 2452 | | |
2451 | 2453 | | |
2452 | 2454 | | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
2453 | 2466 | | |
2454 | 2467 | | |
2455 | | - | |
| 2468 | + | |
2456 | 2469 | | |
2457 | 2470 | | |
2458 | 2471 | | |
2459 | 2472 | | |
2460 | 2473 | | |
2461 | 2474 | | |
| 2475 | + | |
2462 | 2476 | | |
2463 | 2477 | | |
2464 | 2478 | | |
| |||
0 commit comments