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: <20201208094136.GH680328@kuha.fi.intel.com>
Date:   Tue, 8 Dec 2020 11:41:36 +0200
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Badhri Jagan Sridharan <badhri@...gle.com>
Cc:     Guenter Roeck <linux@...ck-us.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] usb: typec: tcpm: Clear send_discover in
 tcpm_check_send_discover

On Wed, Dec 02, 2020 at 07:19:08PM -0800, Badhri Jagan Sridharan wrote:
> tcpm_check_send_discover does not clear the send_discover flag
> when any of the following conditions are not met.
> 1. data_role is TYPEC_HOST
> 2. link is pd_capable
> 
> Discovery indentity would anyways not be attempted during
> the current session anymore when the above conditions are not
> met. Hence clear the send_discover flag here to prevent
> tcpm_enable_frs_work from rescheduling indefinetly.
> 
> Signed-off-by: Badhri Jagan Sridharan <badhri@...gle.com>

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

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 3bbc1f10af49..012135ade7b1 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -3035,10 +3035,9 @@ static inline enum tcpm_state unattached_state(struct tcpm_port *port)
>  static void tcpm_check_send_discover(struct tcpm_port *port)
>  {
>  	if (port->data_role == TYPEC_HOST && port->send_discover &&
> -	    port->pd_capable) {
> +	    port->pd_capable)
>  		tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0);
> -		port->send_discover = false;
> -	}
> +	port->send_discover = false;
>  }
>  
>  static void tcpm_swap_complete(struct tcpm_port *port, int result)
> -- 
> 2.29.2.576.ga3fc446d84-goog

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ