Page MenuHomeFreeBSD
Feed Advanced Search

Jul 2 2019

kib committed rS349610: Add implicit PROT_MAX() knob to proccontrol(1)..
Add implicit PROT_MAX() knob to proccontrol(1).
Jul 2 2019, 7:12 PM
kib committed rS349609: Control implicit PROT_MAX() using procctl(2) and the FreeBSD note.
Control implicit PROT_MAX() using procctl(2) and the FreeBSD note
Jul 2 2019, 7:07 PM
kib committed rS349608: Use traditional 'p' local to designate td->td_proc in kern_mmap..
Use traditional 'p' local to designate td->td_proc in kern_mmap.
Jul 2 2019, 7:01 PM
kib closed D20795: Control implicit PROT_MAX() using proccontrol(1) and the FreeBSD note feature bit..
Jul 2 2019, 7:01 PM

Jul 1 2019

kib added inline comments to D20584: add a linux compatible copy_file_range(2) syscall.
Jul 1 2019, 9:19 PM
kib accepted D20812: Tidy up amd64's pmap_copy().
Jul 1 2019, 6:20 PM
kib added inline comments to D20812: Tidy up amd64's pmap_copy().
Jul 1 2019, 9:24 AM

Jun 30 2019

kib added inline comments to D20812: Tidy up amd64's pmap_copy().
Jun 30 2019, 9:43 PM
kib added a comment to D20795: Control implicit PROT_MAX() using proccontrol(1) and the FreeBSD note feature bit..

Man page update and minor code rearrangement.

Jun 30 2019, 7:06 PM
D20786: Add option "untrusted" to mount(8) is now accepted and ready to land.

Some of the checks that I am contemplating are expensive in that they may require extra I/O operations. Another possible thing is that I may spawn a process to run a full filesystem check before proceeding with the mount. These are not things that should or need to be done in the case of a trusted filesystem. I believe that the name "untrusted" well and succinctly describes this option.

Jun 30 2019, 1:31 PM
D20808: factor out the code that actually does the truncation from vn_truncate() into vn_truncate_locked() is now accepted and ready to land.
Jun 30 2019, 1:27 PM
kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Observations like "this condition is always true" and "it is guaranteed that old == owner here" should ideally be verified by static code analysis. I'd try to apply the patch and run PVS-Studio over it.

Jun 30 2019, 11:45 AM

Jun 29 2019

D20801: Display the approximate space needed when a minidump fails due to lack of space. is now accepted and ready to land.

Anyway, do as you want. Printing any estimation of the size in case of failure is an improvement on its own, even if not perfect.

Jun 29 2019, 7:19 PM
kib added a comment to D20716: Replace mount(2) calls to in-tree filesystems will nmount(2)..

I've addressed the main technical concerns (other then which syscall implementation to call). If we agree to move forward with this patch I can address style(9), but don't want to spend the time unless it's going to land in FreeBSD.

Jun 29 2019, 6:40 PM
D20633: Does clip_start require entry simplification? is now accepted and ready to land.
Jun 29 2019, 5:02 PM
kib added a comment to D20633: Does clip_start require entry simplification?.

vm_map_protect() is not the only user of the vm_map_clip_start(). More, I suspect that wire/unwire and vm_map_delete() might be more prominent users, because apps do not change protection often, while they definitely unmap enough. Did you evaluate these cases ?

Jun 29 2019, 2:40 PM
kib added inline comments to D20801: Display the approximate space needed when a minidump fails due to lack of space..
Jun 29 2019, 12:00 PM

Jun 28 2019

kib accepted D20793: Micro-optimize pmap_protect_pde().
Jun 28 2019, 9:25 PM
kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Fix i386 casueword.
Handle Mark' notes.
Committed style change.

Jun 28 2019, 8:46 PM
kib added inline comments to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..
Jun 28 2019, 8:45 PM
kib committed rS349519: Style..
Style.
Jun 28 2019, 8:41 PM
kib added inline comments to D20795: Control implicit PROT_MAX() using proccontrol(1) and the FreeBSD note feature bit..
Jun 28 2019, 7:31 PM
kib added inline comments to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..
Jun 28 2019, 6:25 PM
kib created D20795: Control implicit PROT_MAX() using proccontrol(1) and the FreeBSD note feature bit..
Jun 28 2019, 6:16 PM
kib committed rS349512: Mention proccontrol(1) -m kpti..
Mention proccontrol(1) -m kpti.
Jun 28 2019, 6:03 PM
kib committed rS349511: Typo..
Typo.
Jun 28 2019, 4:42 PM
D20663: Reduce size of rtld by 22% by pulling in less code from libc is now accepted and ready to land.

I've managed to boot amd64 with these changes. The libc and libthr tests also complete successfully.
The only thing I noticed was the following during boot:

lock order reversal:
 1st 0xfffffe0000847200 bufwait (bufwait) @ /exports/users/alr48/sources/freebsd-universe/sys/kern/vfs_bio.c:3904
 2nd 0xfffff800033e0200 dirhash (dirhash) @ /exports/users/alr48/sources/freebsd-universe/sys/ufs/ufs/ufs_dirhash.c:289
stack backtrace:
#0 0xffffffff80c30bf3 at witness_debugger+0x73
#1 0xffffffff80c3093d at witness_checkorder+0xa7d
#2 0xffffffff80bd0548 at _sx_xlock+0x68
#3 0xffffffff80ed741d at ufsdirhash_add+0x3d
#4 0xffffffff80eda206 at ufs_direnter+0x446
#5 0xffffffff80ee14a2 at ufs_rename+0xe82
#6 0xffffffff81217fe0 at VOP_RENAME_APV+0x70
#7 0xffffffff80ca812b at kern_renameat+0x36b
#8 0xffffffff81092af6 at amd64_syscall+0x276
#9 0xffffffff8106ad6d at fast_syscall_common+0x101

However, it seems unlikely that this is caused by my rtld changes and more likely that I booted with a broken kernel version.

Jun 28 2019, 3:02 PM
kib added a comment to D20786: Add option "untrusted" to mount(8).

I am not sure how useful this option is.

Jun 28 2019, 1:21 PM
kib accepted D20784: Fix mutual exclusion in pipe_direct_write()..
Jun 28 2019, 11:46 AM
D20790: Implement pmap_copy() for arm64 is now accepted and ready to land.
Jun 28 2019, 11:44 AM

Jun 27 2019

D20783: style changes to FIOBMAP2 is now accepted and ready to land.
Jun 27 2019, 11:31 PM
D20784: Fix mutual exclusion in pipe_direct_write(). is now accepted and ready to land.
Jun 27 2019, 11:11 PM
kib added inline comments to D20783: style changes to FIOBMAP2.
Jun 27 2019, 10:41 PM
D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock() is now accepted and ready to land.
Jun 27 2019, 10:29 PM
kib added inline comments to D20783: style changes to FIOBMAP2.
Jun 27 2019, 9:06 PM
kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Hopefully fix two bugs.

Jun 27 2019, 6:40 PM
kib added inline comments to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..
Jun 27 2019, 6:38 PM

Jun 26 2019

D20772: Provide protection against starvation of the ll/sc loops when accessing userpace. now requires review to proceed.

Remove extra empty line.

Jun 26 2019, 7:03 PM
kib added a comment to D20663: Reduce size of rtld by 22% by pulling in less code from libc.
In D20663#449349, @kib wrote:
In D20663#449299, @kib wrote:

What testing was done ? Did you boot amd64 multiuser with the patched rtld ?

libthr consumes some bits from rtld, mostly rtld_malloc.c.

libthr still builds fine (I did a full universe build).

Did you do any runtime testing of threaded apps ?

I did not try any threaded applications yet. Do you have any suggestions what would be a good test case?

Perhaps run libc and libthr tests from /usr/tests ...

Jun 26 2019, 6:23 PM
kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Update ppc inline asm comment.

Jun 26 2019, 6:21 PM
kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

sparc64 bugs pointed out by Mark.

Jun 26 2019, 6:01 PM
kib updated the summary of D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..
Jun 26 2019, 5:58 PM
kib created D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..
Jun 26 2019, 5:41 PM
kib committed rS349427: amd64 pmap: Fix pkru handling in pmap_remove()..
amd64 pmap: Fix pkru handling in pmap_remove().
Jun 26 2019, 5:16 PM
kib added a comment to D20663: Reduce size of rtld by 22% by pulling in less code from libc.
In D20663#449299, @kib wrote:

What testing was done ? Did you boot amd64 multiuser with the patched rtld ?

libthr consumes some bits from rtld, mostly rtld_malloc.c.

libthr still builds fine (I did a full universe build).

Did you do any runtime testing of threaded apps ?

Jun 26 2019, 5:11 PM
kib added a comment to D20663: Reduce size of rtld by 22% by pulling in less code from libc.

What testing was done ? Did you boot amd64 multiuser with the patched rtld ?

Jun 26 2019, 4:24 PM
kib added inline comments to D20663: Reduce size of rtld by 22% by pulling in less code from libc.
Jun 26 2019, 3:59 PM
kib added a comment to D20663: Reduce size of rtld by 22% by pulling in less code from libc.

Overall, I like where you get at. The realpath.c and rtld-elf/debug.h changes can be already committed separately.

Jun 26 2019, 12:57 PM
kib added a comment to D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().

I believe that the code is fine from the algorithmic PoV, but I suggest some minor renaming and rearrangement.

Jun 26 2019, 10:36 AM
D20753: simplify entries after vm_map_protect -> KERN_RESOURCE_SHORTAGE is now accepted and ready to land.
Jun 26 2019, 6:42 AM

Jun 25 2019

kib added a comment to D20753: simplify entries after vm_map_protect -> KERN_RESOURCE_SHORTAGE.

IMO removing the sentence at all is overreaction, you can say 'will be copied' or use any other syntax construct that indicates that copying could occur in future.

Jun 25 2019, 9:03 PM
D20664: Changes to vm_map_lookup_entry is now accepted and ready to land.
Jun 25 2019, 7:53 PM
kib added inline comments to D20664: Changes to vm_map_lookup_entry.
Jun 25 2019, 6:10 PM
D20753: simplify entries after vm_map_protect -> KERN_RESOURCE_SHORTAGE is now accepted and ready to land.
Jun 25 2019, 5:03 PM
D20758: Add a return value to vm_page_remove(). is now accepted and ready to land.
Jun 25 2019, 4:52 PM
D20741: Remove references to splbio(). is now accepted and ready to land.
Jun 25 2019, 4:49 PM
kib added a comment to D20751: vm_map_protect(9) fails to document KERN_RESOURCE_SHORTAGE return value..

With Mark' note, accepted.

Jun 25 2019, 4:46 PM
kib added inline comments to D20751: vm_map_protect(9) fails to document KERN_RESOURCE_SHORTAGE return value..
Jun 25 2019, 10:33 AM

Jun 24 2019

kib added a comment to D20741: Remove references to splbio()..

I suggest you to go ahead with smbfs part.

Jun 24 2019, 6:32 PM
kib added inline comments to D20741: Remove references to splbio()..
Jun 24 2019, 6:31 PM

Jun 23 2019

kib committed rS349326: amd64 pmap: block on turnstile for lock-less DI..
amd64 pmap: block on turnstile for lock-less DI.
Jun 23 2019, 9:21 PM
kib closed D20636: amd64 pmap: block on turnstile for lock-less DI.
Jun 23 2019, 9:21 PM
kib committed rS349324: Switch to check for effective user id in r349320, and disable dumping.
Switch to check for effective user id in r349320, and disable dumping
Jun 23 2019, 9:15 PM
kib added a comment to D20636: amd64 pmap: block on turnstile for lock-less DI.

Two more language fixes.

Jun 23 2019, 8:39 PM
kib added inline comments to D20711: Stop early clipping in vm_map_protect.
Jun 23 2019, 8:06 PM
kib added a comment to D20636: amd64 pmap: block on turnstile for lock-less DI.

Language corrections.

Jun 23 2019, 7:57 PM
kib added inline comments to D20711: Stop early clipping in vm_map_protect.
Jun 23 2019, 6:53 PM
kib committed rS349320: coredump: avoid writing to core files not owned by the real user..
coredump: avoid writing to core files not owned by the real user.
Jun 23 2019, 6:35 PM
kib added a comment to D20663: Reduce size of rtld by 22% by pulling in less code from libc.

Okay, I'll try extracting the required files from libc_nossp_pic.a using ar and link against those files. Is that what you were suggesting? I would prefer building all the .o files, but I think there might be some per-architecture assembly files that need to be included and adding that logic to the makefile is slightly annoying.

Ok for me, but I wonder how would it work. Basically, to avoid the interposing code, you need to use _xxx or __sys_xxx symbols directly, right ? Then if you do, wouldn't simply linking with libc_nossp_pic.a enough ?

Jun 23 2019, 4:07 PM
kib added a comment to D20663: Reduce size of rtld by 22% by pulling in less code from libc.
In D20663#448138, @kib wrote:

I always wanted to remove -lc (or any currently used variant of libc) from the rtld linking. Ideally, we would just compile required libc sources second time for rtld, inside libexec/rtld-elf. I am sure that this would be a lot of work, but I am not sure that it would be much more work than continuing the approach of patching libc.a to cut off unneeded pieces.

There are not actually that many files from libc that are used in rtld. Here is the -Wl,--trace output:
...
I think if we linked against a libsyscalls (D14609) we only really need to build the string-related files (plus a few more which seem to mostly come from getenv()) again.

Jun 23 2019, 3:44 PM
kib committed rS349304: MFC r348802:.
MFC r348802:
Jun 23 2019, 11:09 AM
kib committed rS349303: MFC r348798, r348813:.
MFC r348798, r348813:
Jun 23 2019, 11:04 AM
kib committed rS349302: MFC r348799:.
MFC r348799:
Jun 23 2019, 11:02 AM
kib committed rS349301: MFC r348813:.
MFC r348813:
Jun 23 2019, 11:01 AM
kib committed rS349300: MFC r348798:.
MFC r348798:
Jun 23 2019, 11:00 AM
kib committed rS349299: Add libc stub for pthread_getthreadid_np(3)..
Add libc stub for pthread_getthreadid_np(3).
Jun 23 2019, 10:50 AM
kib committed rS349297: Remove redundand 'else' and 'return'..
Remove redundand 'else' and 'return'.
Jun 23 2019, 10:46 AM
kib added a comment to D20663: Reduce size of rtld by 22% by pulling in less code from libc.

I always wanted to remove -lc (or any currently used variant of libc) from the rtld linking. Ideally, we would just compile required libc sources second time for rtld, inside libexec/rtld-elf. I am sure that this would be a lot of work, but I am not sure that it would be much more work than continuing the approach of patching libc.a to cut off unneeded pieces.

Jun 23 2019, 10:01 AM
D20636: amd64 pmap: block on turnstile for lock-less DI now requires review to proceed.

Add comments explaining the callout use and recheck.

Jun 23 2019, 9:18 AM

Jun 22 2019

kib added a comment to D20720: Make linuxulator handle ELFOSABI_NONE ELF executables.

Without this commit, Linux ldd is broken - it errors out due to not being able to exec rtld. No idea why rtld is like this, but, well, it is - both in Centos and Ubuntu.

It probably also fixed Android binaries; I hadn’t tested it this time.

Jun 22 2019, 6:33 PM
D20723: Remove bad /useless S_ISBLK from swapon is now accepted and ready to land.
Jun 22 2019, 6:23 PM
kib added a comment to D20716: Replace mount(2) calls to in-tree filesystems will nmount(2)..

There is a lot of style(9) violations, and I stopped listing at some point. Each thing I noted is recurrent.

Jun 22 2019, 6:08 PM
kib added a comment to D20720: Make linuxulator handle ELFOSABI_NONE ELF executables.

In which way does it fix ldd, and why ? [As usual, you do not bother to explain]

Jun 22 2019, 5:39 PM
D20723: Remove bad /useless S_ISBLK from swapon is now accepted and ready to land.

You can't use block special nodes for anything on FreeBSD. In particular, they cannot be used for swap.

Jun 22 2019, 5:37 PM

Jun 17 2019

kib added a comment to D20636: amd64 pmap: block on turnstile for lock-less DI.
In D20636#446616, @alc wrote:

I would suggest that you add a comment to the code explaining why the callout is necessary.

Jun 17 2019, 8:10 AM

Jun 16 2019

kib added inline comments to D18768: Describe FreeBSD's virtual memory in memory(7).
Jun 16 2019, 12:21 AM
kib added a comment to D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().

Feel free to do the rename in the preliminary commit.

Jun 16 2019, 12:00 AM

Jun 15 2019

kib added inline comments to D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().
Jun 15 2019, 9:32 PM
D20657: Three enhancements to arm64's pmap_protect() is now accepted and ready to land.
Jun 15 2019, 9:17 PM

Jun 14 2019

kib accepted D20632: Restore commentary lost in r349203.
Jun 14 2019, 1:06 PM
kib created D20636: amd64 pmap: block on turnstile for lock-less DI.
Jun 14 2019, 12:53 PM

Jun 13 2019

kib created D20631: Handle errors from timesub()..
Jun 13 2019, 9:29 PM
kib accepted D20627: Defer updates to the wired pages count in the arm64 pmap.
Jun 13 2019, 9:46 AM
kib accepted D20628: Use vm_map_entry_t field prev less.
Jun 13 2019, 9:44 AM

Jun 12 2019

kib accepted D18880: Extend mmap/mprotect API to specify the max page protections..
Jun 12 2019, 10:38 PM
kib accepted D20370: Eliminate code duplication around clip_start.
Jun 12 2019, 8:57 PM
kib added inline comments to D20584: add a linux compatible copy_file_range(2) syscall.
Jun 12 2019, 8:21 PM
kib accepted D20625: clarify reserv_test_config.
Jun 12 2019, 7:12 PM
kib added inline comments to D20370: Eliminate code duplication around clip_start.
Jun 12 2019, 7:07 PM
kib committed rS348991: MFC r347151,347181,347968,348421,348698,348701:.
MFC r347151,347181,347968,348421,348698,348701:
Jun 12 2019, 11:48 AM