Kernel provides incomplete audit information when an existing monitored file is modified
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | linux (Ubuntu) |
Undecided
|
Gavin Guo | ||
| | Trusty |
Undecided
|
Unassigned | ||
| | Utopic |
Undecided
|
Unassigned | ||
| | Vivid |
Undecided
|
Gavin Guo | ||
Bug Description
[Impact]
The audit system cannot identify the correct path of the monitored file.
The trusty kernel and utopic kernel both suffer the bug.
root@node-7:~# echo "lalala" >> /etc/testfile
"sudo tail -f /var/log/
<14>Jan 15 11:38:24 node-7 audispd: node=node-7 type=SYSCALL msg=audit(
<14>Jan 15 11:38:24 node-7 audispd: node=node-7 type=CWD msg=audit(
<14>Jan 15 11:38:24 node-7 audispd: node=node-7 type=PATH msg=audit(
<14>Jan 15 11:38:24 node-7 audispd: node=node-7 type=PATH msg=audit(
<14>Jan 15 11:38:24 node-7 audispd: node=node-7 type=PATH msg=audit(
<14>Jan 15 11:38:24 node-7 audispd: node=node-7 type=EOE msg=audit(
the file modified is referenced only by inode : 1582123
With non-buggy kernel (e.g. 3.2.0-72-generic) the output is:
root@atlas:/tmp# echo "lalal" >> /etc/testfile
"sudo tail -f /var/log/
Jan 15 11:40:36 localhost audispd: node=atlas type=SYSCALL msg=audit(
Jan 15 11:40:36 localhost audispd: node=atlas type=CWD msg=audit(
Jan 15 11:40:36 localhost audispd: node=atlas type=PATH msg=audit(
Jan 15 11:40:36 localhost audispd: node=atlas type=EOE msg=audit(
[Fix]
commit 4a92843601ad0f5
Author: Paul Moore <email address hidden>
Date: Mon Dec 22 12:27:39 2014 -0500
audit: correctly record file names with different path name types
There is a problem with the audit system when multiple audit records
are created for the same path, each with a different path name type.
The root cause of the problem is in __audit_inode() when an exact
match (both the path name and path name type) is not found for a
path name record; the existing code creates a new path name record,
but it never sets the path name in this record, leaving it NULL.
This patch corrects this problem by assigning the path name to these
newly created records.
There are many ways to reproduce this problem, but one of the
easiest is the following (assuming auditd is running):
# mkdir /root/tmp/test
# touch /root/tmp/test/567
# auditctl -a always,exit -F dir=/root/tmp/test
# touch /root/tmp/test/567
Afterwards, or while the commands above are running, check the audit
log and pay special attention to the PATH records. A faulty kernel
will display something like the following for the file creation:
type=SYSCALL msg=audit(
success=yes exit=3 ... comm="touch" exe="/usr/
type=CWD msg=audit(
type=PATH msg=audit(
type=PATH msg=audit(
type=PATH msg=audit(
While a patched kernel will show the following:
type=SYSCALL msg=audit(
success=yes exit=3 ... comm="touch" exe="/usr/
type=CWD msg=audit(
type=PATH msg=audit(
type=PATH msg=audit(
This issue was brought up by a number of people, but special credit
should go to <email address hidden> for reporting the problem along
with an explanation of the problem and a patch. While the original
patch did have some problems (see the archive link below), it did
demonstrate the problem and helped kickstart the fix presented here.
* https:/
Reported-by: hujianyang <email address hidden>
Signed-off-by: Paul Moore <email address hidden>
Acked-by: Richard Guy Briggs <email address hidden>
$ git describe --contains 4a92843601ad0f5
v3.19-rc2~7^2~1
[Test case]
- Install any one of the kernel from 3.13 ~ 3.19rc2
- sudo apt-get install -y auditd
- sudo vim /etc/audit/
-D
-b 1024
-w /etc/ -p wa -k system_
-w /usr/bin -p wa -k system_
-w /usr/sbin -p wa -k system_
-w /bin/ -p wa -k system_
-w /usr/bin/sudo -F auid!=nova -F uid!=nova -F auid!=neutron -F uid!=neutron -F auid!=cinder -F uid!=cinder -F auid!=zabbix -F uid!=zabbix -p x -k privilege_
-w /bin/su -p x -k privilege_
-w /bin/mount -p x -k filesystem_
-w /bin/umount -p x -k filesystem_
-w /bin/chown -p x -k filesystem_
-w /bin/chgrp -p x -k filesystem_
-w /bin/chmod -p x -k filesystem_
-w /var/log -p wra -F auid>10000 -F auid!=4294967295 -k system_logs_access
-a always,exit -F auid>10000 -F auid!=4294967295 -F arch=b64 -S clock_settime -k time-change_syscall
-a always,exit -F auid>10000 -F auid!=4294967295 -F arch=b32 -S clock_settime -k time-change_syscall
-a always,exit -F auid>10000 -F auid!=4294967295 -F arch=b64 -S chroot -S mount -S umount2 -k filesystem_
-a always,exit -F auid>10000 -F auid!=4294967295 -F arch=b32 -S chroot -S mount -S umount2 -k filesystem_
-a always,exit -F auid>10000 -F auid!=4294967295 -F arch=b64 -S kill -S tkill -S tgkill -k process_
-a always,exit -F auid>10000 -F auid!=4294967295 -F arch=b32 -S kill -S tkill -S tgkill -k process_
-a always,exit -F auid>10000 -F auid!=4294967295 -F arch=b64 -S sethostname -S setdomainname -k system-locale
-a always,exit -F auid>10000 -F auid!=4294967295 -F arch=b32 -S sethostname -S setdomainname -k system-locale
-a exit,always -F auid>10000 -F auid!=4294967295 -F arch=b64 -S execve -k audit_trail
-a exit,always -F auid>10000 -F auid!=4294967295 -F arch=b32 -S execve -k audit_trail
- sudo vim /etc/audit/
log_format = RAW
priority_boost = 3
disp_qos = lossless
dispatcher = /sbin/audispd
name_format = hostname
space_left = 75
space_left_action = SYSLOG
action_mail_acct = root
admin_space_left = 50
admin_space_
disk_full_action = SYSLOG
disk_error_action = SYSLOG
- sudo su
- # echo "lalala" >> /etc/testfile
- Open another console: $ sudo tail -f /var/log/
| Changed in linux (Ubuntu): | |
| assignee: | nobody → Gavin Guo (mimi0213kimo) |
| Changed in linux (Ubuntu): | |
| status: | New → Incomplete |
| tags: | added: precise |
| Gavin Guo (mimi0213kimo) wrote : | #2 |
Test of the following kernel fail:
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
Success:
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
Bisect process:
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
linux-image-
Tue Mar 31 17:58:38 gavin@gavin-
66b3f4f0a0fcc19
041d7b98ffe59c5
4a92843601ad0f5
54dc77d974a5014
3640dcfa4fd00cd
solution:
commit 4a92843601ad0f5
Author: Paul Moore <email address hidden>
Date: Mon Dec 22 12:27:39 2014 -0500
audit: correctly record file names with different path name types
| Changed in linux (Ubuntu Trusty): | |
| status: | New → Fix Committed |
| Changed in linux (Ubuntu Utopic): | |
| status: | New → Fix Committed |
| Changed in linux (Ubuntu Vivid): | |
| status: | Incomplete → Fix Released |
| Brad Figg (brad-figg) wrote : | #3 |
This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-
If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.
See https:/
| tags: | added: verification-needed-trusty |
| tags: | added: verification-needed-utopic |
| Brad Figg (brad-figg) wrote : | #4 |
This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-
If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.
See https:/
| tags: |
added: verification-done-trusty removed: verification-needed-trusty |
| tags: |
added: verification-done-utopic removed: verification-needed-utopic |
| Launchpad Janitor (janitor) wrote : | #5 |
This bug was fixed in the package linux - 3.16.0-36.48
---------------
linux (3.16.0-36.48) utopic; urgency=low
[ Luis Henriques ]
* Release Tracking Bug
- LP: #1443946
* Merged back Ubuntu-3.16.0-34.47 security release
linux (3.16.0-35.46) utopic; urgency=low
[ Brad Figg ]
* Release Tracking Bug
- LP: #1442324
[ Andy Whitcroft ]
* [Config] CONFIG_
- LP: #1418140
[ Chris J Arges ]
* [Config] CONFIG_
- LP: #1398544
[ dann frazier ]
* [Config] CONFIG_
- LP: #1441291
[ Upstream Kernel Changes ]
* Revert "USB: serial: make bulk_out_size a lower limit"
- LP: #1441317
* Revert "i2c: core: Dispose OF IRQ mapping at client removal time"
- LP: #1441317
* Revert "net: cx82310_eth: use common match macro"
- LP: #1441317
* KEYS: request_key() should reget expired keys rather than give
EKEYEXPIRED
- LP: #1124250
* drm/i915/bdw: 3D_CHICKEN3 has write mask bits
- LP: #1374389
* drm/i915: call lpt_init_
- LP: #1374389
* drm/i915/bdw: Apply workarounds in render ring init function
- LP: #1374389
* drm/i915/bdw: Cleanup pre prod workarounds
- LP: #1374389
* drm/i915: Refactor Broadwell PIPE_CONTROL emission into a helper.
- LP: #1374389
* drm/i915: Add the WaCsStallBefore
- LP: #1374389
* drm/i915/bdw: Remove BDW preproduction W/As until C stepping.
- LP: #1374389
* drm/i915: Rework GPU reset sequence to match driver load & thaw
- LP: #1384469
* drm/ast: switch to using CACHED by default for sysram
- LP: #1420627
* drm/ast: Add missing entry to dclk_table[]
- LP: #1420627
* drm/ast: Add reduced blanking modes for wide screen mode
- LP: #1420627
* drm/ast: Try to use MMIO registers when PIO isn't supported
- LP: #1420627
* drm/ast: POST chip at probe time if VGA not enabled
- LP: #1420627
* drm/ast: Properly initialize P2A base before using it in
ast_
- LP: #1420627
* drm/ast: Don't assume DVO enabled means SIL164 on uninitialized chips
- LP: #1420627
* drm/ast: Cleanup analog init code path
- LP: #1420627
* audit: correctly record file names with different path name types
- LP: #1439441
* of: Create of_console_check() for selecting a console specified in
/chosen
- LP: #1438585
* of: Enable console on serial ports specified by /chosen/stdout-path
- LP: #1438585
* of: correct of_console_
- LP: #1438585
* of: Add bindings for chosen node, stdout-path
- LP: #1438585
* of: add optional options parameter to of_find_
- LP: #1438585
* of: support passing console options with stdout-path
- LP: #1438585
* netfilter: nf_tables: disable preemption when restoring chain counters
- LP: #1441317
* netfilter: nf_tables: fix leaks in error path of nf_tables_
- LP: #1441317
* ipvs: rerouting to local clients is not needed anymore
- LP: #1441317
* netfilter: nft_compat: fix module refcount underflow
- LP: #1441317
* netf...
| Changed in linux (Ubuntu Utopic): | |
| status: | Fix Committed → Fix Released |
| Launchpad Janitor (janitor) wrote : | #6 |
This bug was fixed in the package linux - 3.13.0-51.84
---------------
linux (3.13.0-51.84) trusty; urgency=low
[ Luis Henriques ]
* Release Tracking Bug
- LP: #1444141
* Merged back Ubuntu-3.13.0-49.83 security release
linux (3.13.0-50.82) trusty; urgency=low
[ Brad Figg ]
* Release Tracking Bug
- LP: #1442285
[ Andy Whitcroft ]
* [Config] CONFIG_
- LP: #1418140
[ Chris J Arges ]
* [Config] CONFIG_
- LP: #1398544
[ Upstream Kernel Changes ]
* KEYS: request_key() should reget expired keys rather than give
EKEYEXPIRED
- LP: #1124250
* audit: correctly record file names with different path name types
- LP: #1439441
* KVM: x86: Check for nested events if there is an injectable interrupt
- LP: #1413540
* be2iscsi: fix memory leak in error path
- LP: #1440156
* block: remove old blk_iopoll_enabled variable
- LP: #1440156
* be2iscsi: Fix handling timed out MBX completion from FW
- LP: #1440156
* be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec.
- LP: #1440156
* be2iscsi: Fix the session cleanup when reboot/shutdown happens
- LP: #1440156
* be2iscsi: Fix scsi_cmnd leakage in driver.
- LP: #1440156
* be2iscsi : Fix DMA Out of SW-IOMMU space error
- LP: #1440156
* be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path
- LP: #1440156
* be2iscsi: Fix exposing Host in sysfs after adapter initialization is
complete
- LP: #1440156
* be2iscsi: Fix interrupt Coalescing mechanism.
- LP: #1440156
* be2iscsi: Fix TCP parameters while connection offloading.
- LP: #1440156
* be2iscsi: Fix memory corruption in MBX path
- LP: #1440156
* be2iscsi: Fix destroy MCC-CQ before MCC-EQ is destroyed
- LP: #1440156
* be2iscsi: add an missing goto in error path
- LP: #1440156
* be2iscsi: remove potential junk pointer free
- LP: #1440156
* be2iscsi: Fix memory leak in mgmt_set_ip()
- LP: #1440156
* be2iscsi: Fix the sparse warning introduced in previous submission
- LP: #1440156
* be2iscsi: Fix updating the boot enteries in sysfs
- LP: #1440156
* be2iscsi: Fix processing CQE before connection resources are freed
- LP: #1440156
* be2iscsi : Fix kernel panic during reboot/shutdown
- LP: #1440156
* fixed invalid assignment of 64bit mask to host dma_boundary for scatter
gather segment boundary limit.
- LP: #1440156
* quota: Store maximum space limit in bytes
- LP: #1441284
* ip: zero sockaddr returned on error queue
- LP: #1441284
* net: rps: fix cpu unplug
- LP: #1441284
* ipv6: stop sending PTB packets for MTU < 1280
- LP: #1441284
* netxen: fix netxen_nic_poll() logic
- LP: #1441284
* udp_diag: Fix socket skipping within chain
- LP: #1441284
* ping: Fix race in free in receive path
- LP: #1441284
* bnx2x: fix napi poll return value for repoll
- LP: #1441284
* net: don't OOPS on socket aio
- LP: #1441284
* bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify
- LP: #1441284
* ipv4: tcp: get rid of ugly unicast_sock
...
| Changed in linux (Ubuntu Trusty): | |
| status: | Fix Committed → Fix Released |


This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:
apport-collect 1439441
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.