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: <ZyiQnz4jbB5ChNxn@google.com>
Date: Mon, 4 Nov 2024 09:15:11 +0000
From: Quentin Perret <qperret@...gle.com>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: rafael@...nel.org, pavel@....cz, len.brown@...el.com,
	daniel.lezcano@...aro.org, lukasz.luba@....com,
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PM: EM: Fix uninitialized power in em_create_perf_table

Hi,

On Monday 04 Nov 2024 at 17:03:51 (+0800), Jinjie Ruan wrote:
> In em_create_perf_table(), power is uninitialized and passed the pointer
> to active_power() hook, but the hook function may not assign it and
> return 0, such as mtk_cpufreq_get_cpu_power(), so the later zero check for
> power is not invalid, initialize power to zero to fix it.

Sounds to me like a driver bug? We check the return value of
active_power() first, so if the callback failed it should tell us.

mtk_cpufreq_get_cpu_power() should only fail if we couldn't find a
cpufreq policy IIUC, so why can't this return -EINVAL instead?

Thanks,
Quentin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ