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
Unknown Object (File)
Feb 2 2024, 6:17 AM
Unknown Object (File)
Dec 23 2023, 1:16 AM
Unknown Object (File)
Dec 12 2023, 10:09 AM
Unknown Object (File)
Dec 2 2023, 5:21 PM
Unknown Object (File)
Dec 2 2023, 5:21 PM
Unknown Object (File)
Dec 2 2023, 5:21 PM
Unknown Object (File)
Dec 1 2023, 12:18 AM
Unknown Object (File)
Sep 5 2023, 11:49 PM
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.