[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3b926b78-b95c-440d-846d-bc9d95aee714@suswa.mountain>
Date: Thu, 17 Jul 2025 17:30:08 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Abdelrahman Fekry <abdelrahmanfekry375@...il.com>
Cc: hansg@...nel.org, mchehab@...nel.org, sakari.ailus@...ux.intel.com,
andy@...nel.org, gregkh@...uxfoundation.org,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev, linux-kernel-mentees@...ts.linux.dev,
skhan@...uxfoundation.org
Subject: Re: [PATCH v3] staging: media: atomisp: add missing mutex lock in
atomisp_s_fmt_cap
On Thu, Jul 17, 2025 at 03:42:34PM +0300, Abdelrahman Fekry wrote:
> The function atomisp_set_fmt() modifies shared device state and expects
> callers to hold the isp->mutex for synchronization. While most internal
> callers correctly lock the mutex before invoking atomisp_set_fmt(), the
> V4L2 ioctl handler atomisp_s_fmt_cap() does not.
>
> This results in an unsafe execution path for VIDIOC_S_FMT ioctls
> (e.g. via v4l2-ctl), where shared structures such as pipe->pix and
> pipe->frame_info may be modified concurrently without proper protection.
>
> - Fix this by explicitly locking isp->mutex in atomisp_s_fmt_cap().
>
> Fixes: 4bdab80981ca ("media: atomisp: Make it possible to call atomisp_set_fmt() without a file handle")
> Signed-off-by: Abdelrahman Fekry <abdelrahmanfekry375@...il.com>
> ---
Thanks!
Reviewed-by: Dan Carpenter <dan.carpenter@...aro.org>
regards,
dan carpenter
Powered by blists - more mailing lists