All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/vc4: Fix NULL pointer dereference in the async update path
Date: Tue, 13 Nov 2018 13:24:07 -0800	[thread overview]
Message-ID: <87r2follhk.fsf@anholt.net> (raw)
In-Reply-To: <20181113094914.22353-1-boris.brezillon@bootlin.com>


[-- Attachment #1.1: Type: text/plain, Size: 1016 bytes --]

Boris Brezillon <boris.brezillon@bootlin.com> writes:

> vc4_plane_atomic_async_update() calls vc4_plane_atomic_check()
> which in turn calls vc4_plane_setup_clipping_and_scaling(), and since
> commit 58a6a36fe8e0 ("drm/vc4: Use
> drm_atomic_helper_check_plane_state() to simplify the logic"), this
> function accesses plane_state->state which will be NULL when called
> from the async update path since we're passing previous plane state,
> and plane_state->state has been assigned to NULL in
> drm_atomic_helper_swap_state().
>
> Assign plane->state->state to new_plane_state->state before calling
> vc4_plane_atomic_check() and reset it to NULL after
> vc4_plane_atomic_check() as returned.
>
> Fixes: 58a6a36fe8e0 ("drm/vc4: Use drm_atomic_helper_check_plane_state() to simplify the logic")
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>

Hmm.  Could we pass in the new state instead, and then pick the dlist
items out of the new state's dlist to write into both our dlist copy and
the hw dlist?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-11-13 21:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13  9:49 [PATCH 1/2] drm/vc4: Fix NULL pointer dereference in the async update path Boris Brezillon
2018-11-13  9:49 ` [PATCH 2/2] drm/vc4: Set ->legacy_cursor_update to false when doing non-async updates Boris Brezillon
2018-11-13 21:18   ` Eric Anholt
2018-11-13 21:18     ` Eric Anholt
2018-11-13 21:24 ` Eric Anholt [this message]
2018-11-13 22:18   ` [PATCH 1/2] drm/vc4: Fix NULL pointer dereference in the async update path Boris Brezillon

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=87r2follhk.fsf@anholt.net \
    --to=eric@anholt.net \
    --cc=boris.brezillon@bootlin.com \
    --cc=dri-devel@lists.freedesktop.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.