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: <CADnq5_NQnQoheKv39DiuLjKY3Z83WpesrFRUO4FMdrn=YPhnSQ@mail.gmail.com>
Date:   Mon, 25 Sep 2023 10:57:12 -0400
From:   Alex Deucher <alexdeucher@...il.com>
To:     imre.deak@...el.com
Cc:     Lyude Paul <lyude@...hat.com>, Jani Nikula <jani.nikula@...el.com>,
        Jeff Layton <jlayton@...nel.org>, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org, Wayne Lin <Wayne.Lin@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Ramya SR <quic_rsr@...cinc.com>
Subject: Re: [PATCH v1] drm/dp/mst: fix missing modeset unlock for MST port detect

On Fri, Sep 22, 2023 at 3:22 PM Imre Deak <imre.deak@...el.com> wrote:
>
> On Fri, Sep 22, 2023 at 03:02:23PM -0400, Lyude Paul wrote:
> >
> > Oh! wow thank you for catching this:
> >
> > Reviewed-by: Lyude Paul <lyude@...hat.com>
> >
> > I will go and push this to drm-misc-next in just a moment
> >
> > On Fri, 2023-09-15 at 10:24 +0530, Ramya SR wrote:
> > > Modeset mutex unlock is missing in drm_dp_mst_detect_port function.
> > > This will lead to deadlock if calling the function multiple times in
> > > an atomic operation, for example, getting imultiple MST ports status
> > > for a DP MST bonding scenario.
> > >
> > > Signed-off-by: Ramya SR <quic_rsr@...cinc.com>
> > > ---
> > >  drivers/gpu/drm/display/drm_dp_mst_topology.c | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > > index ed96cfc..d6512c4 100644
> > > --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > > +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > > @@ -4154,7 +4154,7 @@ drm_dp_mst_detect_port(struct drm_connector *connector,
> > >
> > >     ret = drm_modeset_lock(&mgr->base.lock, ctx);
> > >     if (ret)
> > > -           goto out;
> > > +           goto fail;
> > >
> > >     ret = connector_status_disconnected;
> > >
> > > @@ -4181,6 +4181,8 @@ drm_dp_mst_detect_port(struct drm_connector *connector,
> > >             break;
> > >     }
> > >  out:
> > > +   drm_modeset_unlock(&mgr->base.lock);
>
> Isn't this supposed to be unlocked only by drm_helper_probe_detect_ctx()
> / drm_helper_probe_detect() ?

Maybe adding a comment to that effect would be helpful for the future.

Alex

>
> > > +fail:
> > >     drm_dp_mst_topology_put_port(port);
> > >     return ret;
> > >  }
> >
> > --
> > Cheers,
> >  Lyude Paul (she/her)
> >  Software Engineer at Red Hat
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ