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: <20210521161044.GA997016@xps15>
Date:   Fri, 21 May 2021 10:10:44 -0600
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Mike Leach <mike.leach@...aro.org>,
        Leo Yan <leo.yan@...aro.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: Re: [PATCH v1 1/1] coresight: core: Switch to krealloc_array()

On Thu, May 20, 2021 at 04:50:41PM +0300, Andy Shevchenko wrote:
> Let the krealloc_array() check for multiplication overflow.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/hwtracing/coresight/coresight-core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> index 6c68d34d956e..a7971c68b0be 100644
> --- a/drivers/hwtracing/coresight/coresight-core.c
> +++ b/drivers/hwtracing/coresight/coresight-core.c
> @@ -1730,9 +1730,9 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict,
>  	if (idx < 0) {
>  		/* Make space for the new entry */
>  		idx = dict->nr_idx;
> -		list = krealloc(dict->fwnode_list,
> -				(idx + 1) * sizeof(*dict->fwnode_list),
> -				GFP_KERNEL);
> +		list = krealloc_array(dict->fwnode_list,
> +				      idx + 1, sizeof(*dict->fwnode_list),
> +				      GFP_KERNEL);

Applied - thanks.

Mathieu

>  		if (ZERO_OR_NULL_PTR(list)) {
>  			idx = -ENOMEM;
>  			goto done;
> -- 
> 2.30.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ