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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ec3c1d7b-231a-862f-ce12-8ac4c9616ca5@linux.intel.com>
Date:   Fri, 1 Nov 2019 19:33:12 +0100
From:   Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
To:     Rob Clark <robdclark@...il.com>, dri-devel@...ts.freedesktop.org
Cc:     Sean Paul <seanpaul@...omium.org>,
        Rob Clark <robdclark@...omium.org>,
        Maxime Ripard <mripard@...nel.org>,
        Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] drm/atomic: clear new_state pointers at hw_done

Op 01-11-2019 om 19:07 schreef Rob Clark:
> From: Rob Clark <robdclark@...omium.org>
>
> The new state should not be accessed after this point.  Clear the
> pointers to make that explicit.
>
> This makes the error corrected in the previous patch more obvious.
>
> Signed-off-by: Rob Clark <robdclark@...omium.org>

Would be nice if you could cc intel-gfx@...ts.freedesktop.org next time, so I know our CI infrastructure is happy;

It wouldn't surprise me if it catches 1 or 2 abuses in i915.

Otherwise Reviewed-by: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>

Perhaps you could mail this to version to intel-gfx-trybot@...ts.freedesktop.org using git-send-email so we at least get i915 results?

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 732bd0ce9241..176831df8163 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2234,13 +2234,42 @@ EXPORT_SYMBOL(drm_atomic_helper_fake_vblank);
>   */
>  void drm_atomic_helper_commit_hw_done(struct drm_atomic_state *old_state)
>  {
> +	struct drm_connector *connector;
> +	struct drm_connector_state *old_conn_state, *new_conn_state;
>  	struct drm_crtc *crtc;
>  	struct drm_crtc_state *old_crtc_state, *new_crtc_state;
> +	struct drm_plane *plane;
> +	struct drm_plane_state *old_plane_state, *new_plane_state;
>  	struct drm_crtc_commit *commit;
> +	struct drm_private_obj *obj;
> +	struct drm_private_state *old_obj_state, *new_obj_state;
>  	int i;
>  
> +	/*
> +	 * After this point, drivers should not access the permanent modeset
> +	 * state, so we also clear the new_state pointers to make this
> +	 * restriction explicit.
> +	 *
> +	 * For the CRTC state, we do this in the same loop where we signal
> +	 * hw_done, since we still need to new_crtc_state to fish out the
> +	 * commit.
> +	 */
> +
> +	for_each_oldnew_connector_in_state(old_state, connector, old_conn_state, new_conn_state, i) {
> +		old_state->connectors[i].new_state = NULL;
> +	}
> +
> +	for_each_oldnew_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) {
> +		old_state->planes[i].new_state = NULL;
> +	}
> +
> +	for_each_oldnew_private_obj_in_state(old_state, obj, old_obj_state, new_obj_state, i) {
> +		old_state->private_objs[i].new_state = NULL;
> +	}
> +
>  	for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) {
>  		old_state->crtcs[i].new_self_refresh_active = new_crtc_state->self_refresh_active;
> +		old_state->crtcs[i].new_state = NULL;
>  
>  		commit = new_crtc_state->commit;
>  		if (!commit)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ