Page MenuHomeFreeBSD

mjg (Mateusz Guzik)
nice guy

Projects

User Details

User Since
Jun 4 2014, 10:38 AM (298 w, 4 d)

Recent Activity

Today

mjg accepted D23793: kernel: provide panicky version of __unreachable.
Sun, Feb 23, 2:07 AM

Yesterday

mjg added inline comments to D23793: kernel: provide panicky version of __unreachable.
Sat, Feb 22, 10:48 PM
mjg added a comment to D23428: vfs: stop populating spares in struct stat.

Ok, I'll write a patch which keeps the struct intact and only takes care of the non-spares area and then ask for a ports exp-run just in case.

Sat, Feb 22, 10:37 PM

Fri, Feb 21

mjg planned changes to D23779: Indicate issetugid in AT_BSDFLAGS.

Upon further testing this is buggy - sometimes the passed down value disagrees with what the syscall returns later as setugid call on exec happens only after copyout.

Fri, Feb 21, 3:07 PM
mjg updated the diff for D23779: Indicate issetugid in AT_BSDFLAGS.
  • use an extra flag instead of reldate
Fri, Feb 21, 12:41 PM
mjg created D23779: Indicate issetugid in AT_BSDFLAGS.
Fri, Feb 21, 12:16 PM
mjg committed rS358192: vfs: stop duplicating vnode work in audit during path lookup.
vfs: stop duplicating vnode work in audit during path lookup
Fri, Feb 21, 1:44 AM
mjg committed rS358191: audit: provide audit_canon_path variant which accepts vnodes.
audit: provide audit_canon_path variant which accepts vnodes
Fri, Feb 21, 1:41 AM
mjg committed rS358190: audit: simplify path resolving logic.
audit: simplify path resolving logic
Fri, Feb 21, 1:40 AM
mjg committed rS358189: audit: rely on use count instead of hold count in audit_canon_path.
audit: rely on use count instead of hold count in audit_canon_path
Fri, Feb 21, 1:40 AM

Thu, Feb 20

mjg added a comment to D23574: vfs: add kernel-side realpathat.

The flags argument is there specifically so these kind of extensions are possible without adding new syscalls. The only consumer does not use them and I think adding capability-aware realpath is a separate effort. Since this partially blocks other work I just went ahead with the commit.

Thu, Feb 20, 5:00 PM
mjg committed rS358173: make sysent for r358172 ("vfs: add realpathat syscall").
make sysent for r358172 ("vfs: add realpathat syscall")
Thu, Feb 20, 4:59 PM
mjg committed rS358172: vfs: add realpathat syscall.
vfs: add realpathat syscall
Thu, Feb 20, 4:58 PM
mjg closed D23574: vfs: add kernel-side realpathat.
Thu, Feb 20, 4:58 PM
mjg added inline comments to D23723: Add a blocking counter KPI, blockcount(9)..
Thu, Feb 20, 3:16 PM
mjg updated the summary of D23774: Add KPASS macros.
Thu, Feb 20, 3:06 PM
mjg updated the summary of D23774: Add KPASS macros.
Thu, Feb 20, 2:58 PM
mjg added inline comments to D23723: Add a blocking counter KPI, blockcount(9)..
Thu, Feb 20, 2:55 PM
mjg created D23774: Add KPASS macros.
Thu, Feb 20, 2:54 PM
mjg added a comment to D23428: vfs: stop populating spares in struct stat.

So any incarnation of this patch makes the following fail contrib/netbsd-tests/lib/libc/c063/t_fstatat.c:

Thu, Feb 20, 12:43 PM
mjg added inline comments to D23574: vfs: add kernel-side realpathat.
Thu, Feb 20, 3:09 AM
mjg updated the diff for D23574: vfs: add kernel-side realpathat.
  • rename to realpathat
Thu, Feb 20, 3:07 AM

Wed, Feb 19

mjg added inline comments to D23574: vfs: add kernel-side realpathat.
Wed, Feb 19, 11:42 PM
mjg added inline comments to D23574: vfs: add kernel-side realpathat.
Wed, Feb 19, 11:42 PM
mjg added a comment to D23469: fd: convert f_count to long.
In D23469#520752, @mjg wrote:

Some observations/personal feelings:

  • I'm not sure about the int/long refcount split. How does a developer know which to choose? There is at least one situation (struct file) where we certainly must handle 32-bit overflows, but in general it seems hard to know whether it's necessary. What about ucred? We would have to look at all kernel resources which may hold a ucred reference. That said, I like the simplification that comes from not having to check fhold()'s return value, but I'm still not 100% convinced that it is really necessary to try and sanely handle the case (i.e., return EBADF) where a file ref count has overflowed _if_ we're also detecting saturation and we wrap all f_count operations using refcount(9).

ucred is an excellent example of something which if in legitimate danger of not fitting in an int should use long. crhold() is called all over with no error checking and trying to add it is probably a futile effort. At the same time the struct comes with void *cr_pspare2[2]; meaning we can convert int to long without growing it, all while not creating unfreeable objects due to saturation limit being reached.

The "if in legitimate danger" bit is part of my point. Is it a danger or not? For ucred I suspect not, but it cannot really be reasoned about precisely. So how do programmers know in general which width to choose?

Wed, Feb 19, 9:59 PM
mjg added inline comments to D23574: vfs: add kernel-side realpathat.
Wed, Feb 19, 4:19 PM
mjg accepted D23723: Add a blocking counter KPI, blockcount(9)..
Wed, Feb 19, 4:18 PM
mjg added a comment to D23723: Add a blocking counter KPI, blockcount(9)..

I only have nitpicks I'm not going to insist on.

Wed, Feb 19, 3:51 PM

Tue, Feb 18

mjg added a comment to D23574: vfs: add kernel-side realpathat.

Same way as in the code prior to the patch -- routines resolve up to a point of reaching the passed 'rdir' vnode and I'm passing the same stuff getcwd does.

Tue, Feb 18, 4:00 PM

Mon, Feb 17

mjg accepted D23711: Type validating smr protected pointer accessors..
Mon, Feb 17, 8:27 PM
mjg added a comment to D23661: Implement a translation from FreeBSD atomic API to gcc intrinsics.

I think it's a fair worry that mixing hand-rolled atomics with compiler intrinsics may lead to trouble, but it's not hard to remedy.

Mon, Feb 17, 8:00 PM
mjg updated the diff for D23661: Implement a translation from FreeBSD atomic API to gcc intrinsics.
  • force strong cmpset since this seems to be the requirement right now
  • push ~ lower in atomic_clear
  • use relaxed barrier for failing (f)cmpset
Mon, Feb 17, 7:52 PM
mjg added a comment to D23661: Implement a translation from FreeBSD atomic API to gcc intrinsics.
In D23661#521321, @jhb wrote:

So in CheriBSD we just replaced all of atomic(9) with the __atomic API supported in both modern GCC and clang for RISC-V:
https://github.com/CTSRD-CHERI/cheribsd/commit/e9e9ff10652179eaeec911ed804326bee482a0b3#diff-dc47b5c2fe7ae88823267345a6d1ae5c
However, that header could likely just be used on any architecture as none of it is MD. It also does the full atomic API and works with both clang and gcc.

Mon, Feb 17, 7:16 PM
mjg added a comment to D23574: vfs: add kernel-side realpathat.

Can I get further review on this?

Mon, Feb 17, 12:07 PM
mjg added a comment to D23723: Add a blocking counter KPI, blockcount(9)..

Thank you for working on this.

Mon, Feb 17, 10:05 AM

Sun, Feb 16

mjg committed rS358007: refcount: update comments about fencing when releasing counts after r357989.
refcount: update comments about fencing when releasing counts after r357989
Sun, Feb 16, 6:20 PM
mjg closed D23719: refcount: update comments about fencing when releasing counts.
Sun, Feb 16, 6:20 PM
mjg updated the summary of D23719: refcount: update comments about fencing when releasing counts.
Sun, Feb 16, 4:58 PM
mjg created D23719: refcount: update comments about fencing when releasing counts.
Sun, Feb 16, 4:57 PM
mjg updated the diff for D23683: 1/2 vfs: inline VOP calls if possible.
  • add 'debug' keyword to debug routines for consistency
Sun, Feb 16, 4:07 PM
mjg added a comment to D23469: fd: convert f_count to long.

It helps me to take a step back and evaluate the current state of things.
Some background:

  • We had a couple of user-triggerable file ref overflow bugs in the unix domain socket code over the past year. This motivated me to add a generic saturated state to refcount(9) counters, which adds an extra conditional branch on the sign bit to _acquire and _release. I had file refcount overflows in mind, but there are other potential targets like ucreds that seem worth protecting.
Sun, Feb 16, 3:00 PM
mjg added inline comments to D23684: 2/2 lockmgr: provide routines usable as direct vfs calls.
Sun, Feb 16, 1:15 PM
mjg added a comment to D23684: 2/2 lockmgr: provide routines usable as direct vfs calls.
In D23684#520596, @jeff wrote:

lockstatus should also be an inline in the header.

Sun, Feb 16, 1:11 PM
mjg added a comment to D23685: Remove long broken procfs-based process tracing..

The patch is intended be least disruptive: namely anyone who just references any of these is unaffected, while anyone using these is not regressed (and perhaps is improved because it exits with an error instead of hanging in the kernel).

Sun, Feb 16, 12:52 PM
mjg added a comment to D23587: Stop couting threads executing dynamic syscalls.
In D23587#520606, @jeff wrote:

This would be a good use for tick based (non-atomic) smr. It would have a cheaper simpler write path. I don't object to this patch but it might get replaced again.

Sun, Feb 16, 12:19 PM
mjg added a comment to D23683: 1/2 vfs: inline VOP calls if possible.

Note the actual routine still have to be generated for filesystems like nullfs.

Sun, Feb 16, 12:09 PM
mjg added inline comments to D23711: Type validating smr protected pointer accessors..
Sun, Feb 16, 5:32 AM
mjg closed D23709: refcount: add missing release fence to refcount_release_if_gt.

https://svnweb.freebsd.org/changeset/base/357989

Sun, Feb 16, 3:41 AM
mjg added a comment to D23711: Type validating smr protected pointer accessors..

Not sure what you mean by everywhere. It can be next to whatever struct is at play. I'm confident that's a small price to pay for allowing the compiler to provide type checking.

Sun, Feb 16, 3:37 AM
mjg committed rS357991: vfs: fix vlrureclaim ->v_object access.
vfs: fix vlrureclaim ->v_object access
Sun, Feb 16, 3:33 AM
mjg committed rS357990: vfs: check early for VCHR in vput_final to short-circuit in the common case.
vfs: check early for VCHR in vput_final to short-circuit in the common case
Sun, Feb 16, 3:16 AM
mjg committed rS357989: refcount: add missing release fence to refcount_release_if_gt.
refcount: add missing release fence to refcount_release_if_gt
Sun, Feb 16, 3:15 AM
mjg added a comment to D23711: Type validating smr protected pointer accessors..

I think this avoidably loses the pointer type.

Sun, Feb 16, 3:05 AM
mjg updated the diff for D23481: vfs: use refcnt int API.
  • rebase
Sun, Feb 16, 12:44 AM
mjg updated the diff for D23480: Add new refcount API.
  • missed one assert
Sun, Feb 16, 12:42 AM
mjg added inline comments to D23480: Add new refcount API.
Sun, Feb 16, 12:40 AM
mjg updated the diff for D23480: Add new refcount API.
  • sync fences use with refcount as of D23709
  • pass the failed assertion expression to panicking routine
  • assert more things
Sun, Feb 16, 12:38 AM

Sat, Feb 15

mjg abandoned D21774: [wip] vfs: switch vnode count management away from refcounts to atomics.
Sat, Feb 15, 11:40 PM
mjg updated the summary of D23709: refcount: add missing release fence to refcount_release_if_gt.
Sat, Feb 15, 11:37 PM
mjg created D23709: refcount: add missing release fence to refcount_release_if_gt.
Sat, Feb 15, 11:33 PM
mjg added a comment to D23699: Fix build..

I'm arguing for exclusion of the entire dtrace/ directory which would also take care of systrace.

Sat, Feb 15, 9:54 PM
mjg committed rS357981: ufs: use faster lockgmr entry points in ffs_lock.
ufs: use faster lockgmr entry points in ffs_lock
Sat, Feb 15, 9:48 PM
mjg added a comment to D23699: Fix build..

I think building dtrace without KDTRACE_HOOKS partially defeats the point of not including it in the kernel config. The module is heavily neutered if not straight up useless.

Sat, Feb 15, 9:23 PM
mjg updated the diff for D23574: vfs: add kernel-side realpathat.
  • only set freebuf after success to match other routines
  • handle rtld-elf
  • add __getosreldate check as a temporary aid for upgrades. the value in there is to be changed
Sat, Feb 15, 9:20 PM
mjg added a comment to D23699: Fix build..

I think we should get another kernel config to build with tinderbox. Could be GENERIC without: SMP, NUMA, KDTRACE_HOOKS and maybe few others. Then not only we cover these, people can be asked to always make sure that kernel builds.

Sat, Feb 15, 6:01 PM
mjg added a comment to D23699: Fix build..

I was looking at this myself.

Sat, Feb 15, 5:55 PM
mjg committed rS357962: vfs: make write suspension mandatory.
vfs: make write suspension mandatory
Sat, Feb 15, 1:00 PM
mjg committed rS357957: capsicum: use new helpers.
capsicum: use new helpers
Sat, Feb 15, 1:30 AM
mjg committed rS357956: kqueue: use new capsicum helpers.
kqueue: use new capsicum helpers
Sat, Feb 15, 1:30 AM
mjg committed rS357955: cloudabi: use new capsicum helpers.
cloudabi: use new capsicum helpers
Sat, Feb 15, 1:30 AM
mjg committed rS357954: sctp: use new capsicum helpers.
sctp: use new capsicum helpers
Sat, Feb 15, 1:29 AM
mjg committed rS357953: vm: use new capsicum helpers.
vm: use new capsicum helpers
Sat, Feb 15, 1:29 AM
mjg committed rS357952: fd: use new capsicum helpers.
fd: use new capsicum helpers
Sat, Feb 15, 1:29 AM
mjg committed rS357951: vfs: use new capsicum helpers.
vfs: use new capsicum helpers
Sat, Feb 15, 1:29 AM
mjg committed rS357950: capsicum: add cap_rights_init_zero, cap_rights_init_one, cap_rights_set_one.
capsicum: add cap_rights_init_zero, cap_rights_init_one, cap_rights_set_one
Sat, Feb 15, 1:28 AM

Fri, Feb 14

mjg committed rS357947: vfs: remove no longer needed atomic_load_ptr casts.
vfs: remove no longer needed atomic_load_ptr casts
Fri, Feb 14, 11:18 PM
mjg committed rS357946: fd: remove no longer needed atomic_load_ptr casts.
fd: remove no longer needed atomic_load_ptr casts
Fri, Feb 14, 11:18 PM
mjg committed rS357945: kcov: remove no longer needed atomic_load_ptr casts.
kcov: remove no longer needed atomic_load_ptr casts
Fri, Feb 14, 11:18 PM
mjg committed rS357944: i386: remove no longer needed atomic_load_ptr casts.
i386: remove no longer needed atomic_load_ptr casts
Fri, Feb 14, 11:17 PM
mjg committed rS357943: arm64: remove no longer needed atomic_load_ptr casts.
arm64: remove no longer needed atomic_load_ptr casts
Fri, Feb 14, 11:17 PM
mjg committed rS357942: amd64: remove no longer needed atomic_load_ptr casts.
amd64: remove no longer needed atomic_load_ptr casts
Fri, Feb 14, 11:17 PM
mjg committed rS357941: vm: remove no longer needed atomic_load_ptr casts.
vm: remove no longer needed atomic_load_ptr casts
Fri, Feb 14, 11:16 PM
mjg committed rS357940: Make atomic_load_ptr type-aware.
Make atomic_load_ptr type-aware
Fri, Feb 14, 11:15 PM
mjg updated the summary of D23685: Remove long broken procfs-based process tracing..
Fri, Feb 14, 2:44 PM
mjg updated the diff for D23587: Stop couting threads executing dynamic syscalls.
Fri, Feb 14, 2:07 PM
mjg updated the summary of D23685: Remove long broken procfs-based process tracing..
Fri, Feb 14, 2:01 PM
mjg updated the summary of D23685: Remove long broken procfs-based process tracing..
Fri, Feb 14, 2:01 PM
mjg updated the summary of D23685: Remove long broken procfs-based process tracing..
Fri, Feb 14, 2:00 PM
mjg updated the summary of D23685: Remove long broken procfs-based process tracing..
Fri, Feb 14, 1:59 PM
mjg created D23685: Remove long broken procfs-based process tracing..
Fri, Feb 14, 1:59 PM
mjg committed rS357914: amd64: only check for error != 0 in the inlined part of l1d flush check.
amd64: only check for error != 0 in the inlined part of l1d flush check
Fri, Feb 14, 1:14 PM
mjg committed rS357912: Merge audit and systrace checks.
Merge audit and systrace checks
Fri, Feb 14, 1:09 PM
mjg committed rS357911: Annotate branches in the syscall path.
Annotate branches in the syscall path
Fri, Feb 14, 1:09 PM
mjg committed rS357909: lockmgr: add a change missed in r357907.
lockmgr: add a change missed in r357907
Fri, Feb 14, 11:56 AM
mjg added inline comments to D23684: 2/2 lockmgr: provide routines usable as direct vfs calls.
Fri, Feb 14, 11:35 AM
mjg created D23684: 2/2 lockmgr: provide routines usable as direct vfs calls.
Fri, Feb 14, 11:34 AM
mjg created D23683: 1/2 vfs: inline VOP calls if possible.
Fri, Feb 14, 11:28 AM
mjg committed rS357908: fd: annotate finstall with prediction branches.
fd: annotate finstall with prediction branches
Fri, Feb 14, 11:22 AM
mjg committed rS357907: lockmgr: rename lock_fast_path to lock_flags.
lockmgr: rename lock_fast_path to lock_flags
Fri, Feb 14, 11:21 AM
mjg committed rS357906: lockmgr: retire the unused lockmgr_unlock_fast_path routine.
lockmgr: retire the unused lockmgr_unlock_fast_path routine
Fri, Feb 14, 11:20 AM