All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: [PATCH AUTOSEL 5.10 020/100] atomisp: don't let it go past pipes array
Date: Mon,  3 May 2021 12:37:09 -0400	[thread overview]
Message-ID: <20210503163829.2852775-20-sashal@kernel.org> (raw)
In-Reply-To: <20210503163829.2852775-1-sashal@kernel.org>

From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

[ Upstream commit 1f6c45ac5fd70ab59136ab5babc7def269f3f509 ]

In practice, IA_CSS_PIPE_ID_NUM should never be used when
calling atomisp_q_video_buffers_to_css(), as the driver should
discover the right pipe before calling it.

Yet, if some pipe parsing issue happens, it could end using
it.

So, add a WARN_ON() to prevent such case.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/staging/media/atomisp/pci/atomisp_fops.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c
index 453bb6913550..f1e6b2597853 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_fops.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c
@@ -221,6 +221,9 @@ int atomisp_q_video_buffers_to_css(struct atomisp_sub_device *asd,
 	unsigned long irqflags;
 	int err = 0;
 
+	if (WARN_ON(css_pipe_id >= IA_CSS_PIPE_ID_NUM))
+		return -EINVAL;
+
 	while (pipe->buffers_in_css < ATOMISP_CSS_Q_DEPTH) {
 		struct videobuf_buffer *vb;
 
-- 
2.30.2


  parent reply	other threads:[~2021-05-03 16:39 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 16:36 [PATCH AUTOSEL 5.10 001/100] drm: Added orientation quirk for OneGX1 Pro Sasha Levin
2021-05-03 16:36 ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 002/100] drm/qxl: do not run release if qxl failed to init Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 003/100] drm/qxl: release shadow on shutdown Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 004/100] drm/ast: Fix invalid usage of AST_MAX_HWC_WIDTH in cursor atomic_check Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 005/100] drm/amd/display: changing sr exit latency Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 006/100] drm/ast: fix memory leak when unload the driver Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 007/100] drm/amd/display: Check for DSC support instead of ASIC revision Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 008/100] drm/amd/display: Don't optimize bandwidth before disabling planes Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 009/100] drm/amdgpu/display: buffer INTERRUPT_LOW_IRQ_CONTEXT interrupt work Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.10 010/100] drm/amd/display/dc/dce/dce_aux: Remove duplicate line causing 'field overwritten' issue Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:36   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 011/100] scsi: lpfc: Fix incorrect dbde assignment when building target abts wqe Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 012/100] scsi: lpfc: Fix pt2pt connection does not recover after LOGO Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 013/100] drm/amdgpu: Fix some unload driver issues Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 014/100] sched/pelt: Fix task util_est update filtering Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 015/100] kvfree_rcu: Use same set of GFP flags as does single-argument Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 016/100] scsi: target: pscsi: Fix warning in pscsi_complete_cmd() Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 017/100] media: ite-cir: check for receive overflow Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 018/100] media: drivers: media: pci: sta2x11: fix Kconfig dependency on GPIOLIB Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 019/100] media: imx: capture: Return -EPIPE from __capture_legacy_try_fmt() Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` Sasha Levin [this message]
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 021/100] power: supply: bq27xxx: fix power_avg for newer ICs Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 022/100] extcon: arizona: Fix some issues when HPDET IRQ fires after the jack has been unplugged Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 023/100] extcon: arizona: Fix various races on driver unbind Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 024/100] media: media/saa7164: fix saa7164_encoder_register() memory leak bugs Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 025/100] media: gspca/sq905.c: fix uninitialized variable Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 026/100] media: pci: saa7164: Rudimentary spelling fixes in the file saa7164-types.h Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 027/100] power: supply: Use IRQF_ONESHOT Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 028/100] backlight: qcom-wled: Use sink_addr for sync toggle Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 029/100] backlight: qcom-wled: Fix FSC update issue for WLED5 Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 030/100] drm/bridge/analogix/anx78xx: Setup encoder before registering connector Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 031/100] drm/bridge/analogix/anx78xx: Cleanup on error in anx78xx_bridge_attach() Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 032/100] drm/amdgpu: mask the xgmi number of hops reported from psp to kfd Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 033/100] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 034/100] drm/amdgpu : Fix asic reset regression issue introduce by 8f211fe8ac7c4f Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 035/100] drm/amd/pm: fix workload mismatch on vega10 Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 036/100] drm/amd/display: Fix UBSAN warning for not a valid value for type '_Bool' Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 037/100] drm/amd/display: DCHUB underflow counter increasing in some scenarios Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 038/100] drm/amd/display: fix dml prefetch validation Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 039/100] scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats() Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 040/100] drm/vkms: fix misuse of WARN_ON Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 041/100] scsi: qla2xxx: Fix use after free in bsg Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 042/100] mmc: sdhci-esdhc-imx: validate pinctrl before use it Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 043/100] mmc: sdhci-pci: Add PCI IDs for Intel LKF Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 044/100] mmc: sdhci-brcmstb: Remove CQE quirk Sasha Levin
2021-05-03 16:37   ` Sasha Levin
2021-05-03 16:37 ` [PATCH AUTOSEL 5.10 045/100] ata: ahci: Disable SXS for Hisilicon Kunpeng920 Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210503163829.2852775-20-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab+huawei@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.