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: <20220901222020.2iumldsfuhpseqci@Rockosov-MBP>
Date:   Fri, 2 Sep 2022 01:20:20 +0300
From:   Dmitry Rokosov <ddrokosov@...rdevices.ru>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC:     <linux-kernel@...r.kernel.org>, Mark Brown <broonie@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v1 1/3] regmap: trace: Remove useless check for NULL for
 bulk ops

On Thu, Sep 01, 2022 at 04:23:34PM +0300, Andy Shevchenko wrote:
> If the buffer pointer is NULL we already are in troubles since
> regmap bulk API expects caller to provide valid parameters,
> it dereferences that without any checks before we call for
> traces.
> 
> Moreover, the current code will print garbage in the case of
> buffer is NULL and length is not 0.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/base/regmap/trace.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/base/regmap/trace.h b/drivers/base/regmap/trace.h
> index 04329ba68ec5..e92edc4f4ca5 100644
> --- a/drivers/base/regmap/trace.h
> +++ b/drivers/base/regmap/trace.h
> @@ -82,8 +82,7 @@ DECLARE_EVENT_CLASS(regmap_bulk,
>  		__assign_str(name, regmap_name(map));
>  		__entry->reg = reg;
>  		__entry->val_len = val_len;
> -		if (val)
> -			memcpy(__get_dynamic_array(buf), val, val_len);
> +		memcpy(__get_dynamic_array(buf), val, val_len);
>  	),
>  
>  	TP_printk("%s reg=%x val=%s", __get_str(name),
> -- 
> 2.35.1
> 

Reviewed-by: Dmitry Rokosov <ddrokosov@...rdevices.ru>

-- 
Thank you,
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ