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] [thread-next>] [day] [month] [year] [list]
Message-ID: <918bf8b1-6da6-943b-3cbe-e15a24c9de6f@hust.edu.cn>
Date:   Wed, 19 Apr 2023 08:55:07 +0800
From:   Dongliang Mu <dzm91@...t.edu.cn>
To:     Stephen Boyd <sboyd@...nel.org>,
        周师德 <u201911681@...t.edu.cn>
Cc:     abel vesa <abelvesa@...nel.org>, bai ping <ping.bai@....com>,
        fabio estevam <festevam@...il.com>,
        michael turquette <mturquette@...libre.com>,
        nxp linux team <linux-imx@....com>,
        peng fan <peng.fan@....com>,
        pengutronix kernel team <kernel@...gutronix.de>,
        sascha hauer <s.hauer@...gutronix.de>,
        shawn guo <shawnguo@...nel.org>,
        hust-os-kernel-patches@...glegroups.com, linux-clk@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        hao luo <m202171776@...t.edu.cn>
Subject: Re: [PATCH] clk: imx: clk-imx8mm: fix memory leak issue in
 'imx8mm_clocks_probe'


On 2023/4/19 03:57, Stephen Boyd wrote:
> Quoting 周师德 (2023-04-13 19:02:19)
>>
>>
>>> -----原始邮件-----
>>> 发件人: "Stephen Boyd" <sboyd@...nel.org>
>>> 发送时间: 2023-04-14 03:06:59 (星期五)
>>> 收件人: "Abel Vesa" <abelvesa@...nel.org>, "Bai Ping" <ping.bai@....com>, "Fabio Estevam" <festevam@...il.com>, "Michael Turquette" <mturquette@...libre.com>, "NXP Linux Team" <linux-imx@....com>, "Peng Fan" <peng.fan@....com>, "Pengutronix Kernel Team" <kernel@...gutronix.de>, "Sascha Hauer" <s.hauer@...gutronix.de>, "Shawn Guo" <shawnguo@...nel.org>, "Zhou Shide" <u201911681@...t.edu.cn>
>>> 抄送: hust-os-kernel-patches@...glegroups.com, "Zhou Shide" <u201911681@...t.edu.cn>, linux-clk@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, "Hao Luo" <m202171776@...t.edu.cn>
>>> 主题: Re: [PATCH] clk: imx: clk-imx8mm: fix memory leak issue in 'imx8mm_clocks_probe'
>>>
>>> Quoting Zhou Shide (2023-04-12 20:24:39)
>>>> The function imx8mm_clocks_probe() has two main issues:
>>>> - The of_iomap() function may cause a memory leak.
>>>> - Memory allocated for 'clk_hw_data' may not be freed properly
>>>> in some paths.
>>>>
>>>> To fix these issues, this commit replaces the use of of_iomap()
>>>> with devm_of_iomap() and replaces kzalloc() with devm_kzalloc().
>>>> This ensures that all memory is properly managed and automatically
>>>> freed when the device is removed.
>>>>
>>>> In addition, when devm_of_iomap() allocates memory with an error,
>>>> it will first jump to label "unregister_hws" and
>>>> then return PTR_ ERR(base).
>>>>
>>>> Fixes: 9c71f9ea35d7 ("clk: imx: imx8mm: Switch to clk_hw based API")
>>>> Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
>>>> Signed-off-by: Zhou Shide <u201911681@...t.edu.cn>
>>>> ---
>>>> The issue is discovered by static analysis, and the patch is not tested yet.
>>> And you're not coordinating with each other?
>> What do you mean by "coordinating with each other"?
>>
> I see two patches to the same driver from the same university on the
> list. Preferably you coordinate and decide who will fix what smatch
> warnings.

Hi Stephen,

As their advisor, I coordinate and assign smatch warnings to each 
student. I double check our assignment table:

drivers/clk/imx/clk-imx8mn.c:612 imx8mn_clocks_probe() warn: 'base' from 
of_iomap() not released on lines: 612.
drivers/clk/imx/clk-imxrt1050.c:154 imxrt1050_clocks_probe() warn: 
'pll_base' from of_iomap() not released on lines: 108,154.
drivers/clk/imx/clk-imx8mm.c:619 imx8mm_clocks_probe() warn: 'base' from 
of_iomap() not released on lines: 403,619.
drivers/clk/imx/clk-imx8mq.c:611 imx8mq_clocks_probe() warn: 'base' from 
of_iomap() not released on lines: 399,611.

There are four similar warnings from your subsystem. If I understand 
correctly, two students are patching issues from different probe 
functions in the different files since we assign all issues in one file 
to one student. Maybe you mix clk-imx8mn (Hao Luo) and clk-imx8mm(Shide 
Zhou). They only differ in one char.

If I miss anything, please let me know. Next time, I will ask one 
student to fix the issues in one subsystem. This can simply the effort 
spent by other student.

Dongliang Mu

>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ