Page MenuHomeFreeBSD

amd64: check that %cs and %ss values from ucontext fit into registers
ClosedPublic

Authored by kib on Sun, Mar 15, 7:20 AM.
Tags
None
Referenced Files
F148925066: D55861.diff
Sat, Mar 21, 1:45 AM
Unknown Object (File)
Fri, Mar 20, 1:24 AM
Unknown Object (File)
Thu, Mar 19, 11:49 AM
Unknown Object (File)
Sun, Mar 15, 8:53 AM
Subscribers

Details

Summary
This change only checks that the values from the user-supplied context
are not truncated by C implicit type convertions.  The validity of the
segment selectors is still checked by hardware.

Diff Detail

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

Event Timeline

kib requested review of this revision.Sun, Mar 15, 7:20 AM
This revision is now accepted and ready to land.Thu, Mar 19, 2:39 PM
sys/amd64/amd64/exec_machdep.c
275

These fields are register_t, which is signed.

sys/amd64/ia32/ia32_signal.c
217

... here, the fields are unsigned.

kib marked 2 inline comments as done.

Centralize and fix checks.

This revision now requires review to proceed.Fri, Mar 20, 3:13 AM
sys/amd64/ia32/ia32_signal.c
721

This should be updated too?

kib marked an inline comment as done.

Missed check.

This revision is now accepted and ready to land.Fri, Mar 20, 4:57 AM