Page MenuHomeFreeBSD

Some fixes for compat32.
ClosedPublic

Authored by kib on Jul 31 2018, 10:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 10:03 PM
Unknown Object (File)
Dec 10 2023, 12:49 AM
Unknown Object (File)
Nov 22 2023, 12:31 PM
Unknown Object (File)
Sep 1 2023, 2:16 AM
Unknown Object (File)
Sep 1 2023, 2:15 AM
Unknown Object (File)
Sep 1 2023, 2:15 AM
Unknown Object (File)
Sep 1 2023, 2:14 AM
Unknown Object (File)
Sep 1 2023, 2:14 AM
Subscribers

Details

Summary
  1. Fix sched_rr_get_interval(2) for compat32, timespec requires translation.

PR: 230175

  1. Fix mprotect_err test to not assume specific address space layout.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Are you going to regenerate sys/compat/freebsd32 stuff too?

Are you going to regenerate sys/compat/freebsd32 stuff too?

As a follow-up commit, yes. It is irrelevant to the review.

Also, I notice three other syscalls in compat/freebsd32 that use plain timespec instead of timespec32. Do they need fixing too? I haven't tested them. They are freebsd32_sigtimedwait, freebsd32_futimens, and freebsd32_utimensat.

The mprotect_err test is now failing on amd64. The assertion at line 167 fails. I haven't tried it in 32-bit mode yet; I need to rebuild my 32-bit world first.

The mprotect_err test is now failing on amd64. The assertion at line 167 fails. I haven't tried it in 32-bit mode yet; I need to rebuild my 32-bit world first.

I see what is going on, finally. Can you explain to me how to rebuild mprotect_test without rebuilding the whole world, even with -DNO_CLEAN ? For normal components, I can make buildenv, then cd <dir> && make.

Also, I notice three other syscalls in compat/freebsd32 that use plain timespec instead of timespec32. Do they need fixing too? I haven't tested them. They are freebsd32_sigtimedwait, freebsd32_futimens, and freebsd32_utimensat.

They use struct timespec in the declaration, but correctly copy in timespec32 and convert to timespec as needed. I will fix the cosmetics in freebsd32/syscalls.master later.

This should correctly detect the address wraparound on compat32 ABIs.

In D16525#350848, @kib wrote:

The mprotect_err test is now failing on amd64. The assertion at line 167 fails. I haven't tried it in 32-bit mode yet; I need to rebuild my 32-bit world first.

I see what is going on, finally. Can you explain to me how to rebuild mprotect_test without rebuilding the whole world, even with -DNO_CLEAN ? For normal components, I can make buildenv, then cd <dir> && make.

I don't even bother with "make buildenv". I just cd to the directory and "make && make install". Remember, you can't execute the test from the source directory. You must install it into /usr/tests/lib/libc/sys.

LGTM. Don't forget to reference both PR 230175 and PR 230162 in your commit message. And don't forget to commit the autogenerated files too.

This revision is now accepted and ready to land.Jul 31 2018, 4:07 PM
This revision was automatically updated to reflect the committed changes.

Better fix for mprotect(2) wraparound check. It does not change the more delicate behavior for 64bits,

This revision was not accepted when it landed; it landed in state Needs Review.Jul 31 2018, 6:01 PM
This revision was automatically updated to reflect the committed changes.

Updating a Phabricator revision without including all of the files that have ever been part of that revision makes the history confusing, because Phabricator thinks you want to revert your changes to the files that you didn't include. You can't fix it now, but please try not to do it again.