Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751547AbdGYJLM (ORCPT ); Tue, 25 Jul 2017 05:11:12 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:34306 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751524AbdGYJLJ (ORCPT ); Tue, 25 Jul 2017 05:11:09 -0400 Date: Tue, 25 Jul 2017 11:11:05 +0200 From: Christian Kellner Subject: Re: [PATCH v4 00/27] Thunderbolt security levels and NVM firmware upgrade To: Mika Westerberg Cc: Andreas Noever , Greg Kroah-Hartman , Michael Jamet , Yehezkel Bernat , Lukas Wunner , Amir Levy , Andy Lutomirski , Mario.Limonciello@dell.com, Jared.Dominguez@dell.com, Andy Shevchenko , linux-kernel@vger.kernel.org, Peter FP1 Zhang Message-Id: <1500973865.3327.0@smtp.gmail.com> In-Reply-To: <20170724065255.GJ629@lahna.fi.intel.com> References: <20170606122519.35401-1-mika.westerberg@linux.intel.com> <1500567109.13885.9.camel@redhat.com> <20170724065255.GJ629@lahna.fi.intel.com> X-Mailer: geary/0.11.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1492 Lines: 48 Hi Mika, > I've seen this once on Alpine Ridge LP (which you have here) where the > DROM contents of the older NVM image listed too many ports. Can you > try > if the below patch helps? You were right. Patch works fine, and I indeed see the expected warnings in the logs: [ 102.739663] thunderbolt 0000:03:00.0: 0: DROM has too many entries 6 (expected 5) [ 102.739665] thunderbolt 0000:03:00.0: 0: DROM has too many entries 7 (expected 5) [ 102.739667] thunderbolt 0000:03:00.0: 0: DROM has too many entries 8 (expected 5) [ 102.739668] thunderbolt 0000:03:00.0: 0: DROM has too many entries 9 (expected 5) [ 102.739669] thunderbolt 0000:03:00.0: 0: DROM has too many entries 10 (expected 5) [ 102.739670] thunderbolt 0000:03:00.0: 0: DROM has too many entries 11 (expected 5) Thanks a lot, Christian > diff --git a/drivers/thunderbolt/eeprom.c > b/drivers/thunderbolt/eeprom.c > index 996c6e2..bdf7f80 100644 > --- a/drivers/thunderbolt/eeprom.c > +++ b/drivers/thunderbolt/eeprom.c > @@ -333,6 +333,12 @@ static int tb_drom_parse_entry_port(struct > tb_switch *sw, > int res; > enum tb_port_type type; > > + if (header->index > sw->config.max_port_number) { > + tb_sw_warn(sw, "DROM has too many entries %u (expected %u)\n", > + header->index, sw->config.max_port_number); > + return 0; > + } > + > port = &sw->ports[header->index]; > port->disabled = header->port_disabled; > if (port->disabled) Tested-by: Christian Kellner