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]
Date:   Thu, 20 May 2021 12:26:25 +0300
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Guenter Roeck <linux@...ck-us.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v1 1/1] usb: typec: wcove: Use LE to CPU conversion when
 accessing msg->header

On Wed, May 19, 2021 at 11:55:34AM +0300, Andy Shevchenko wrote:
> As LKP noticed the Sparse is not happy about strict type handling:
>    .../typec/tcpm/wcove.c:380:50: sparse:     expected unsigned short [usertype] header
>    .../typec/tcpm/wcove.c:380:50: sparse:     got restricted __le16 const [usertype] header
> 
> Fix this by switching to use pd_header_cnt_le() instead of pd_header_cnt()
> in the affected code.
> 
> Fixes: ae8a2ca8a221 ("usb: typec: Group all TCPCI/TCPM code together")
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>

> ---
>  drivers/usb/typec/tcpm/wcove.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tcpm/wcove.c b/drivers/usb/typec/tcpm/wcove.c
> index 79ae63950050..5d125339687a 100644
> --- a/drivers/usb/typec/tcpm/wcove.c
> +++ b/drivers/usb/typec/tcpm/wcove.c
> @@ -378,7 +378,7 @@ static int wcove_pd_transmit(struct tcpc_dev *tcpc,
>  		const u8 *data = (void *)msg;
>  		int i;
>  
> -		for (i = 0; i < pd_header_cnt(msg->header) * 4 + 2; i++) {
> +		for (i = 0; i < pd_header_cnt_le(msg->header) * 4 + 2; i++) {
>  			ret = regmap_write(wcove->regmap, USBC_TX_DATA + i,
>  					   data[i]);
>  			if (ret)
> -- 
> 2.30.2

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ