<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/arm/display, branch v5.10.185</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.185</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.185'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-06-09T08:21:01+00:00</updated>
<entry>
<title>drm/komeda: Fix an undefined behavior bug in komeda_plane_add()</title>
<updated>2022-06-09T08:21:01+00:00</updated>
<author>
<name>Zhou Qingyang</name>
<email>zhou1615@umn.edu</email>
</author>
<published>2021-12-01T03:37:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=78a3e9fcdb7b1712de30d9d248bf19cee6a890b0'/>
<id>urn:sha1:78a3e9fcdb7b1712de30d9d248bf19cee6a890b0</id>
<content type='text'>
[ Upstream commit f5e284bb74ab296f98122673c7ecd22028b2c200 ]

In komeda_plane_add(), komeda_get_layer_fourcc_list() is assigned to
formats and used in drm_universal_plane_init().
drm_universal_plane_init() passes formats to
__drm_universal_plane_init(). __drm_universal_plane_init() further
passes formats to memcpy() as src parameter, which could lead to an
undefined behavior bug on failure of komeda_get_layer_fourcc_list().

Fix this bug by adding a check of formats.

This bug was found by a static analyzer. The analysis employs
differential checking to identify inconsistent security operations
(e.g., checks or kfrees) between two code paths and confirms that the
inconsistent operations are not recovered in the current function or
the callers, so they constitute bugs.

Note that, as a bug found by static analysis, it can be a false
positive or hard to trigger. Multiple researchers have cross-reviewed
the bug.

Builds with CONFIG_DRM_KOMEDA=m show no new warnings,
and our static analyzer no longer warns about this code.

Fixes: 61f1c4a8ab75 ("drm/komeda: Attach komeda_dev to DRM-KMS")
Signed-off-by: Zhou Qingyang &lt;zhou1615@umn.edu&gt;
Signed-off-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Link: https://lore.kernel.org/dri-devel/20211201033704.32054-1-zhou1615@umn.edu
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/komeda: return early if drm_universal_plane_init() fails.</title>
<updated>2022-06-09T08:20:50+00:00</updated>
<author>
<name>Liviu Dudau</name>
<email>liviu.dudau@arm.com</email>
</author>
<published>2021-12-02T17:00:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c977d63b8cc45a1ca4ce438c072af43af6f4aa6b'/>
<id>urn:sha1:c977d63b8cc45a1ca4ce438c072af43af6f4aa6b</id>
<content type='text'>
[ Upstream commit c8f76c37cc3668ee45e081e76a15f24a352ebbdd ]

If drm_universal_plane_init() fails early we jump to the common cleanup code
that calls komeda_plane_destroy() which in turn could access the uninitalised
drm_plane and crash. Return early if an error is detected without going through
the common code.

Reported-by: Steven Price &lt;steven.price@arm.com&gt;
Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;
Signed-off-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Link: https://lore.kernel.org/dri-devel/20211203100946.2706922-1-liviu.dudau@arm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/komeda: Fix bit check to import to value of proper type</title>
<updated>2021-05-11T12:47:26+00:00</updated>
<author>
<name>Carsten Haitzler</name>
<email>carsten.haitzler@arm.com</email>
</author>
<published>2021-02-04T13:11:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7f9757005cf5e7416f2ce6af82b788eea410dcbe'/>
<id>urn:sha1:7f9757005cf5e7416f2ce6af82b788eea410dcbe</id>
<content type='text'>
[ Upstream commit be3e477effba636ad25dcd244db264c6cd5c1f36 ]

KASAN found this problem. find_first_bit() expects to look at a
pointer pointing to a long, but we look at a u32 - this is going to be
an issue with endianness but, KSAN already flags this as out-of-bounds
stack reads. This fixes it by just importing inot a local long.

Signed-off-by: Carsten Haitzler &lt;carsten.haitzler@arm.com&gt;
Acked-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Signed-off-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20201218150812.68195-1-carsten.haitzler@foss.arm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/atomic-helper: reset vblank on crtc reset</title>
<updated>2020-07-02T18:25:51+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-06-12T16:00:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=51f644b40b4b794b28b982fdd5d0dd8ee63f9272'/>
<id>urn:sha1:51f644b40b4b794b28b982fdd5d0dd8ee63f9272</id>
<content type='text'>
Only when vblanks are supported ofc.

Some drivers do this already, but most unfortunately missed it. This
opens up bugs after driver load, before the crtc is enabled for the
first time. syzbot spotted this when loading vkms as a secondary
output. Given how many drivers are buggy it's best to solve this once
and for all in shared helper code.

Aside from moving the few existing calls to drm_crtc_vblank_reset into
helpers (i915 doesn't use helpers, so keeps its own) I think the
regression risk is minimal: atomic helpers already rely on drivers
calling drm_crtc_vblank_on/off correctly in their hooks when they
support vblanks. And driver that's failing to handle vblanks after
this is missing those calls already, and vblanks could only work by
accident when enabling a CRTC for the first time right after boot.

Big thanks to Tetsuo for helping track down what's going wrong here.

There's only a few drivers which already had the necessary call and
needed some updating:
- komeda, atmel and tidss also needed to be changed to call
  __drm_atomic_helper_crtc_reset() intead of open coding it
- tegra and msm even had it in the same place already, just code
  motion, and malidp already uses __drm_atomic_helper_crtc_reset().
- Laurent noticed that rcar-du and omap open-code their crtc reset and
  hence would actually be broken by this patch now. So fix them up by
  reusing the helpers, which brings the drm_crtc_vblank_reset() back.

Only call left is in i915, which doesn't use drm_mode_config_reset,
but has its own fastboot infrastructure. So that's the only case where
we actually want this in the driver still.

I've also reviewed all other drivers which set up vblank support with
drm_vblank_init. After the previous patch fixing mxsfb all atomic
drivers do call drm_crtc_vblank_on/off as they should, the remaining
drivers are either legacy kms or legacy dri1 drivers, so not affected
by this change to atomic helpers.

v2: Use the drm_dev_has_vblank() helper.

v3: Laurent pointed out that omap and rcar-du used drm_crtc_vblank_off
instead of drm_crtc_vblank_reset. Adjust them too.

v4: Laurent noticed that rcar-du and omap open-code their crtc reset
and hence would actually be broken by this patch now. So fix them up
by reusing the helpers, which brings the drm_crtc_vblank_reset() back.

v5: also mention rcar-du and ompadrm in the proper commit message
above (Laurent).

Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@collabora.com&gt;
Acked-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Acked-by: Thierry Reding &lt;treding@nvidia.com&gt;
Link: https://syzkaller.appspot.com/bug?id=0ba17d70d062b2595e1f061231474800f076c7cb
Reported-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Reported-by: syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com
Cc: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Cc: "James (Qian) Wang" &lt;james.qian.wang@arm.com&gt;
Cc: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Cc: Mihail Atanassov &lt;mihail.atanassov@arm.com&gt;
Cc: Brian Starkey &lt;brian.starkey@arm.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: Boris Brezillon &lt;bbrezillon@kernel.org&gt;
Cc: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt;
Cc: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Cc: Ludovic Desroches &lt;ludovic.desroches@microchip.com&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Maxime Ripard &lt;mripard@kernel.org&gt;
Cc: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Cc: Jonathan Hunter &lt;jonathanh@nvidia.com&gt;
Cc: Jyri Sarha &lt;jsarha@ti.com&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: Brian Masney &lt;masneyb@onstation.org&gt;
Cc: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Cc: zhengbin &lt;zhengbin13@huawei.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-tegra@vger.kernel.org
Cc: Kieran Bingham &lt;kieran.bingham+renesas@ideasonboard.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-renesas-soc@vger.kernel.org
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200612160056.2082681-1-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm/komeda: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE</title>
<updated>2020-06-10T07:03:54+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2020-06-05T07:32:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fb1f7881a5f7cf500f8365d33bac1e4563b69464'/>
<id>urn:sha1:fb1f7881a5f7cf500f8365d33bac1e4563b69464</id>
<content type='text'>
DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE sets the functions in
struct drm_driver to their defaults. No functional changes are
made.

v2:
	* update for DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200605073247.4057-21-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/komeda: Use GEM CMA object functions</title>
<updated>2020-06-10T07:03:46+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2020-06-05T07:32:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ea528b0963040273471dc904bf8b0a243741d9f'/>
<id>urn:sha1:1ea528b0963040273471dc904bf8b0a243741d9f</id>
<content type='text'>
Create GEM objects with drm_gem_cma_create_object_default_funcs(), which
allocates the object and sets CMA's default object functions. Corresponding
callbacks in struct drm_driver are cleared. No functional changes are made.

Driver and object-function instances use the same callback functions, with
the exception of vunmap. The implementation of vunmap is empty and left out
in CMA's default object functions.

v3:
	* convert to DRIVER_OPS macro in a separate patch

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200605073247.4057-20-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/arm: remove _unlocked suffix in drm_gem_object_put_unlocked</title>
<updated>2020-05-19T21:31:31+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2020-05-15T09:50:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=38e7abf7e91744bcbe9b3a6e86f3c11edc9f478c'/>
<id>urn:sha1:38e7abf7e91744bcbe9b3a6e86f3c11edc9f478c</id>
<content type='text'>
Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.

Just drop the suffix. It makes the API cleaner.

Done via the following script:

__from=drm_gem_object_put_unlocked
__to=drm_gem_object_put
for __file in $(git grep --name-only $__from); do
  sed -i  "s/$__from/$__to/g" $__file;
done

Cc: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Cc: Brian Starkey &lt;brian.starkey@arm.com&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Acked-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-16-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm/komeda: use devm_drm_dev_alloc</title>
<updated>2020-04-28T14:04:00+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-04-15T07:40:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=843ef624a491fabc3f0829c341a33fc4cc008000'/>
<id>urn:sha1:843ef624a491fabc3f0829c341a33fc4cc008000</id>
<content type='text'>
Komeda uses the component framework, which does open/close a new
devres group around all the bind callbacks. Which means we can use
devm_ functions for managing the drm_device cleanup, with leaking
stuff in case of deferred probes or other reasons to unbind
components, or the component_master.

Also note that this fixes a double-free in the probe unroll code, bot
drm_dev_put and kfree(kms) result in the kms allocation getting freed.

Aside: komeda_bind could be cleaned up a lot, devm_kfree is a bit
redundant. Plus I'm not clear on why there's suballocations for
mdrv-&gt;mdev and mdrv-&gt;kms. Plus I'm not sure the lifetimes are correct
with all that devm_kzalloc usage ... That structure layout is also the
reason why komeda still uses drm_device-&gt;dev_private and can't easily
be replaced with a proper container_of upcasting. I'm pretty sure that
there's endless amounts of hotunplug/hotremove bugs in there with all
the unprotected dereferencing of drm_device-&gt;dev_private.

Reviewed-by: James Qian Wang &lt;james.qian.wang@arm.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: "James (Qian) Wang" &lt;james.qian.wang@arm.com&gt;
Cc: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Cc: Mihail Atanassov &lt;mihail.atanassov@arm.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-33-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>Merge drm/drm-next into drm-misc-next</title>
<updated>2020-04-17T06:12:22+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2020-04-17T06:12:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08d99b2c23dfa84ca5b5e5c194062a0550888b71'/>
<id>urn:sha1:08d99b2c23dfa84ca5b5e5c194062a0550888b71</id>
<content type='text'>
Backmerging required to pull topic/phy-compliance.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
</content>
</entry>
<entry>
<title>drm/&lt;drivers&gt;: Use drmm_add_final_kfree</title>
<updated>2020-03-26T14:26:52+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-03-23T14:49:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=780e41edf8908eed5db956508b9f114acba4392d'/>
<id>urn:sha1:780e41edf8908eed5db956508b9f114acba4392d</id>
<content type='text'>
These are the leftover drivers that didn't have a -&gt;release hook that
needed to be updated.

Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Acked-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: "James (Qian) Wang" &lt;james.qian.wang@arm.com&gt;
Cc: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Cc: Mihail Atanassov &lt;mihail.atanassov@arm.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-19-daniel.vetter@ffwll.ch
</content>
</entry>
</feed>
