[PATCH] xfs: fix memory leak in xfs_iext_free_last_leaf

2017-11-20 Thread shuwang
From: Shu Wang found the issue by kmemleak. unreferenced object 0x8800674611c0 (size 16): xfs_iext_insert+0x82a/0xa90 [xfs] xfs_bmap_add_extent_hole_delay+0x1e5/0x5b0 [xfs] xfs_bmapi_reserve_delalloc+0x483/0x530 [xfs] xfs_file_iomap_begin+0xac8/0xd40 [xfs] iomap_apply+0xb8

[PATCH] SMB: fix memory leak in smb3_validate_negotiate

2017-10-20 Thread shuwang
From: Shu Wang Found the issue by kmemleak. The pointer pneg_rsp stores the pointer kmalloced from SMB2_ioctl, and should be release before function return. unreferenced object 0x88018c2b1900 (size 32): backtrace: kmemleak_alloc+0x4a/0xa0 __kmalloc+0xec/0x220 SMB2_ioctl+0x27a/0

[PATCH] hwmon: (coretemp) remove duplicated coretemp for same core id

2017-10-17 Thread shuwang
From: Shu Wang Fix kernel warning on my 4cpus 2core_id system. The cpu0 and cpu1 have same core_id 0, so both cpu0 and cpu1 will try to create file temp2_label when it's online. - coretemp_cpu_online(cpu=0) - create_core_data(cpu=0, attr_no=2) - create_core_attrs(attr_no=2) - coretemp_cpu_o

[PATCH] mm: kmemleak: start address align for scan_large_block

2017-10-11 Thread shuwang
From: Shu Wang If the start address is not ptr bytes aligned, it may cause false positives when a pointer is split by MAX_SCAN_SIZE. For example: tcp_metrics_nl_family is in __ro_after_init area. On my PC, the __start_ro_after_init is not ptr aligned, and tcp_metrics_nl_family->attrbuf was break

[PATCH] cgroup: cpuset: fix panic when offline a cpu

2017-09-22 Thread shuwang
From: Shu Wang cgroup_migrate assumes mgctx tset.csets is pointing to tset.src_csets at start, add tasks to tset.src_csets in func cgroup_migrate_add_task, change test.csets to tset.dst_csets in cgroup_migrate_execute. For offline a cpu in cgroup_transfer_tasks, it will first migrate a task and

[PATCH] kbuild/mkspec: remove firmware from rpm package

2017-09-19 Thread shuwang
From: Shu Wang Commit 5620a0d1aacd ("firmware: delete in-kernel firmware") deleted in-kernel firmware support, including the firmware install command. So make binrpm-pkg will failed as no firmware_install make target. Signed-off-by: Shu Wang --- scripts/package/mkspec | 4 1 file changed

[PATCH V2] megaraid: kmemleak: Track page allocation for fusion

2017-09-14 Thread shuwang
From: Shu Wang Kmemleak reports about a thousand false positives for fusion-> cmd_list[]. Root casue is the cmd_list objects are allocated from slab allocator, and stored its pointer in object allocated by page allocator. The fix will tell kmemleak to track and scan fusion object. V2: Add commen

[PATCH] megaraid: kmemleak: Track page allocation for fusion

2017-09-13 Thread shuwang
From: Shu Wang Kmemleak reports about a thousand false positives for fusion-> cmd_list[]. Root casue is the cmd_list objects are allocated from slab allocator, and stored its pointer in object allocated by page allocator. The fix will tell kmemleak to track and scan fusion object. Before patch:

[PATCH] ftrace: fix kmemleak in unregister_ftrace_graph

2017-09-11 Thread shuwang
From: Shu Wang The trampoline allocated by function tracer was overwrite by function_graph tracer, and cause memory leak. The save_global_trampoline should save previous trampoline in register_ftrace_graph and restore it in unregister_ftrace_graph. But as it implemented, save_global_trampoline wa

[PATCH] cifs: release auth_key.response for reconnect.

2017-09-08 Thread shuwang
From: Shu Wang There is a race that cause cifs reconnect in cifs_mount, - cifs_mount - cifs_get_tcp_session - [ start thread cifs_demultiplex_thread - cifs_read_from_socket: -ECONNABORTED - DELAY_WORK smb2_reconnect_server ] - cifs_setup_session - [ smb2_reconnect_server ]

[PATCH] cifs: release cifs root_cred after exit_cifs

2017-09-07 Thread shuwang
From: Shu Wang memory leak was found by kmemleak. exit_cifs_spnego should be called before cifs module removed, or cifs root_cred will not be released. kmemleak report: unreferenced object 0x880070a3ce40 (size 192): backtrace: kmemleak_alloc+0x4a/0xa0 kmem_cache_alloc+0xc7/0x1d0

[PATCH 1/1] sched/topology: fix memleak in __sdt_alloc()

2017-08-10 Thread shuwang
From: Shu Wang Found this issue by kmemleak. the sg and sgc from __sdt_alloc() might be leaked as each domain holds many groups' ref. And in destroy_sched_domain(), it only declined the first group ref. Online and offline a cpu can trigger this leak, and cause OOM. reproducer for my 6 cpus machi

[PATCH v2] kmemleak: add oom= runtime parameter

2017-07-24 Thread shuwang
From: Shu Wang When running memory stress tests, kmemleak could be easily disabled in function create_object as system is out of memory and kmemleak failed to alloc from object_cache. Since there's no way to enable kmemleak after it's off, simply ignore the object_cache alloc failure will just lo

[PATCH] scsi: megaraid_sas: fix memleak in megasas_alloc_cmdlist_fusion

2017-07-21 Thread shuwang
From: Shu Wang Found this issue by kmemleak, a few kb mem was leaked in megasas_alloc_cmdlist_fusion when kzalloc failed for one megasas_cmd_fusion allocation. unreferenced object 0x88045dbd2000 (size 8192): comm "systemd-udevd", pid 323, jiffies 4294671759 (age 49.008s) backtrace: [

[PATCH] xhci: fix memleak in xhci_run()

2017-07-19 Thread shuwang
From: Shu Wang Found this issue by kmemleak. xhci_run() did not check return val and free command for xhci_queue_vendor_command() unreferenced object 0x88011c0be500 (size 64): comm "kworker/0:1", pid 58, jiffies 4294670908 (age 50.420s) hex dump (first 32 bytes): backtrace: [] kmem

[PATCH] x86/microcode/AMD: fix memleak in update_cache()

2017-07-18 Thread shuwang
From: Shu Wang Found this issue by kmemleak. The mem is allocated in verify_and_add_patch(), passed to update_cache(patch), and just dropped the reference without free if (p->patch_id >= new_patch->patch_id) return; unreferenced object 0x88010e780b40 (size 32): comm "bash", pid 860, ji

[PATCH] audit: fix memleak in auditd_send_unicast_skb.

2017-07-17 Thread shuwang
From: Shu Wang Found this issue by kmemleak report, auditd_send_unicast_skb did not free skb if rcu_dereference(auditd_conn) returns null. unreferenced object 0x88082568ce00 (size 256): comm "auditd", pid 1119, jiffies 4294708499 backtrace: [] kmemleak_alloc+0x4a/0xa0 [] kmem_cache_alloc_nod

[PATCH v2] kmemleak: add oom= runtime parameter

2017-07-14 Thread shuwang
From: Shu Wang When running memory stress tests, kmemleak could be easily disabled in function create_object as system is out of memory and kmemleak failed to alloc from object_cache. Since there's no way to enable kmemleak after it's off, simply ignore the object_cache alloc failure will just lo

[PATCH] kmemleak: add oom= runtime parameter

2017-07-14 Thread shuwang
From: Shu Wang When running memory stress tests, kmemleak could be easily disabled in function create_object as system is out of memory and kmemleak failed to alloc from object_cache. Since there's no way to enable kmemleak after it's off, simply ignore the object_cache alloc failure will just lo