lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260205043730.3856488-1-n7l8m4@u.northwestern.edu>
Date: Thu,  5 Feb 2026 04:37:30 +0000
From: Ziyi Guo <n7l8m4@...orthwestern.edu>
To: Hans de Goede <hansg@...nel.org>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Andy Shevchenko <andy@...nel.org>
Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-media@...r.kernel.org,
	linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Ziyi Guo <n7l8m4@...orthwestern.edu>
Subject: [PATCH] media: atomisp: add missing mutex in atomisp_vidioc_default()

atomisp_vidioc_default() calls atomisp_exp_id_unlock(),
atomisp_exp_id_capture(), and atomisp_inject_a_fake_event() without
holding isp->mutex. However, all three functions have
lockdep_assert_held(&isp->mutex) indicating callers must hold this lock.

Other ioctl handlers in the same driver (e.g., atomisp_start_streaming)
properly acquire the mutex before operating on ISP state.

Add mutex_lock()/mutex_unlock() around these three ioctl cases to fix the
missing lock protection.

Signed-off-by: Ziyi Guo <n7l8m4@...orthwestern.edu>
---
 drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index bb8b2f2213b0..ab13630c8149 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -1521,10 +1521,14 @@ static long atomisp_vidioc_default(struct file *file, void *fh,
 		break;
 
 	case ATOMISP_IOC_EXP_ID_UNLOCK:
+		mutex_lock(&asd->isp->mutex);
 		err = atomisp_exp_id_unlock(asd, arg);
+		mutex_unlock(&asd->isp->mutex);
 		break;
 	case ATOMISP_IOC_EXP_ID_CAPTURE:
+		mutex_lock(&asd->isp->mutex);
 		err = atomisp_exp_id_capture(asd, arg);
+		mutex_unlock(&asd->isp->mutex);
 		break;
 	case ATOMISP_IOC_S_ENABLE_DZ_CAPT_PIPE:
 		err = atomisp_enable_dz_capt_pipe(asd, arg);
@@ -1537,7 +1541,9 @@ static long atomisp_vidioc_default(struct file *file, void *fh,
 		err = atomisp_formats(asd, 1, arg);
 		break;
 	case ATOMISP_IOC_INJECT_A_FAKE_EVENT:
+		mutex_lock(&asd->isp->mutex);
 		err = atomisp_inject_a_fake_event(asd, arg);
+		mutex_unlock(&asd->isp->mutex);
 		break;
 	case ATOMISP_IOC_S_ARRAY_RESOLUTION:
 		err = atomisp_set_array_res(asd, arg);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ