Re: BUG: bisected: thermald regression (MEMLEAK) in commit c7ff29763989bd09c433f73fae3c1e1c15d9cda4

From: Mirsad Goran Todorovac
Date: Wed Oct 26 2022 - 13:52:34 EST


Dear all,

On 24. 10. 2022. 20:56, Mirsad Goran Todorovac wrote:
On 24. 10. 2022. 20:39, srinivas pandruvada wrote:

Thank you for the patch. Unfortunately, when applied to v6.0.3 it
didn't
fix the issue.
Thanks for the test. I copied to acpi and acpica mailing list. Someone
can tell us what is this call doing wrong here.

I have worse news: after every

# systemctl stop thermald
# systemctl start thermald

the number of leaks increases by one allocated block (apparently 80 bytes). The effect appears to be
cummulative.

Please find the results of the MEMLEAK scan in the attachment.

In theory, motivated adversary could theoretically exhaust  i.e. 8 GiB in a loop of 10 million thermald stops/starts,
on my laptop and 2 sec for stop+start, it would be approx. 230 days.

Hope this helps.

Mirsad

--

Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
--
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union
unreferenced object 0xffff95e686df7c80 (size 80):
comm "thermald", pid 853, jiffies 4294894308 (age 1327.784s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 0d 01 2d 00 00 00 00 00 ..........-.....
af 07 01 40 fe a2 ff ff 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<00000000da3c667c>] slab_post_alloc_hook+0x80/0x2e0
[<000000007820f763>] kmem_cache_alloc+0x171/0x300
[<00000000c8d00bcc>] acpi_os_acquire_object+0x2c/0x32
[<000000003aec451a>] acpi_ps_alloc_op+0x4a/0x99
[<000000008a7f6c81>] acpi_ps_get_next_arg+0x611/0x761
[<00000000f7fcc03d>] acpi_ps_parse_loop+0x494/0x8d7
[<0000000078ba6397>] acpi_ps_parse_aml+0x1bb/0x561
[<00000000e189ac30>] acpi_ps_execute_method+0x20f/0x2d5
[<0000000078532bb9>] acpi_ns_evaluate+0x34d/0x4f3
[<0000000071538943>] acpi_evaluate_object+0x180/0x3ae
[<00000000fdcec938>] acpi_run_osc+0x128/0x250
[<00000000e0544e57>] int3400_thermal_run_osc+0x6f/0xc0 [int3400_thermal]
[<000000007a443462>] current_uuid_store+0xe3/0x120 [int3400_thermal]
[<000000005063ae55>] dev_attr_store+0x14/0x30
[<000000001ccc0b04>] sysfs_kf_write+0x38/0x50
[<00000000f24dcffc>] kernfs_fop_write_iter+0x146/0x1d0
unreferenced object 0xffff95e683768820 (size 80):
comm "thermald", pid 853, jiffies 4294950021 (age 1105.064s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 0d 01 2d 00 00 00 00 00 ..........-.....
3a 08 01 40 fe a2 ff ff 00 00 00 00 00 00 00 00 :..@............
backtrace:
[<00000000da3c667c>] slab_post_alloc_hook+0x80/0x2e0
[<000000007820f763>] kmem_cache_alloc+0x171/0x300
[<00000000c8d00bcc>] acpi_os_acquire_object+0x2c/0x32
[<000000003aec451a>] acpi_ps_alloc_op+0x4a/0x99
[<000000008a7f6c81>] acpi_ps_get_next_arg+0x611/0x761
[<00000000f7fcc03d>] acpi_ps_parse_loop+0x494/0x8d7
[<0000000078ba6397>] acpi_ps_parse_aml+0x1bb/0x561
[<00000000e189ac30>] acpi_ps_execute_method+0x20f/0x2d5
[<0000000078532bb9>] acpi_ns_evaluate+0x34d/0x4f3
[<0000000071538943>] acpi_evaluate_object+0x180/0x3ae
[<00000000fdcec938>] acpi_run_osc+0x128/0x250
[<00000000e0544e57>] int3400_thermal_run_osc+0x6f/0xc0 [int3400_thermal]
[<0000000014b96f7d>] int3400_thermal_change_mode+0xd3/0x110 [int3400_thermal]
[<000000006ffc8826>] thermal_zone_device_set_mode+0x46/0xc0
[<0000000036a1f221>] thermal_zone_device_disable+0x10/0x20
[<00000000502e4e74>] mode_store+0x5c/0x80
unreferenced object 0xffff95e68a6181e0 (size 80):
comm "thermald", pid 5206, jiffies 4294951963 (age 1097.300s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 0d 01 2d 00 00 00 00 00 ..........-.....
af 07 01 40 fe a2 ff ff 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<00000000da3c667c>] slab_post_alloc_hook+0x80/0x2e0
[<000000007820f763>] kmem_cache_alloc+0x171/0x300
[<00000000c8d00bcc>] acpi_os_acquire_object+0x2c/0x32
[<000000003aec451a>] acpi_ps_alloc_op+0x4a/0x99
[<000000008a7f6c81>] acpi_ps_get_next_arg+0x611/0x761
[<00000000f7fcc03d>] acpi_ps_parse_loop+0x494/0x8d7
[<0000000078ba6397>] acpi_ps_parse_aml+0x1bb/0x561
[<00000000e189ac30>] acpi_ps_execute_method+0x20f/0x2d5
[<0000000078532bb9>] acpi_ns_evaluate+0x34d/0x4f3
[<0000000071538943>] acpi_evaluate_object+0x180/0x3ae
[<00000000fdcec938>] acpi_run_osc+0x128/0x250
[<00000000e0544e57>] int3400_thermal_run_osc+0x6f/0xc0 [int3400_thermal]
[<000000007a443462>] current_uuid_store+0xe3/0x120 [int3400_thermal]
[<000000005063ae55>] dev_attr_store+0x14/0x30
[<000000001ccc0b04>] sysfs_kf_write+0x38/0x50
[<00000000f24dcffc>] kernfs_fop_write_iter+0x146/0x1d0
unreferenced object 0xffff95e687dbe500 (size 80):
comm "thermald", pid 5206, jiffies 4294952889 (age 1093.724s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 0d 01 2d 00 00 00 00 00 ..........-.....
3a 08 01 40 fe a2 ff ff 00 00 00 00 00 00 00 00 :..@............
backtrace:
[<00000000da3c667c>] slab_post_alloc_hook+0x80/0x2e0
[<000000007820f763>] kmem_cache_alloc+0x171/0x300
[<00000000c8d00bcc>] acpi_os_acquire_object+0x2c/0x32
[<000000003aec451a>] acpi_ps_alloc_op+0x4a/0x99
[<000000008a7f6c81>] acpi_ps_get_next_arg+0x611/0x761
[<00000000f7fcc03d>] acpi_ps_parse_loop+0x494/0x8d7
[<0000000078ba6397>] acpi_ps_parse_aml+0x1bb/0x561
[<00000000e189ac30>] acpi_ps_execute_method+0x20f/0x2d5
[<0000000078532bb9>] acpi_ns_evaluate+0x34d/0x4f3
[<0000000071538943>] acpi_evaluate_object+0x180/0x3ae
[<00000000fdcec938>] acpi_run_osc+0x128/0x250
[<00000000e0544e57>] int3400_thermal_run_osc+0x6f/0xc0 [int3400_thermal]
[<0000000014b96f7d>] int3400_thermal_change_mode+0xd3/0x110 [int3400_thermal]
[<000000006ffc8826>] thermal_zone_device_set_mode+0x46/0xc0
[<0000000036a1f221>] thermal_zone_device_disable+0x10/0x20
[<00000000502e4e74>] mode_store+0x5c/0x80
unreferenced object 0xffff95e687a34cd0 (size 80):
comm "thermald", pid 5214, jiffies 4294953628 (age 1090.768s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 0d 01 2d 00 00 00 00 00 ..........-.....
af 07 01 40 fe a2 ff ff 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<00000000da3c667c>] slab_post_alloc_hook+0x80/0x2e0
[<000000007820f763>] kmem_cache_alloc+0x171/0x300
[<00000000c8d00bcc>] acpi_os_acquire_object+0x2c/0x32
[<000000003aec451a>] acpi_ps_alloc_op+0x4a/0x99
[<000000008a7f6c81>] acpi_ps_get_next_arg+0x611/0x761
[<00000000f7fcc03d>] acpi_ps_parse_loop+0x494/0x8d7
[<0000000078ba6397>] acpi_ps_parse_aml+0x1bb/0x561
[<00000000e189ac30>] acpi_ps_execute_method+0x20f/0x2d5
[<0000000078532bb9>] acpi_ns_evaluate+0x34d/0x4f3
[<0000000071538943>] acpi_evaluate_object+0x180/0x3ae
[<00000000fdcec938>] acpi_run_osc+0x128/0x250
[<00000000e0544e57>] int3400_thermal_run_osc+0x6f/0xc0 [int3400_thermal]
[<000000007a443462>] current_uuid_store+0xe3/0x120 [int3400_thermal]
[<000000005063ae55>] dev_attr_store+0x14/0x30
[<000000001ccc0b04>] sysfs_kf_write+0x38/0x50
[<00000000f24dcffc>] kernfs_fop_write_iter+0x146/0x1d0
unreferenced object 0xffff95e687a34820 (size 80):
comm "thermald", pid 5214, jiffies 4295194182 (age 128.568s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 0d 01 2d 00 00 00 00 00 ..........-.....
3a 08 01 40 fe a2 ff ff 00 00 00 00 00 00 00 00 :..@............
backtrace:
[<00000000da3c667c>] slab_post_alloc_hook+0x80/0x2e0
[<000000007820f763>] kmem_cache_alloc+0x171/0x300
[<00000000c8d00bcc>] acpi_os_acquire_object+0x2c/0x32
[<000000003aec451a>] acpi_ps_alloc_op+0x4a/0x99
[<000000008a7f6c81>] acpi_ps_get_next_arg+0x611/0x761
[<00000000f7fcc03d>] acpi_ps_parse_loop+0x494/0x8d7
[<0000000078ba6397>] acpi_ps_parse_aml+0x1bb/0x561
[<00000000e189ac30>] acpi_ps_execute_method+0x20f/0x2d5
[<0000000078532bb9>] acpi_ns_evaluate+0x34d/0x4f3
[<0000000071538943>] acpi_evaluate_object+0x180/0x3ae
[<00000000fdcec938>] acpi_run_osc+0x128/0x250
[<00000000e0544e57>] int3400_thermal_run_osc+0x6f/0xc0 [int3400_thermal]
[<0000000014b96f7d>] int3400_thermal_change_mode+0xd3/0x110 [int3400_thermal]
[<000000006ffc8826>] thermal_zone_device_set_mode+0x46/0xc0
[<0000000036a1f221>] thermal_zone_device_disable+0x10/0x20
[<00000000502e4e74>] mode_store+0x5c/0x80
unreferenced object 0xffff95e687dbe4b0 (size 80):
comm "thermald", pid 5763, jiffies 4295197814 (age 114.188s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 0d 01 2d 00 00 00 00 00 ..........-.....
af 07 01 40 fe a2 ff ff 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<00000000da3c667c>] slab_post_alloc_hook+0x80/0x2e0
[<000000007820f763>] kmem_cache_alloc+0x171/0x300
[<00000000c8d00bcc>] acpi_os_acquire_object+0x2c/0x32
[<000000003aec451a>] acpi_ps_alloc_op+0x4a/0x99
[<000000008a7f6c81>] acpi_ps_get_next_arg+0x611/0x761
[<00000000f7fcc03d>] acpi_ps_parse_loop+0x494/0x8d7
[<0000000078ba6397>] acpi_ps_parse_aml+0x1bb/0x561
[<00000000e189ac30>] acpi_ps_execute_method+0x20f/0x2d5
[<0000000078532bb9>] acpi_ns_evaluate+0x34d/0x4f3
[<0000000071538943>] acpi_evaluate_object+0x180/0x3ae
[<00000000fdcec938>] acpi_run_osc+0x128/0x250
[<00000000e0544e57>] int3400_thermal_run_osc+0x6f/0xc0 [int3400_thermal]
[<000000007a443462>] current_uuid_store+0xe3/0x120 [int3400_thermal]
[<000000005063ae55>] dev_attr_store+0x14/0x30
[<000000001ccc0b04>] sysfs_kf_write+0x38/0x50
[<00000000f24dcffc>] kernfs_fop_write_iter+0x146/0x1d0