Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1223788rdb; Wed, 24 Jan 2024 08:21:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmbFVEEh7niwjBm4OS6STXHAuXlknYdP1pOkaV+kKHZMaEQst/lqE8i7e0CijfYpek5uw0 X-Received: by 2002:a05:6402:1c07:b0:55c:5893:4c12 with SMTP id ck7-20020a0564021c0700b0055c58934c12mr2049184edb.23.1706113268749; Wed, 24 Jan 2024 08:21:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706113268; cv=pass; d=google.com; s=arc-20160816; b=h4pK5unnqFb5kgGVf22ifmg7AXvtP4a5xwpFyRLTx+xrUatYxKrkYG/7hFlwGyMkz9 KZpC8xnF1OFTfmFWTb8v+vYOhwYpklYvdmlEdwR9v6sr8w2WBrTiT7rsPZtQK5XShxs0 zX66zoTXg1wLT3WfBK6/hPA1nfO/w//jbMXimpVIBZ0i/s6Q0AFUBJYWKfDxixtMt+jE Xxjg7BC702Olb6Vhcdc/dLjMghCdfGEFIHkpUXXdxSUQupEsLth9gWT4eAxwjxQctxjp 8a7vyLhRtJRM25yr+ybZ6SyKNtXZ+iXzntmaPWDIRVFfv0uVK/OW3XtUj/XYmfWo07cg /33A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=v/0jbU/nAV7TpU/6nXcUzK2udmpk//cHRjHXu3ik2y8=; fh=FCOxak7DCFsAw/ZASJeUZKgEs2NBzpeMANdx+ArfkwQ=; b=rMn94Ey+6DrPFPGTyAMA1KP7la+oJty5Dmso4VV7MKxvLnQ6KNEJqrQYNgMHYbEx7l trGOywUkl2A69PwHfqawAO1qCgPMDxEwY3VI+m9lLg7ij9r6I0r4JaXhcyZZwRaiSC2G LPebBefc9gl9PLtWua/vSxV6BrYGfFLguTmUSCDdB32gyJrnIZq5UBxic/TzX4hcYorS F7cdak5eI7wux5gWHK5xtXWNN81fYXgKdhXvi2uwseAvgDWuvrBJWH/kVplANCMaI5J1 ZkRsTL0laO1Qxd3BYGmVbLEKzjedApgMw6kvXKsO1/sQI7a0Dsi0AF2SB+titxPm/wNX 5zXA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kxsssozW; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-37078-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cn4-20020a0564020ca400b0055c00f52518si4478589edb.280.2024.01.24.08.21.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 08:21:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37078-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kxsssozW; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-37078-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ACB6C1F225AB for ; Wed, 24 Jan 2024 13:52:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8226D7A70D; Wed, 24 Jan 2024 13:52:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kxsssozW" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2952E604B2; Wed, 24 Jan 2024 13:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706104325; cv=none; b=RmlzDuyu65gc/qfEPpGA2aVznWZfr8SJj0meUTQ20WoflX1DFWdV5HZleztKS7iG09sTGS0lvoNEp1BMpFZ8SHfNvhyYU1rNWXwy4pNXsV7NrkAYuzslHl82fvaZ/acSI1pPyBtrZBGz4oz7BimhcxLgMKzoD09Vqf7YA8KDAaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706104325; c=relaxed/simple; bh=rbpT+I5DAbw9inpKn+MsXkzmp0NlzvzL9aVI6prsA2s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G4S5go10PIB7YtdkC0ux7t6W/vI8MnVOVhqEMr0feXMdUhDzbTZnTnNEbogR24DcfwN4WiZBtKH2nLJbvmdISXaPyYv8r8E+U6ALzcSPCXizQMjISFo8vKvXj6Xbt4i9uT4f+rlCXKRVE1m96hKCRQQTUO1mjnuskiu1p8eRUas= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kxsssozW; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706104324; x=1737640324; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=rbpT+I5DAbw9inpKn+MsXkzmp0NlzvzL9aVI6prsA2s=; b=kxsssozWlxGeGLB/DLcnihnl7d6doOla+Quxm6NKC/Cuv3rYrKUW/g69 +uRlrESMq1iQbyVBWFuaynba6G0fAp6cBKOQMJo+qyUjyz9t4BCVefeeE eoT6VWf7ph3hDDlRf+w6HwCw1USO/db43E4+fKB417iJkdHRCTAdRsUj/ XafAvg74y/VdxXgXmwCnyRRmV5Y9Ugy3LYQ3/ahOYaVSKinXmXyf69yFx kWnt5H976yIWa+zfB/+UHOiWOUsY0LLKNgkb2juzTwiEBnpYfUfmjzjL0 8cX2U+tpIUNDYKuoIdn/PydALeS2PN+Iw6aJuZIFYftxVdMTIuVzmBt7R A==; X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="8519424" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="8519424" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2024 05:52:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="929688219" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="929688219" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 24 Jan 2024 05:51:59 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 24 Jan 2024 15:51:58 +0200 Date: Wed, 24 Jan 2024 15:51:58 +0200 From: Heikki Krogerus To: Prashant Malani Cc: Abhishek Pandit-Subedi , linux-usb@vger.kernel.org, jthies@google.com, Abhishek Pandit-Subedi , Bjorn Andersson , Dmitry Baryshkov , Fabrice Gasnier , Greg Kroah-Hartman , Hans de Goede , Neil Armstrong , Saranya Gopal , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/3] usb: typec: ucsi: Limit read size on v1.2 Message-ID: References: <20240123223039.1471557-1-abhishekpandit@google.com> <20240123143026.v1.1.Iacf5570a66b82b73ef03daa6557e2fc0db10266a@changeid> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jan 24, 2024 at 12:12:26AM -0800, Prashant Malani wrote: > Hi Abhishek, > > On Tue, Jan 23, 2024 at 2:30 PM Abhishek Pandit-Subedi > wrote: > > > > From: Abhishek Pandit-Subedi > > > > Between UCSI 1.2 and UCSI 2.0, the size of the MESSAGE_IN region was > > increased from 16 to 256. In order to avoid overflowing reads for older > > systems, add a mechanism to use the read UCSI version to truncate read > > sizes on UCSI v1.2. > > > > Signed-off-by: Abhishek Pandit-Subedi > I have one nit (mentioned in side-band but reproducing here for consistency), > but will defer to the maintainer on that. > > The above notwithstanding, FWIW: > Reviewed-by: Prashant Malani > > > @@ -1556,6 +1569,15 @@ int ucsi_register(struct ucsi *ucsi) > > if (!ucsi->version) > > return -ENODEV; > > > > + /* > > + * Version format is JJ.M.N (JJ = Major version, M = Minor version, > > + * N = sub-minor version). > > + */ > > + dev_info(ucsi->dev, "Registered UCSI interface with version %x.%x.%x", > > + UCSI_BCD_GET_MAJOR(ucsi->version), > > + UCSI_BCD_GET_MINOR(ucsi->version), > > + UCSI_BCD_GET_SUBMINOR(ucsi->version)); > > nit: I think this doesn't need to be dev_info() and can be just > dev_dbg(), but will > defer to the maintainer. I think that's okay. Reviewewd-by: Heikki Krogerus -- heikki