dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault
@ 2015-07-28  5:18 bugzilla-daemon
  2015-09-05  3:03 ` bugzilla-daemon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bugzilla-daemon @ 2015-07-28  5:18 UTC (permalink / raw)
  To: dri-devel


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

https://bugs.freedesktop.org/show_bug.cgi?id=91481

            Bug ID: 91481
           Summary: [Patch?] DisplayPort MST (Multistream Transport)
                    hotplug kernel memory fault
           Product: DRI
           Version: XOrg git
          Hardware: x86 (IA32)
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: DRM/other
          Assignee: dri-devel@lists.freedesktop.org
          Reporter: adam_richter2004@yahoo.com

Created attachment 117412
  --> https://bugs.freedesktop.org/attachment.cgi?id=117412&action=edit
Path to make drm_dp_send_link_address set link_address_sent before hotplug
handler changes the pointer to it

When I "hot plug" insert a DisplayPort multistream transport ("MST") hub into a
computer that is running a Linux 4.2-rc4 kernel or any recent version, I get a
kernel memory fault in drm_dp_add_port.  In earlier kernels, I traced it to the
line after drm_dp_add_port's call to drm_dp_send_link_address:

             drm_dp_send_link_address(mstb->mgr, port->mstb);
            port->mstb->link_address_sent = true;

I believe that the problem is that drm_dp_send_link_address can call a hotplug
handler, which can change port->mstb so that it cannot be dereferenced (I think
it is set to NULL, but I have forgotten).

Since drm_dp_send_link_address is a static function in this file, its address
is never taken, and there are only two call sites, both of which set
link_address_sent to true, the patch that I have attached changes
drm_dp_send_link_address so that it sets that flag, reducing duplication of
code, and also allowing drm_dp_send_link_address to skip setting the flag if
sending the link address fails.

An intentional behavior change introduced by this patch is that the
mstb->link_address_sent is not set if sending the link address was aborted due
to the memory allocation in drm_dp_send_link_address failing.

Perhaps it should also not be set if the action receives a NAK reply, but I
haven't studied the code and DisplayPort documentation enough to guess. 
Whoever examines this patch should feel free to revise it as they see fit.

I should also warn that after I made this change in linux-4.2-rc4, the
resulting kernel eventually got another kernel memory fault in i2c_transfer
(called by drm_do_probe_ddc_edid), but I believe that that is a separate issue.

I am happy to answer questions about this patch.  If nobody sees any problems
with it, I would ask that whoever takes this bug report submit the patch
upstream.

Thanks for considering this bug report and proposed patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 4287 bytes --]

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault
  2015-07-28  5:18 [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault bugzilla-daemon
@ 2015-09-05  3:03 ` bugzilla-daemon
  2015-09-05  7:45 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2015-09-05  3:03 UTC (permalink / raw)
  To: dri-devel


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

https://bugs.freedesktop.org/show_bug.cgi?id=91481

--- Comment #1 from Adam J. Richter <adam_richter2004@yahoo.com> ---
Thank you, Dave Arlie, and anyone else involved, for the DisplayPort
MultiStream Transport fixes in Linux 4.1.6 and 4.2 (and a few of the
subreleases and release candidates leading up to these versions).

However, I think that some change along the lines of the patch that I mentioned
may still be necessary.  I cannot be sure, because when I try to boot
linux-4.1.6, I get a other kernels bugs either before I get a chance to test
this or while I am testing it.  I am pretty sure I tried Linux-4.2 and observed
the kernel getting fault that would go away when I would apply the attached
patch.

It looks to me like, toward the end of drm_dp_add_port in Linux-4.2, I still
see the following code:

                       drm_dp_send_link_address(mstb->mgr, port->mstb);
                       port->mstb->link_address_sent = true;

...and drm_dp_send_link_address has this line, which I think can call a
function that can change port->mstb:

                       (*mgr->cbs->hotplug)(mgr);

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2039 bytes --]

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault
  2015-07-28  5:18 [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault bugzilla-daemon
  2015-09-05  3:03 ` bugzilla-daemon
@ 2015-09-05  7:45 ` bugzilla-daemon
  2015-09-06  3:22 ` bugzilla-daemon
  2019-10-14 13:20 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2015-09-05  7:45 UTC (permalink / raw)
  To: dri-devel


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

https://bugs.freedesktop.org/show_bug.cgi?id=91481

--- Comment #2 from Dave Airlie <airlied@freedesktop.org> ---
I've missed this bug, but I've posted a patch that is like yours just not as
large a change.

Hopefully it works for you.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1134 bytes --]

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault
  2015-07-28  5:18 [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault bugzilla-daemon
  2015-09-05  3:03 ` bugzilla-daemon
  2015-09-05  7:45 ` bugzilla-daemon
@ 2015-09-06  3:22 ` bugzilla-daemon
  2019-10-14 13:20 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2015-09-06  3:22 UTC (permalink / raw)
  To: dri-devel


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

https://bugs.freedesktop.org/show_bug.cgi?id=91481

--- Comment #3 from Adam J. Richter <adam_richter2004@yahoo.com> ---
Hi, Dave.

Thank you for posting your patch to the dri-devel mailing list (at
http://article.gmane.org/gmane.comp.video.dri.devel/136173 ).

Your patch is probably fine in practice, although I am not sure it deals
correctly with the the ways of drm_dp_send_link_address can fail.  Part of the
reason I made my patch the way I did was that I guessed that if the kzalloc at
the beginning of drm_dp_send_link_address failed (which probably will never
happen), that it might be better not to set link_address_sent to true.  On the
other hand, I was not sure what to do with the "link address failed" and "link
address nak received" cases in that function.  Perhaps link_address_sent should
not be set in those cases either.

Anyhow, pushing your patch upstream would certainly be an improvement.  I'm all
for it if you think you patch is actually correct in these cases too, or if you
want to push your patch upstream and think about corner cases later.

If you do have any thoughts on these corner cases, your comments would be most
welcome of course.

Thanks again for addressing this bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2207 bytes --]

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault
  2015-07-28  5:18 [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault bugzilla-daemon
                   ` (2 preceding siblings ...)
  2015-09-06  3:22 ` bugzilla-daemon
@ 2019-10-14 13:20 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2019-10-14 13:20 UTC (permalink / raw)
  To: dri-devel


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

https://bugs.freedesktop.org/show_bug.cgi?id=91481

Martin Peres <martin.peres@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Martin Peres <martin.peres@free.fr> ---
Hi,

Freedesktop's Bugzilla instance is EOLed and open bugs are about to be migrated
to http://gitlab.freedesktop.org.

To avoid migrating out of date bugs, I am now closing all the bugs that did not
see any activity in the past year. If the issue is still happening, please
create a new bug in the relevant project at https://gitlab.freedesktop.org/drm
(use misc by default).

Sorry about the noise!

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2584 bytes --]

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-14 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28  5:18 [Bug 91481] [Patch?] DisplayPort MST (Multistream Transport) hotplug kernel memory fault bugzilla-daemon
2015-09-05  3:03 ` bugzilla-daemon
2015-09-05  7:45 ` bugzilla-daemon
2015-09-06  3:22 ` bugzilla-daemon
2019-10-14 13:20 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox