Page MenuHomeFreeBSD

riscv/exception.S: save the thread pointer in both modes
ClosedPublic

Authored by christos on Apr 15 2023, 4:30 PM.
Tags
Referenced Files
F102769139: D39582.id.diff
Sat, Nov 16, 10:27 PM
Unknown Object (File)
Oct 8 2024, 5:06 PM
Unknown Object (File)
Sep 29 2024, 9:31 PM
Unknown Object (File)
Sep 29 2024, 7:21 PM
Unknown Object (File)
Sep 20 2024, 6:47 AM
Unknown Object (File)
Sep 19 2024, 1:46 PM
Unknown Object (File)
Sep 18 2024, 11:16 AM
Unknown Object (File)
Sep 17 2024, 3:37 AM
Subscribers

Details

Summary

The contents of frame->tf_tp are uninitialized if accessed by DTrace (in
probe context), resulting in a panic when trying to access the memory pointed to by
tp. This saves the thread pointer to the trap frame when handling
both userland and kernel exceptions.

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Apr 15 2023, 8:55 PM
This revision was automatically updated to reflect the committed changes.
jhb added inline comments.
sys/riscv/riscv/exception.S
46

Could we move 'sd' here so it's not duplicated?

christos added inline comments.
sys/riscv/riscv/exception.S
46

D39894 fixes this.