Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp971454rdb; Wed, 24 Jan 2024 00:12:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3RrV+eUqbkqqllkks9HZN5Uq2NrUuc1QmrPo+cgziRWYXLRM7G3IqLmM1ML94PVpUQBf0 X-Received: by 2002:a05:6214:2262:b0:680:b7fa:15c3 with SMTP id gs2-20020a056214226200b00680b7fa15c3mr2295285qvb.50.1706083971723; Wed, 24 Jan 2024 00:12:51 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f29-20020a0caa9d000000b006819449e939si9801984qvb.344.2024.01.24.00.12.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 00:12:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@chromium.org header.s=google header.b=YBbty9sG; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-36616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7AD361C29627 for ; Wed, 24 Jan 2024 08:12:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CE4917560; Wed, 24 Jan 2024 08:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YBbty9sG" Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4606171DD for ; Wed, 24 Jan 2024 08:12:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706083960; cv=none; b=HZryLTa9VF7D1vSxpn026P/xxUEQhzwqlRSYMcMuypiROW7mWq31X1xmd2uSPCwUSpa1iRSLTRBvLjMIOCCTGEXqtZJPfm8H8oeXzWWgDBKUULBiIIXr4q4dIuQPpjB9aE0gugRMEIXGwkGAGp1bXzqXfLSn6DKbrNXKGu7ULrM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706083960; c=relaxed/simple; bh=C8kYfDx/P9hnWkyKHcdyWPTZdI2VSXngwIerXp0qFns=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=IhxK+W4lw4BzjHDMPYgma871P5dBudlC40HnhWBgiUVO4vv41IMxvyjVeJWrQY7wRaggSY+fTcHTvc0CEhRR8GRBDYqVXLjfCa4qjFIdere5zIe9GR+dzdLZHFcPzyHHOWLou/O8WTLcYJbMLlWt3Ako+byhHqQ2KaaECwYKoUM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=YBbty9sG; arc=none smtp.client-ip=209.85.219.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-dc22ade26d8so4027682276.1 for ; Wed, 24 Jan 2024 00:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706083957; x=1706688757; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3nlrvezwsoefYOiDE66ptLKogdw8xj1n98YMDFjoN+M=; b=YBbty9sG7JivTyRuJzpHonuXmx+JIN1C4fibeYvcSg++Z6PyIykvNZnjzH3m29c5FU xBSjAX8Z4Y0cAg/XDe512kDKk6+UO4B1ck2I3hkyD91wRUmfGw0RKM0Pq1XamRPypEo+ 9Lf7/Rvr3obTej/2lwzBzhojd/ijWYCWszSiE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706083957; x=1706688757; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3nlrvezwsoefYOiDE66ptLKogdw8xj1n98YMDFjoN+M=; b=RlpykVMtzWOi/7PiB0ScC1/ivaYzAEBsF84pJKMKOlsoOyQz+IHxATwQLkrubNCE7L lO3xGrSWV/55BJE0Ex9moy+vY2oK3GKLkQPMMs9UvbnjdohFk57OLN6hO6yzi3RgU5f2 ClSInWg9hctRhSN/9cQbMPNgzLdLs3LwC7r5+6GgoBHtMmLdb4pVhrVcjN0JfCmDTKhP TFr37BaFTAmwzkCfQhpv9EGC+069RcjXZnocSKuDbfNbjGH08/4h8VTy7EaOSNon4gj0 V5O4p1vd2imZruTAtQx36H7YrRuMIgT93wEWMl0MaBnuLKSPnuBlU40teEAbvjOEixy8 fy6A== X-Gm-Message-State: AOJu0YynCzfAWf2bOL5AwL3ab8jsapAjcgN/ywmQgpZ5i+Q6PYCjSOpX 2L+2KS2f+1SLOQHds7QRofm6hhhw+ngxbWcmrwYHZ1TUV8YolBO7c83NZaaEHWwIx8SJlRCuSoz mzPWMlajNznYIRCE/JpZpFlrgZAUVJqSpd3kx X-Received: by 2002:a5b:345:0:b0:dbe:d3ef:d54b with SMTP id q5-20020a5b0345000000b00dbed3efd54bmr291405ybp.93.1706083957672; Wed, 24 Jan 2024 00:12:37 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240123223039.1471557-1-abhishekpandit@google.com> <20240123143026.v1.1.Iacf5570a66b82b73ef03daa6557e2fc0db10266a@changeid> In-Reply-To: <20240123143026.v1.1.Iacf5570a66b82b73ef03daa6557e2fc0db10266a@changeid> From: Prashant Malani Date: Wed, 24 Jan 2024 00:12:26 -0800 Message-ID: Subject: Re: [PATCH v1 1/3] usb: typec: ucsi: Limit read size on v1.2 To: Abhishek Pandit-Subedi Cc: Heikki Krogerus , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Abhishek, On Tue, Jan 23, 2024 at 2:30=E2=80=AFPM 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 =3D Major version, M =3D Minor ve= rsion, > + * N =3D 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. Thanks, -Prashant