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
Unknown Object (File)
Sun, Dec 8, 12:24 PM
Unknown Object (File)
Wed, Dec 4, 9:15 PM
Unknown Object (File)
Sun, Nov 24, 1:27 AM
Unknown Object (File)
Wed, Nov 20, 9:05 AM
Unknown Object (File)
Fri, Nov 15, 6:31 PM
Unknown Object (File)
Fri, Nov 15, 6:31 PM
Unknown Object (File)
Oct 4 2024, 3:00 PM
Unknown Object (File)
Sep 28 2024, 4:21 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.