Repository navigation
Commit 95e0b46
audit: fix a memleak caused by auditing load module
module.name will be allocated unconditionally when auditing load
module, and audit_log_start() can fail with other reasons, or
audit_log_exit maybe not called, caused module.name is not freed
so free module.name in audit_free_context and __audit_syscall_exit
unreferenced object 0xffff88af90837d20 (size 8):
comm "modprobe", pid 1036, jiffies 4294704867 (age 3069.138s)
hex dump (first 8 bytes):
69 78 67 62 65 00 ff ff ixgbe...
backtrace:
[<0000000008da28fe>] __audit_log_kern_module+0x33/0x80
[<00000000c1491e61>] load_module+0x64f/0x3850
[<000000007fc9ae3f>] __do_sys_init_module+0x218/0x250
[<0000000000d4a478>] do_syscall_64+0x117/0x400
[<000000004924ded8>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[<000000007dc331dd>] 0xffffffffffffffff
Fixes: ca86cad ("audit: log module name on init_module")
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
[PM: manual merge fixup in __audit_syscall_exit()]
Signed-off-by: Paul Moore <paul@paul-moore.com>1 parent 9e98c67 commit 95e0b46
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
840 | 840 | | |
841 | 841 | | |
842 | 842 | | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
843 | 850 | | |
844 | 851 | | |
845 | 852 | | |
| |||
923 | 930 | | |
924 | 931 | | |
925 | 932 | | |
| 933 | + | |
926 | 934 | | |
927 | 935 | | |
928 | 936 | | |
| |||
1266 | 1274 | | |
1267 | 1275 | | |
1268 | 1276 | | |
1269 | | - | |
1270 | 1277 | | |
1271 | 1278 | | |
1272 | 1279 | | |
| |||
1697 | 1704 | | |
1698 | 1705 | | |
1699 | 1706 | | |
| 1707 | + | |
1700 | 1708 | | |
1701 | 1709 | | |
1702 | 1710 | | |
| |||
0 commit comments