Page MenuHomeFreeBSD

LinuxKPI/lindebugfs: stop panicing in lindebugfs, fix simple_read_from_buffer
ClosedPublic

Authored by bz on Jun 27 2024, 12:29 PM.
Tags
None
Referenced Files
F106199867: D45755.diff
Fri, Dec 27, 1:19 AM
Unknown Object (File)
Wed, Dec 18, 7:21 AM
Unknown Object (File)
Sun, Dec 8, 12:24 PM
Unknown Object (File)
Wed, Dec 4, 9:15 PM
Unknown Object (File)
Nov 24 2024, 1:27 AM
Unknown Object (File)
Nov 20 2024, 9:05 AM
Unknown Object (File)
Nov 15 2024, 6:31 PM
Unknown Object (File)
Nov 15 2024, 6:31 PM
Subscribers

Details

Summary

Trying to use lindebugfs for debugging wirless drivers two issues
became apparent:
(a) a pnic in lindebugfs calling a hard coded release function if the

caller had not provided one.  This seems to be based on assumptions
that no longer hold up.  Remove the hard coded release function to
prevent panics.

(b) In LinuxKPI simple_read_from_buffer() would call copy_to_user() but

buffers weren't setup for this (lindebugfs has copies data from its
own buffer) and then pseudofs will do another copyout to the user
on this;  remove the copy_to_user() and simply copy the data over
to the provided buffer; this works for as long as the only consumers
remain debugfs callers (which currently seems to be the case).
[the only out-of-tree consumers I am aware off are two drm-kmod
drivers/gpu/drm/amd/pm/* debugfs functions I cannot test].

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Jun 27 2024, 12:29 PM

Anyone? Anyone who can test the Intel debug on drm code?

In D45755#1050226, @bz wrote:

Anyone? Anyone who can test the Intel debug on drm code?

I just compiled with this patch and read/wrote to a bunch of debugfs files that I verified working in the past. I found no unexpected errors. Looks good to me.

In D45755#1050226, @bz wrote:

Anyone? Anyone who can test the Intel debug on drm code?

I just compiled with this patch and read/wrote to a bunch of debugfs files that I verified working in the past. I found no unexpected errors. Looks good to me.

MASSIVE THANK YOU!

This revision was not accepted when it landed; it landed in state Needs Review.Jul 26 2024, 10:57 AM
This revision was automatically updated to reflect the committed changes.