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=oXxeTunha9S50Tgs4O9qTnc592YLJ98kE8I/4odRDxa0kbwZgQcLzajkpKZcQIDSGni0 nWbZ044WSJ+MINDXRWTYL2pcPcwy94okIF2dLCugP0/rLAaVB/yQjTJZtPyA0dlKS4IRO 8WQyNpnVu6wbBY17dL6hUEOQFS93R3SsxPJz8xO/kvi6seXZnFKuQseeJRwTIDg9Q2Eaj f7GWBO5KcO7S2T1dY/obpkG8dRKQATjwLVePb1aIdEL1AGU1510p7VQ03Qu/qdirQxIez 8zr0FumiyQjex83H+GPuvRS/Afctuzd5GmKWW5K76fTgAQOlST0VIrbH0bTVnH0wpKg== 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=Mmal1pLnSV9EC/Imz7ZEFU6POmAOVpSVmJ30NHc2GljPHxM1m79J8fj4zCLUBEsbgV0q oQzj1PqjKJZU2eZ65ZEmq2v05KfrcmH3Sz72xNEQ2kRtjTb7vYaOfPhIp+qIPvQmhX/ke /v0CKuNdxTbJ5bD//O4tIZq+XJo1+rK2Ko89AKNdT/mws0vajxUOvcT+pK9nmhH05hllm vJWVArUKFVSq7cxaBeeign1QFjDBeyY1Fyk8uWjeu3JUO0yADSLNYAf2uG6X4M+Fu1gUE De50NO5k/kLHjnpvF2mEZhCVbjW/JMjWumLKwOttBjZCORXjRdLtNHfvavS62cQ622w== 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 C07EA606A32E for ; Tue, 1 Dec 2026 20:57:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C07EA606A32E 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-3869c1f4d19so3160636eec.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=Pa/n6MrCUvSxLtHV606kV03Ha0DRIXPxGDsBgortjr1rgVvabQ44OIxzSNkvnFW2uV LYWZr2qd5RMrxf2qtLTsp59MW+Zt9xzub32g15yjKM390VV44eJmVzdC+jQEib7ne7/j nqsAj3TEw1Z2RT0YgFQ1j5JBQesUlfkFXFBE/X9PnT5xKqbCsf7IqVGLblr6NAKCLcmY EEfRRF5Fyi1OFpip2jEE0/Noyo9Hg+r+nL2E4yda6IRzZCvNwhQpDWZwpYtfAzmhN4/b QkYC3+dRw/YZFZvL862vVfY9zk6/2pQSThA9FAZoGNvq+p3DpmCUNnuh4hL+uDF+EA+t 41rw== X-Forwarded-Encrypted: i=1; AL+hErH//jjQUve+av54bC648P4MsPVgaAMr0VJClFYJyxvR8I4bbN7h0+6vcoMCDAL80dPXH82t70hxNWmegd3H@vger.kernel.org X-Gm-Message-State: APuU4Z/gYpDSyJx9qr+LHQreGfkDF8sTAnyRvqBAEcBIj8r0hLKnlWwC QJ81X095zgExA8oh7mO0X0ULUexvrr/mwC9zF4h+8TfAxDceMIjNzhYp X-Gm-Gg: AZFdTZc5dLF5LzpCounWYk5lbJUObI2S57XcKXu9lbUNBJ2huec4Hcccz8CaiKQ8ffW IlCeehy0E1iXVK88I3jMsxpn60RkOXPYUlhHr/Z2SAeJd733sIcPVTnpHe8jh89xdMpXLzOWsm4 e7I+xcO2GYNeiih/iiHIucyiAEXqwDE4AyQEDckoFMndb+MlivQyW0xWvVpTtYW1e3aw4FmIpsU eQMxRbJrWHWMFNr4+LhmvVkWmT5tDKQn5VcC0oXkS1cvmKW3Tqxmo/m+ZfGkATP/67hGaglBxRQ e22+8Fc1AeQ4dcKgTfMos7XH1RjwBj9KOJtYejkoSo2oVt2bWGVU6bGEthSloA6iu887vAFwXYW c+UUaotEklPAMdOce1xWi8OKetPTKqw6zzNQ+UsyAFmGCSlULdv8sj2A15xf5SHULYSxj9EwT02 ZNsQiVqQapx/WqkCif9R5+1lgd2Y10IOo4lC3+6mV/gmIkM91eF2JOfCQ0RpESkBJTfujrk6nfv hGTu4dPeM9kARRPzVRybx+CLE5uNBy9Zm9fi0tVSXQkhESfr0dwH1M6nha2e48hoXsOvrdsdHuZ rbet5t8JZa0ONYiIlBc6YKh6WxkYoCmuOYghgzaHkwQgN2SQIC6poVLMijibdjEPfvqo+lTEUN6 dF242v28e2y9YWzu7xExA5Rba5sMWnblebM7iFBHALQ== 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-arm-msm@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