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: <20250519100822.evhd4vs6p34irx2q@vireshk-i7>
Date: Mon, 19 May 2025 15:38:22 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: zhang.enpei@....com.cn
Cc: vireshk@...nel.org, nm@...com, sboyd@...nel.org,
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] OPP: switch to use kmemdup_array()

On 15-05-25, 20:13, zhang.enpei@....com.cn wrote:
> From: Zhang Enpei <zhang.enpei@....com.cn>
> 
> Use kmemdup_array() to avoid multiplication and possible overflows.
> 
> Signed-off-by: Zhang Enpei <zhang.enpei@....com.cn>
> ---
>  drivers/opp/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 72fbb6cadc23..d85e3371493f 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -2087,8 +2087,8 @@ static int _opp_set_supported_hw(struct opp_table *opp_table,
>         if (opp_table->supported_hw)
>                 return 0;
> 
> -       opp_table->supported_hw = kmemdup(versions, count * sizeof(*versions),
> -                                       GFP_KERNEL);
> +       opp_table->supported_hw = kmemdup_array(versions, count, sizeof(*versions),
> +                                               GFP_KERNEL);
>         if (!opp_table->supported_hw)
>                 return -ENOMEM;

Applied. Thanks.

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ