From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.7 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796158624; b=UFpTA7lbA+IJPmGDcPxA80PhaC6Ot4Agr+clF7B2YmyPWiJbbFEdxxFzureomgXoT3dx +7OYX8ltmKDHiv7UiQTggadew+v+bebVm48z8aHsxTuuUy+VX7xIKZurq7E4P1siKdDWR XMb256J7ROWpN6mVV8dREC8pb9LMRwy5/z4Kjxcao1Ext7jk9C46q32N4DwIQ02fY82iz RBmgdui5rhnhRt6IuwqGoqOVSr8AwhXmVBS46dArduVSfSWj9Uhgb8HKOzwv7BGePpKxd aY9x1KGBP+vDm4Q+kjYrTbQDFaFUi1+nk9T7tTV2/clza6tzdJrWCC2Osp0uhIczcWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796158624; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=rH6wBu1gy/DKvyPFN7UFjjM+fwCl3BThsj7JvRwOfN0=; b=PjM5XqnIxFzK1YxLzX/CP5c7Jxu7LE6FqVdXhajdG9yLq3xYCa5+6ZyvsEIpEaxDT6hc 7d4PTb0fZ/U62AhUjWh9LHsU8Eaik0WF+g/wouUK8zz5FKvulRszj8OPOaqNqxw+l0joM 8SnDgsbMMLDj6GpMKeWeipHOQxiTw50V1VzelzvQuYshdm/WQ4M7FrDmjbmkWsK4WmJsT 8EwgZgcJc0d+fTefnkr0NptJSzR98zD9OmVrTVh+ezwvxk+os/NtRENuDfQtVAp7jGBk7 r4dQdK06t0ySB38VmiQMq3/1ojjhpd7FMkggXHxdtmoMEHeQKEJcCRnwBe/r+OZ5ffA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=BMxH2c3W; arc=none smtp.remote-ip=74.125.229.7 Received: from mail-dy2-f7.google.com (mail-dy2-f7.google.com [74.125.229.7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C08B1606A32F for ; Tue, 1 Dec 2026 20:57:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C08B1606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=BMxH2c3W Received: by mail-dy2-f7.google.com with SMTP id 5a478bee46e88-3869c1f4d19so3160635eec.0 for ; Tue, 01 Dec 2026 12:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796158623; x=1796763423; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=rH6wBu1gy/DKvyPFN7UFjjM+fwCl3BThsj7JvRwOfN0=; b=BMxH2c3W5V9osxprBXXRAooyJpTc+7V60au1zl6X6DZ+RSTQjw221VPCE/4rWyqZux uZAEf6zeMHaeA64A6Y9d8CaFehRaOrF4ufzjZwM9vIZsG0PNBu3s4t2v2VhlDUykbKA6 fLZu4F1NwF9QGOy+gJRUI7HZz7pTP1YCRXfEq5z9zCoBNzRdr+eWKJgx4SVZRFPFyHPv qp/3joQwe8RC6RiFIvef0DN/ymgLnUwZMvG+G/5Np5YZ6GwyUyVUo3SJZjXB5+/sz+Jg Y7WZmcnupL2KgP2UX8bQCbjbS2+MNZbLtzTur01PdBhpUmqPcacaGQJp4kx8JcfFhHhH mKYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796158623; x=1796763423; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=rH6wBu1gy/DKvyPFN7UFjjM+fwCl3BThsj7JvRwOfN0=; b=2WJhMc78NGJ7tkPLKzgkZQe+sez5t11ImA6Vamk+QTYTTC94V9GSq4SbC/b8wibFRb BVMI7jq3nu+8GV/X9s8K2pqISY4g/jplbVuie3cSFTsgYIqgDBXZsoYO2wv34GaMxZ6q t4bMHSX03yAZpmi97EXiP5kWzhJm2G9fv73tdlC17hzhYW8MqKRe7XPQlq0FJ0R0pt4e BHKjr+aYGKKd4jDgnSkhH9a/huSrbHJZoj7fWBrssK/6UHt4Eh2VoOtyyIQd8ORmoDTW FukU01sqB9EiV7+CnWte5ETd2eADD3auWFQwrYSv3HhWCQUzWBmP7L109s1E+msbgoU4 PkLg== X-Forwarded-Encrypted: i=1; AL+hErFl85C26Mjp8msLM750GWVmgMMcNWtEiAWMeRNtNse9K6Cmx7ULGgH6MhkSY5lngB6CPhM0yVCaljNP8QA=@vger.kernel.org X-Gm-Message-State: APuU4Z+ZlfjtVD7fQaNdel/3pNzLfNUzBWEPrCvuS6SA90PLT17O7fhS cnIVliRWsGz5WXT8Mmy5R3E0eQzfssyv30S6VwG8tUKydpfCFvnzOiVh X-Gm-Gg: AZFdTZf1JluM9nm5P+W1mo3zx+uiEYGG11avFfpefJSAmnucyfX7FCJMJSL+pXNh070 uyLDOD9faHZT8/q+OLH+LMIWZoL+D06a8x0a/WHR4JIM+t4dMvZKrtgNt3tW4snm0h7yrBDPjme lviiRxQXfUzRAvtMmEnMs5/R94i1oZ88/6F+ak/Ackee7ELmy+4QT7qThumhgwEY6zji7zSS5ri vTIVu6O6vIKZ0nZJdPtjg7rwr9lSV+UtlV6jxa9BkCZeWms49qHlpLWDbWFf3gOlZCXYuHW0JQo tS2UBDrarR8JJja6ugboOcsr0p4ENwUKBH13qvQYh27aPHcUjRtsIJfNHfbo5voMz30+tkVsQdG +O0w03eJybgsa2erD2nf/SVZiYDWndNeGs1ihG0Ibgv7oIMezAKrgMcVYHpOcjgLr+JPoO5jc1c Ol3Y4fL7Qilc6cykwQlNHU4/I3OuQCV6QMNT6Zd1+J3Zj0wV3V9WFWEOB+xX7Cxlh8pa5HrlCaU +iR9u8TmbpGu3KE354BCOpcXfIrP1NYcQ7cXWtHQ4OojX5bdVQxPR4p8MH6QGX2fh8+k3xuB/j/ 9qxk+qs9qtJjDBoDIOJNXLXTKF4vPpchhWM631/PaXRzOHnYwwmR88sB4RAk/K+AC0BdoRhg/Dz aJRsv6v7h28x9J8eKWzOFo4LUW4AdvOQ5qieybLIlrQ== X-Received: by 2002:a05:7022:3c04:b0:188:e51:e86a with SMTP id a92af1059eb24-1b5567dd1c8mr29015928c88.2.1796158622689; Tue, 01 Dec 2026 12:57:02 -0800 (PST) Received: from localhost.localdomain ([76.33.234.50]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5567ff27bsm103208079c88.6.2026.12.01.12.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 12:57:02 -0800 (PST) From: Hungyu Lin To: vikash.garodia@oss.qualcomm.com, dikshita.agarwal@oss.qualcomm.com Cc: abhinav.kumar@linux.dev, bod@kernel.org, konrad.dybcio@oss.qualcomm.com, mchehab@kernel.org, hverkuil@kernel.org, stefan.schmidt@linaro.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dennylin0707@gmail.com, Bryan O'Donoghue Subject: [PATCH v3 1/3] media: iris: reject packets that are smaller than the size field Date: Tue, 1 Dec 2026 20:56:40 +0000 Message-ID: <20261201205642.32436-2-dennylin0707@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261201205642.32436-1-dennylin0707@gmail.com> References: <20261201205642.32436-1-dennylin0707@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit iris_hfi_queue_read() only rejects a packet size of zero. For a size of 1 to 3 it copies less than the size field, returns success and leaves the read index where it was, because the index counts 32-bit words. The gen1 response handler drops such a packet and reads the queue again, so it gets the same entry again and again and the interrupt thread does not return. venus_read_queue() converts the size to words before it checks it for zero. Reject a size that is smaller than one word here as well. Fixes: fb583a214337 ("media: iris: introduce host firmware interface with necessary hooks") Cc: stable@vger.kernel.org Signed-off-by: Hungyu Lin Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/iris/iris_hfi_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_queue.c b/drivers/media/platform/qcom/iris/iris_hfi_queue.c index bf6db23b53e2..12a7fd0982c5 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_queue.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_queue.c @@ -81,7 +81,7 @@ static int iris_hfi_queue_read(struct iris_iface_q_info *qinfo, void *packet) return -ENODATA; packet_size = *read_ptr; - if (!packet_size) + if (packet_size < sizeof(u32)) return -EINVAL; new_read_idx = read_idx + packet_size; -- 2.43.0