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: <20180222231736.GA628@mini-rhel.redhat.com>
Date:   Thu, 22 Feb 2018 15:17:38 -0800
From:   Jeremy McNicoll <jmcnicol@...hat.com>
To:     Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:     linux-kernel@...r.kernel.org,
        Andreas Noever <andreas.noever@...il.com>,
        Michael Jamet <michael.jamet@...el.com>,
        Yehezkel Bernat <yehezkel.bernat@...el.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Mario.Limonciello@...l.com,
        Radion Mirchevsky <radion.mirchevsky@...el.com>
Subject: Re: [07/18] thunderbolt: Handle rejected Thunderbolt devices

On Tue, Feb 13, 2018 at 08:00:07PM +0300, Mika Westerberg wrote:
> The ICM firmware may reject devices for different reasons, even if we
> have asked it to accept anything. If we notice a device is rejected, we
> just log the event and bail out.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
> ---
>  drivers/thunderbolt/icm.c     | 6 ++++++
>  drivers/thunderbolt/tb_msgs.h | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c
> index 611d28e8e5f2..34d7740d1cbd 100644
> --- a/drivers/thunderbolt/icm.c
> +++ b/drivers/thunderbolt/icm.c
> @@ -410,6 +410,12 @@ icm_fr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr)
>  		ICM_LINK_INFO_DEPTH_SHIFT;
>  	authorized = pkg->link_info & ICM_LINK_INFO_APPROVED;
>  
> +	if (pkg->link_info & ICM_LINK_INFO_REJECTED) {
> +		tb_info(tb, "switch at %u.%u was rejected by ICM firmware\n",
> +			link, depth);

This kind of condition sounds more like an error instead of info.
Please bump this up to tb_WARN/tb_warn ideally tb_err().

BTW - why do we have tb_WARN and tb_warn in drivers/thunderbolt/tb.h ?

-jeremy

> +		return;
> +	}
> +
>  	ret = icm->get_route(tb, link, depth, &route);
>  	if (ret) {
>  		tb_err(tb, "failed to find route string for switch at %u.%u\n",
> diff --git a/drivers/thunderbolt/tb_msgs.h b/drivers/thunderbolt/tb_msgs.h
> index b0a092baa605..476bc04cac6c 100644
> --- a/drivers/thunderbolt/tb_msgs.h
> +++ b/drivers/thunderbolt/tb_msgs.h
> @@ -176,6 +176,7 @@ struct icm_fr_event_device_connected {
>  #define ICM_LINK_INFO_DEPTH_SHIFT	4
>  #define ICM_LINK_INFO_DEPTH_MASK	GENMASK(7, 4)
>  #define ICM_LINK_INFO_APPROVED		BIT(8)
> +#define ICM_LINK_INFO_REJECTED		BIT(9)
>  
>  struct icm_fr_pkg_approve_device {
>  	struct icm_pkg_header hdr;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ