From: Maximilian Luz <luzmaximilian@gmail.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Bingbu Cao <bingbu.cao@intel.com>,
Tianshu Qiu <tian.shu.qiu@intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: staging/intel-ipu3: Finalize subdev initialization to allcoate active state
Date: Wed, 7 Sep 2022 15:18:58 +0200 [thread overview]
Message-ID: <041a0915-3c7e-4768-29e1-02a46f347c04@gmail.com> (raw)
In-Reply-To: <a194a9c5-ac8e-cf86-34cd-4f3a3cb6f6ec@ideasonboard.com>
Hi,
On 9/7/22 14:46, Tomi Valkeinen wrote:
> Hi Maximilian,
>
> On 07/09/2022 15:33, Maximilian Luz wrote:
>> Commit f69952a4dc1e ("media: subdev: add active state to struct
>> v4l2_subdev") introduced the active_state member to struct v4l2_subdev.
>> This state needs to be allocated via v4l2_subdev_init_finalize(). The
>> intel-ipu3 driver unfortunately does not do that, due to which,
>
> That is fine, a driver only needs to allocate the active state if it uses
> the active state.
>
>> active_state is NULL and we run into an oops (NULL pointer dereference)
>> when that state is accessed.
>>
>> In particular, this happens subdev in IOCTLs as commit 3cc7a4bbc381
>> ("media: subdev: pass also the active state to subdevs from ioctls")
>> passes that state on to the subdev IOCTLs. An example scenario where
>> this happens is running libcamera's qcam or cam on a device with IPU3,
>> for example the Microsoft Surface Book 2. In this case, the oops is
>> reproducibly in v4l2_subdev_get_try_crop(), called via
>> imgu_subdev_set_selection().
>>
>> To fix this, allocate the active_state member via
>> v4l2_subdev_init_finalize().
>
> This is not a correct fix. Sakari has sent (and maybe pushed?) this:
>
> https://lore.kernel.org/all/20220825190351.3241444-1-sakari.ailus@linux.intel.com/
Thanks! Unfortunately that doesn't fix the issue completely: That patch
addresses imgu_subdev_get_selection() but imgu_subdev_set_selection()
still runs into the oops.
I assume a similar fix to the one you linked is needed? I'll give that a
try.
Regards,
Max
prev parent reply other threads:[~2022-09-07 13:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 12:33 Maximilian Luz
2022-09-07 12:46 ` Tomi Valkeinen
2022-09-07 13:09 ` Laurent Pinchart
2022-09-07 13:18 ` Maximilian Luz [this message]
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=041a0915-3c7e-4768-29e1-02a46f347c04@gmail.com \
--to=luzmaximilian@gmail.com \
--cc=bingbu.cao@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jacopo+renesas@jmondi.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tian.shu.qiu@intel.com \
--cc=tomi.valkeinen@ideasonboard.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®