lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ca37adae-5e06-3003-c5b5-3146001d7d37@arm.com>
Date:   Fri, 18 Aug 2023 12:42:27 +0100
From:   Suzuki K Poulose <suzuki.poulose@....com>
To:     James Clark <james.clark@....com>,
        Junhao He <hejunhao3@...wei.com>, mike.leach@...aro.org,
        leo.yan@...aro.org
Cc:     coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, linuxarm@...wei.com,
        jonathan.cameron@...wei.com, yangyicong@...wei.com,
        prime.zeng@...ilicon.com
Subject: Re: [PATCH 1/2] coresight: Fix memory leak in acpi_buffer->pointer

On 17/08/2023 15:03, James Clark wrote:
> 
> 
> On 17/08/2023 09:59, Junhao He wrote:
>> There are memory leaks reported by kmemleak:
>> ...
>> unreferenced object 0xffff00213c141000 (size 1024):
>>    comm "systemd-udevd", pid 2123, jiffies 4294909467 (age 6062.160s)
>>    hex dump (first 32 bytes):
>>      04 00 00 00 02 00 00 00 18 10 14 3c 21 00 ff ff  ...........<!...
>>      00 00 00 00 00 00 00 00 03 00 00 00 10 00 00 00  ................
>>    backtrace:
>>      [<000000004b7c9001>] __kmem_cache_alloc_node+0x2f8/0x348
>>      [<00000000b0fc7ceb>] __kmalloc+0x58/0x108
>>      [<0000000064ff4695>] acpi_os_allocate+0x2c/0x68
>>      [<000000007d57d116>] acpi_ut_initialize_buffer+0x54/0xe0
>>      [<0000000024583908>] acpi_evaluate_object+0x388/0x438
>>      [<0000000017b2e72b>] acpi_evaluate_object_typed+0xe8/0x240
>>      [<000000005df0eac2>] coresight_get_platform_data+0x1b4/0x988 [coresight]
>> ...
>>
>> The ACPI buffer memory (buf.pointer) should be freed. But the buffer
>> is also used after returning from acpi_get_dsd_graph().
>> Move the temporary variables buf to acpi_coresight_parse_graph(),
>> and free it before the function return to prevent memory leak.
>>
>> Fixes: 76ffa5ab5b79 ("coresight: Support for ACPI bindings")
>> Signed-off-by: Junhao He <hejunhao3@...wei.com>
> 
> I confirmed that the error gone. Thanks for the fix.
> 
> Reviewed-by: James Clark <james.clark@....com>

Queued:

https://git.kernel.org/coresight/c/1a9e02673e25

Thanks!

Suzuki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ