Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp467226rdb; Sat, 16 Dec 2023 17:08:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaU6ieAtbJcQywZoErU7B45l3m9eJd6U9jxPwvaV/c3GD7lQtDlA2AI2ltNofSG1+X3g3P X-Received: by 2002:a05:6a20:4310:b0:18f:4779:6781 with SMTP id h16-20020a056a20431000b0018f47796781mr18459134pzk.105.1702775312328; Sat, 16 Dec 2023 17:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702775312; cv=none; d=google.com; s=arc-20160816; b=VPs667IuGl3e0MQp0GbfBLl1dxR/73DAwN/P24gKQhy/rCtumSweWGe+volAxiEAK6 qIWNOfeOB19vDoAeE4wiQc7L3F3o8qCRGgF/9aixqWxXGh3xHQsvwaRT35TuwK2b/wqE iNq18V+HxTFEZNU7sZrcF7Gv8wI+1CrRdfnROH8/MqGdGqxXqGJurN138u09LmPm60D7 f62A1bB8K+ucVpwdrBhxhjYqsfXvAzkSXQRalRd6sVq4X/icbvRTLbBY4VineQerVQyK LG9s0R86NGaRoZrHj/huyYDi9iBDccmAhkwD77pnxwMEtL2vDStpF4X7Ho2FLIo8GVuD 8obQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:dkim-signature; bh=KZvP4fL3Nz75ZyOFfSnsYpgH0MiazCjRnOKU1EHMPm8=; fh=xc4uBj5SGXawFekFHeBGIBMo5Muit/nCY6P9rn3+89c=; b=pDLhpg9eDbjjLE3XKtFZbylk9yxE9yatPpO+MvmzCC+9MNoB+xXZhCFjsBNFn730ie j5in0fQeulMYVkIBHlA8u3641AVpqXX540UCpauAp1p0VffMJor+hr6GBiP2dkqNHhDp IRUrVC6soHjX/ZkbrDd5NWG70OIERKKRfV9jE0yU3d4PIfDSoZeTqv7t1KBrZs4G07u6 EmdQjKYbgE/2AnZF0KLPKag+hrXc0dRnjHBmvAbDUKx5B6hNhLShxMVWDpYy0RYrudyn LnOBHey1YlCouYs7+8Vt332EslZY6Fp7ik2Ywcc2Q0Bnchcx+GWEdnXmR81WEmw/zqD4 NQBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="AtICvnj/"; spf=pass (google.com: domain of linux-kernel+bounces-2424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 37-20020a631665000000b005c18dd91684si15291152pgw.352.2023.12.16.17.08.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 17:08:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="AtICvnj/"; spf=pass (google.com: domain of linux-kernel+bounces-2424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8F5E4B23315 for ; Sun, 17 Dec 2023 01:08:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12003A3D; Sun, 17 Dec 2023 01:08:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="AtICvnj/" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 C0BBD7F4 for ; Sun, 17 Dec 2023 01:08:19 +0000 (UTC) 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-lj1-f174.google.com with SMTP id 38308e7fff4ca-2cc63b3ed71so6894991fa.3 for ; Sat, 16 Dec 2023 17:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1702775298; x=1703380098; darn=vger.kernel.org; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=KZvP4fL3Nz75ZyOFfSnsYpgH0MiazCjRnOKU1EHMPm8=; b=AtICvnj/OVGwwOt5zt4wNyDHbEdWlRqakgbuQ6TZxvOS32jXk6boHfvMdZJxhRdfYb XYfdSGO/1BqJVgI6Ci3IswEpTFidvF3k4T47EZJa2xYExVMAFs/Mq4vwsI5H6rZpkURF DGpYLJXC307vegjMxV6fbPwooYP6ZorFnc7oM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702775298; x=1703380098; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KZvP4fL3Nz75ZyOFfSnsYpgH0MiazCjRnOKU1EHMPm8=; b=mf4R20nIH8WJ2KKT4FwroS6E0N0aoWYFUPFdfpVVaC2Uwy70Rhg5LmB4zBYlleVdg2 dO1zTB1nQwmZsq3tahIf1olNYVgwjjp/rynn3AkitkGPtf0O1xcyshKILn14QtBvKIQy 2+cPs4nn44Ow7ZQMcJMm5ZprjlMIXL0Y9bNFCr/H9x7ti8FrJtwXgTnYptXyLcMyIu9L ZGWasDfswMbnFcYq4ix8gJtdiQB33DDVC/CGE8fCGRpBS0qQXAyuj1ZtKInSyHa4H78o JR9gA9VScb7qM6CawW3zk6uCB6kfvfiF1HqeHUU83nJrdCo5h1oEwK8IioGpZ6MUSekS 9/HQ== X-Gm-Message-State: AOJu0YyteQPrh3d2qB4lpN+pNF+TjUTutx1qLSFYzBO8Pa8DPSqF3ewG elreiO+qM6dr6MMhBnRZ+XuttguDWqMs3JttTse6EQ== X-Received: by 2002:a05:651c:2002:b0:2cc:30dd:1b59 with SMTP id s2-20020a05651c200200b002cc30dd1b59mr3443489ljo.84.1702775297334; Sat, 16 Dec 2023 17:08:17 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 17 Dec 2023 01:08:17 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20231214123752.v3.2.I7b83c0f31aeedc6b1dc98c7c741d3e1f94f040f8@changeid> References: <20231214123752.v3.1.I9d1afcaad76a3e2c0ca046dc4adbc2b632c22eda@changeid> <20231214123752.v3.2.I7b83c0f31aeedc6b1dc98c7c741d3e1f94f040f8@changeid> From: Stephen Boyd User-Agent: alot/0.10 Date: Sun, 17 Dec 2023 01:08:16 +0000 Message-ID: Subject: Re: [PATCH v3 2/2] drm/bridge: ti-sn65dsi86: Never store more than msg->size bytes in AUX xfer To: Douglas Anderson , dri-devel@lists.freedesktop.org Cc: Guenter Roeck , Andrzej Hajda , Daniel Vetter , David Airlie , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Robert Foss , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Quoting Douglas Anderson (2023-12-14 12:37:52) > For aux reads, the value `msg->size` indicates the size of the buffer > provided by `msg->buffer`. We should never in any circumstances write > more bytes to the buffer since it may overflow the buffer. > > In the ti-sn65dsi86 driver there is one code path that reads the > transfer length from hardware. Even though it's never been seen to be > a problem, we should make extra sure that the hardware isn't > increasing the length since doing so would cause us to overrun the > buffer. > > Fixes: 982f589bde7a ("drm/bridge: ti-sn65dsi86: Update reply on aux failures") > Signed-off-by: Douglas Anderson > --- Reviewed-by: Stephen Boyd