<div dir="ltr"><div>Acked-by: Luke Nowakowski-Krijger <<a href="mailto:luke.nowakowskikrijger@canonical.com">luke.nowakowskikrijger@canonical.com</a>><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 17, 2023 at 9:06 AM Jianlin Lv <<a href="mailto:iecedge@gmail.com">iecedge@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">BugLink: <a href="https://bugs.launchpad.net/bugs/1987430" rel="noreferrer" target="_blank">https://bugs.launchpad.net/bugs/1987430</a><br>
<br>
[Impact]<br>
<br>
Under upgrading server to Ubuntu 22.04 with kernel 5.15.0-XX, memory<br>
started to ramp up slowly that growth ~1 GB a day.<br>
<br>
[Fix]<br>
<br>
The memory leak is an allocated struct audit_buffer object in<br>
audit_log_lsm() that to record LSM attributes.<br>
Free audit buffer before audit_log_lsm() return.<br>
<br>
[Test Plan]<br>
<br>
1.Disable apparmor module by append apparmor=0 to grub<br>
<br>
2.Start auditd service with following audit rule:<br>
-a exit,always -F arch=b64 -S execve<br>
-a exit,always -F arch=b32 -S execve<br>
<br>
3.Using Kmemleak to check if memory leak has occurred<br>
$ cat /sys/kernel/debug/kmemleak<br>
or Keep watching for changes in slabinfo<br>
$ watch "sudo cat /proc/slabinfo | grep kmalloc-2k"<br>
<br>
Jianlin Lv (1):<br>
UBUNTU: audit: fix memory leak of audit_log_lsm()<br>
<br>
kernel/auditsc.c | 5 +++--<br>
1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
-- <br>
2.25.1<br>
<br>
<br>
-- <br>
kernel-team mailing list<br>
<a href="mailto:kernel-team@lists.ubuntu.com" target="_blank">kernel-team@lists.ubuntu.com</a><br>
<a href="https://lists.ubuntu.com/mailman/listinfo/kernel-team" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/kernel-team</a><br>
</blockquote></div></div>