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: <044df789-6415-d842-9995-179f987d26dc@roeck-us.net>
Date:   Mon, 3 May 2021 10:38:38 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Kyle Tso <kyletso@...gle.com>, heikki.krogerus@...ux.intel.com,
        gregkh@...uxfoundation.org
Cc:     badhri@...gle.com, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: typec: tcpm: Fix wrong handling in GET_SINK_CAP

On 5/3/21 10:18 AM, Kyle Tso wrote:
> After receiving Sink Capabilities Message in GET_SINK_CAP AMS, it is
> incorrect to call tcpm_pd_handle_state because the Message is expected
> and the current state is not Ready states. The result of this incorrect
> operation ends in Soft Reset which is definitely wrong. Simply
> forwarding to Ready States is enough to finish the AMS.
> 
> Fixes: 8dea75e11380 ("usb: typec: tcpm: Protocol Error handling")
> Signed-off-by: Kyle Tso <kyletso@...gle.com>

Reviewed-by: Guenter Roeck <linux@...ck-us.net>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index c4fdc00a3bc8..68e04e397e92 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -2390,7 +2390,7 @@ static void tcpm_pd_data_request(struct tcpm_port *port,
>  		port->nr_sink_caps = cnt;
>  		port->sink_cap_done = true;
>  		if (port->ams == GET_SINK_CAPABILITIES)
> -			tcpm_pd_handle_state(port, ready_state(port), NONE_AMS, 0);
> +			tcpm_set_state(port, ready_state(port), 0);
>  		/* Unexpected Sink Capabilities */
>  		else
>  			tcpm_pd_handle_msg(port,
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ