Page MenuHomeFreeBSD

trasz (Edward Tomasz Napierała)
User

Projects

User Details

User Since
Aug 2 2014, 12:45 PM (537 w, 4 d)

Recent Activity

Mon, Nov 18

trasz updated the diff for D47640: RFC: hms(4): improve scroll with IICHID_SAMPLING.

More fixes from wulf@

Mon, Nov 18, 9:53 AM

Sun, Nov 17

trasz requested review of D47647: Speed up syncer shutdown.
Sun, Nov 17, 4:50 PM
trasz updated the diff for D47640: RFC: hms(4): improve scroll with IICHID_SAMPLING.

Okay, so turns out this is the REL_WHEEL, not REL_HWHEEL;
its just that all the offsets within the report are shifted
by one byte. I'm guessing this is the Report ID.

Sun, Nov 17, 2:06 PM
trasz updated the summary of D47640: RFC: hms(4): improve scroll with IICHID_SAMPLING.
Sun, Nov 17, 12:35 PM
trasz added inline comments to D47640: RFC: hms(4): improve scroll with IICHID_SAMPLING.
Sun, Nov 17, 12:34 PM
trasz updated the diff for D47640: RFC: hms(4): improve scroll with IICHID_SAMPLING.

Fixes suggested by wulf@.

Sun, Nov 17, 12:33 PM

Sat, Nov 16

trasz added a reviewer for D47640: RFC: hms(4): improve scroll with IICHID_SAMPLING: wulf.
Sat, Nov 16, 7:42 PM
trasz requested review of D47640: RFC: hms(4): improve scroll with IICHID_SAMPLING.
Sat, Nov 16, 7:41 PM

Wed, Nov 13

trasz committed rGfc595a6b7664: Fix "vrefact: wrong use count 0" with DRM (authored by trasz).
Fix "vrefact: wrong use count 0" with DRM
Wed, Nov 13, 10:29 AM
trasz closed D47391: Fix "vrefact: wrong use count 0" with DRM.
Wed, Nov 13, 10:29 AM

Thu, Nov 7

trasz added a reviewer for D47391: Fix "vrefact: wrong use count 0" with DRM: linuxkpi.
Thu, Nov 7, 10:23 AM
trasz updated the diff for D47391: Fix "vrefact: wrong use count 0" with DRM.

Get rid of vhold/vdrop. I've been running it for a few days
and it appears to work fine.

Thu, Nov 7, 10:23 AM

Mon, Nov 4

trasz updated the summary of D47391: Fix "vrefact: wrong use count 0" with DRM.
Mon, Nov 4, 12:24 PM
trasz added a comment to D47391: Fix "vrefact: wrong use count 0" with DRM.
In D47391#1080971, @kib wrote:

This cannot be right.

If the file references vnode, vnode must be active and have the use count at least 1, because file vref-ed the vnode on open.

Mon, Nov 4, 11:55 AM
trasz updated the diff for D47391: Fix "vrefact: wrong use count 0" with DRM.

Second try.

Mon, Nov 4, 11:54 AM

Fri, Nov 1

trasz added a reviewer for D47391: Fix "vrefact: wrong use count 0" with DRM: kib.
Fri, Nov 1, 3:17 PM
trasz added a comment to D47391: Fix "vrefact: wrong use count 0" with DRM.

This follows a somewhat similar fix in https://reviews.freebsd.org/D29323?id=86801. I can't say I have a proper understanding of what's going on here though.

Fri, Nov 1, 3:16 PM
trasz requested review of D47391: Fix "vrefact: wrong use count 0" with DRM.
Fri, Nov 1, 3:13 PM

Wed, Oct 23

trasz accepted D47262: Revise qsort(3) to reflect POSIX.1-2024 update..
Wed, Oct 23, 9:15 AM

Oct 22 2024

trasz added a comment to D44373: Capsicum vs the Pathnames, a PoC.

Reading the proposal, I sense that this would make capsicumization of command-line programs which convert argv[] entries to capabilities (i.e., which process a list of files) much easier. Rather than having to use cap_fileargs (which is expensive and has some functional thorns, and requires some refactoring to pass the casper channel around) or refactor everything to use openat() (not always practical), the program can instead

  • open the root dir and working dir,
  • limit rights on those dir fds,
  • call cap_enter()
  • call fchdir() and fchroot() with the aforementioned dirfds

Then, the program should be able to process argv[] entries without any further modification, which would make life much easier. This leaves open the possibility that the sandboxed process would be able to open files not listed in the argv[], but assuming that rights are appropriately limited on the dirfds, I think this is probably an acceptable tradeoff for many programs.

It would be quite nice if one could do this without requiring privileges. In particular, if one is just using fchroot() to make a dirfd visible to capsicum without actually changing the root directory (i.e., the root vnode doesn't change), can we get away without requiring that?

That's precisely the idea - and it explains it much better than my description above. And yes, fchroot(2) can be used unprivileged same way chroot(2) can, just set PROC_NO_NEW_PRIVS_ENABLE; for now you also need to set security.bsd.unprivileged_chroot=1.

Indeed, but if we start sandboxing command-line applications this way, they'll presumably be broken if someone sets security.bsd.unprivileged_chroot=0, which seems rather fragile. So, I'm wondering if calling fchroot() without actually changing the root vnode can be a special operation which doesn't require privilege checking.

Not sure if I follow. How would fchroot(2) work without changing the root vnode?

In the use-case I imagined originally, code would effectively do this:

dfd = open("/", O_DIRECTORY);
cap_rights_limit(dfd, ...)
cap_enter();
fchroot(dfd);
/* now applications can use open("/foo/bar"), subject to rights on `dfd`. */

Here, the root vnode isn't actually changing.

Oct 22 2024, 8:59 AM

Oct 21 2024

trasz added a comment to D44373: Capsicum vs the Pathnames, a PoC.

Reading the proposal, I sense that this would make capsicumization of command-line programs which convert argv[] entries to capabilities (i.e., which process a list of files) much easier. Rather than having to use cap_fileargs (which is expensive and has some functional thorns, and requires some refactoring to pass the casper channel around) or refactor everything to use openat() (not always practical), the program can instead

  • open the root dir and working dir,
  • limit rights on those dir fds,
  • call cap_enter()
  • call fchdir() and fchroot() with the aforementioned dirfds

Then, the program should be able to process argv[] entries without any further modification, which would make life much easier. This leaves open the possibility that the sandboxed process would be able to open files not listed in the argv[], but assuming that rights are appropriately limited on the dirfds, I think this is probably an acceptable tradeoff for many programs.

It would be quite nice if one could do this without requiring privileges. In particular, if one is just using fchroot() to make a dirfd visible to capsicum without actually changing the root directory (i.e., the root vnode doesn't change), can we get away without requiring that?

That's precisely the idea - and it explains it much better than my description above. And yes, fchroot(2) can be used unprivileged same way chroot(2) can, just set PROC_NO_NEW_PRIVS_ENABLE; for now you also need to set security.bsd.unprivileged_chroot=1.

Indeed, but if we start sandboxing command-line applications this way, they'll presumably be broken if someone sets security.bsd.unprivileged_chroot=0, which seems rather fragile. So, I'm wondering if calling fchroot() without actually changing the root vnode can be a special operation which doesn't require privilege checking.

Oct 21 2024, 12:39 PM
trasz committed rG31eec6fe1aea: linux: support IUTF8 (authored by trasz).
linux: support IUTF8
Oct 21 2024, 10:41 AM
trasz closed D44525: linux: support IUTF8.
Oct 21 2024, 10:41 AM

Oct 15 2024

trasz added a comment to D44373: Capsicum vs the Pathnames, a PoC.

Reading the proposal, I sense that this would make capsicumization of command-line programs which convert argv[] entries to capabilities (i.e., which process a list of files) much easier. Rather than having to use cap_fileargs (which is expensive and has some functional thorns, and requires some refactoring to pass the casper channel around) or refactor everything to use openat() (not always practical), the program can instead

  • open the root dir and working dir,
  • limit rights on those dir fds,
  • call cap_enter()
  • call fchdir() and fchroot() with the aforementioned dirfds

Then, the program should be able to process argv[] entries without any further modification, which would make life much easier. This leaves open the possibility that the sandboxed process would be able to open files not listed in the argv[], but assuming that rights are appropriately limited on the dirfds, I think this is probably an acceptable tradeoff for many programs.

It would be quite nice if one could do this without requiring privileges. In particular, if one is just using fchroot() to make a dirfd visible to capsicum without actually changing the root directory (i.e., the root vnode doesn't change), can we get away without requiring that?

Oct 15 2024, 2:47 PM

Oct 9 2024

trasz abandoned D31285: linux: emit warning on SS_AUTODISARM.
Oct 9 2024, 11:25 AM

Oct 4 2024

trasz updated the diff for D46812: Status/2024Q3/sourcecompat.adoc: Add report.

Two more nits from salvadore@

Oct 4 2024, 10:30 AM

Oct 2 2024

trasz added a comment to D46710: autofs: add NOAUTOMOUNT flag for lookups initiated by stat(2) and family.
In D46710#1068643, @kib wrote:
In D46710#1067752, @kib wrote:

I think the way it works is that autofs_lookup() doesn't trigger when looking up the autofs directory itself, only when looking up inside that directory?

I do not think so. When lookup finds a mount point, it steps over it. So I do think that this is due to caching.

It's not (typically) a mountpoint though? Usually you'd have something like /net/server/share/; the /net is the autofs mount point, and /net/server/ is an ordinary synthetic autofs directory, not a mount point. And this is about looking up /net/server/share - a stat(2) on that shouldn't trigger mounting it.

Right. And what does prevent the autofs_lookup() from triggering the mount in this situation? It should, unless the vnode is present in namecache.

Oct 2 2024, 12:03 PM

Oct 1 2024

trasz updated the diff for D46812: Status/2024Q3/sourcecompat.adoc: Add report.

copyedits, one line per sentence.

Oct 1 2024, 8:35 AM

Sep 29 2024

trasz added a comment to D46710: autofs: add NOAUTOMOUNT flag for lookups initiated by stat(2) and family.
In D46710#1067752, @kib wrote:

I think the way it works is that autofs_lookup() doesn't trigger when looking up the autofs directory itself, only when looking up inside that directory?

I do not think so. When lookup finds a mount point, it steps over it. So I do think that this is due to caching.

Sep 29 2024, 10:04 AM

Sep 28 2024

trasz added a comment to D46710: autofs: add NOAUTOMOUNT flag for lookups initiated by stat(2) and family.

I think the way it works is that autofs_lookup() doesn't trigger when looking up the autofs directory itself, only when looking up inside that directory?

Sep 28 2024, 6:28 PM

Sep 27 2024

trasz added a reviewer for D46812: Status/2024Q3/sourcecompat.adoc: Add report: status.
Sep 27 2024, 12:39 PM
trasz requested review of D46812: Status/2024Q3/sourcecompat.adoc: Add report.
Sep 27 2024, 12:38 PM

Sep 24 2024

trasz accepted D46711: linuxulator: ignore AT_NO_AUTOMOUNT for all stat variants.
Sep 24 2024, 12:49 PM

Sep 23 2024

trasz added a comment to D46710: autofs: add NOAUTOMOUNT flag for lookups initiated by stat(2) and family.
In D46710#1065280, @kib wrote:

I’m not sure I follow, but FreeBSD doesn’t mount on stat anyway, so why introduce the native flag instead of making the code consistently ignore the Linux one? Linux autofs semantics is broken in some interesting ways; we don’t need to port functionality that only exists to work around that brokenness.

Could you please explain how do we avoid triggering automount on stat? The autofs_mount_on_stat knob is mostly nop because the trigger happen during lookup preceeding the call to VOP_GETATTR().

Sep 23 2024, 9:25 AM

Sep 21 2024

trasz added a comment to D46710: autofs: add NOAUTOMOUNT flag for lookups initiated by stat(2) and family.

I’m not sure I follow, but FreeBSD doesn’t mount on stat anyway, so why introduce the native flag instead of making the code consistently ignore the Linux one? Linux autofs semantics is broken in some interesting ways; we don’t need to port functionality that only exists to work around that brokenness.

Sep 21 2024, 6:58 AM

Sep 13 2024

trasz updated the diff for D41564: Add fchroot(2).

Some more fixes from Brooks.

Sep 13 2024, 6:11 PM
trasz updated the summary of D41564: Add fchroot(2).
Sep 13 2024, 11:39 AM

Aug 28 2024

trasz added a comment to D41564: Add fchroot(2).

So... how do we proceed with this?

Aug 28 2024, 12:29 PM

Jul 23 2024

trasz updated the diff for D44372: Allow subset of wait4(2) functionality in Capsicum mode.

Drop wait6(2) for now

Jul 23 2024, 12:33 PM

Jul 15 2024

trasz added inline comments to D41564: Add fchroot(2).
Jul 15 2024, 9:19 AM
trasz updated the diff for D41564: Add fchroot(2).

Improve the man page.

Jul 15 2024, 9:18 AM

Jun 18 2024

trasz updated the diff for D44372: Allow subset of wait4(2) functionality in Capsicum mode.

Man page rewording from gnn@

Jun 18 2024, 10:51 AM

May 27 2024

trasz added inline comments to D44372: Allow subset of wait4(2) functionality in Capsicum mode.
May 27 2024, 9:25 AM

May 21 2024

trasz added a comment to D44373: Capsicum vs the Pathnames, a PoC.

@trasz : thanks for sending this review request. My general feeling is that I'm leery of relaxing the in-kernel security model, not just because of the potential for opening things we don't mean to open, but also because it complicates the model for those who are trying to understand it. "No global namespaces", while limiting, is a clearer rule than "no global namespaces unless you or your ancestor has previously called fchroot(2), unless-unless something has also called cap_enter(2) again to clear that magic vnode".

May 21 2024, 11:44 AM

May 18 2024

trasz added a comment to D44372: Allow subset of wait4(2) functionality in Capsicum mode.

(And also an earlier version of this did exactly that wrt idtype, that’s why the title still mentions the “limited subset”; only after that I’ve discovered that you can’t wait for arbitrary PIDs anyway.)

May 18 2024, 5:32 PM
trasz added a comment to D44372: Allow subset of wait4(2) functionality in Capsicum mode.

I might be wrong, but isn’t this restriction already there, inherent to wait(2) APIs? You need to use kqueue to wait for non-children?

May 18 2024, 5:30 PM

May 14 2024

trasz updated the diff for D44372: Allow subset of wait4(2) functionality in Capsicum mode.

Sigh, a typo.

May 14 2024, 10:25 AM
trasz updated the diff for D44372: Allow subset of wait4(2) functionality in Capsicum mode.

Man page fix from Brooks.

May 14 2024, 10:23 AM

May 13 2024

trasz updated the summary of D44373: Capsicum vs the Pathnames, a PoC.
May 13 2024, 10:07 AM

May 2 2024

trasz added inline comments to D41564: Add fchroot(2).
May 2 2024, 7:12 AM
trasz updated the diff for D41564: Add fchroot(2).

Use the right symbol version and bump Dd.

May 2 2024, 7:08 AM

May 1 2024

trasz added a comment to D45040: Allow rfork(2) in capsicum(4) capability mode.

There's a separate review for vfork (https://reviews.freebsd.org/D39829). And yeah, I've pasted Robert the link to this one here :)

May 1 2024, 10:36 PM
trasz updated the summary of D41564: Add fchroot(2).
May 1 2024, 6:17 PM
trasz updated the summary of D44372: Allow subset of wait4(2) functionality in Capsicum mode.
May 1 2024, 6:15 PM
trasz updated the diff for D41564: Add fchroot(2).

Add back procstat(1) bits and remove syscalls.map

May 1 2024, 10:49 AM
trasz added a reviewer for D41564: Add fchroot(2): capsicum.
May 1 2024, 10:39 AM
trasz requested review of D45040: Allow rfork(2) in capsicum(4) capability mode.
May 1 2024, 10:37 AM
trasz added a comment to D41564: Add fchroot(2).

As for CAP_FCHROOT - I think we should have it, if only for symmetry with CAP_FCHDIR. I don't really want to implement them - the lookup code isn't really suited for tracking rights for root and cwd, and so those two syscalls require full rights to succeed, not just a subset - but we could in the future.

May 1 2024, 8:05 AM
trasz retitled D41564: Add fchroot(2) from Add fchroot(2) and chroot -d to Add fchroot(2).
May 1 2024, 7:53 AM
trasz updated the diff for D41564: Add fchroot(2).

Update.

May 1 2024, 7:50 AM

Apr 22 2024

trasz updated the summary of D44372: Allow subset of wait4(2) functionality in Capsicum mode.
Apr 22 2024, 1:37 PM

Mar 27 2024

trasz added a reviewer for D44525: linux: support IUTF8: Linux Emulation.
Mar 27 2024, 1:29 PM
trasz requested review of D44525: linux: support IUTF8.
Mar 27 2024, 1:26 PM

Mar 22 2024

trasz abandoned D23333: Include comments in EC2 rc.conf and loader.conf.
Mar 22 2024, 9:36 AM · rc
trasz abandoned D3125: Justify the "Welcome to FreeBSD!" text in motd..
Mar 22 2024, 9:35 AM
trasz abandoned D15956: Add "Overview" to each menu.
Mar 22 2024, 9:35 AM
trasz abandoned D34004: website: Rework the downloads table.
Mar 22 2024, 9:35 AM
trasz abandoned D35244: mountroot: On failure return ENOENT, not ENODEV.
Mar 22 2024, 9:34 AM
trasz abandoned D24175: Clean up compiler warnings in sysctl(8).
Mar 22 2024, 9:33 AM
trasz abandoned D13211: Make the 'q' in ddb(4) pager actually abort the output.
Mar 22 2024, 9:32 AM
trasz abandoned D15800: Put the OTG entry in /etc/devd/otg.conf instead of /etc/devd.conf.
Mar 22 2024, 9:32 AM
trasz abandoned D26718: riscv: figure out tf_sepc update.
Mar 22 2024, 9:31 AM
trasz abandoned D27135: Questionable optimization for riscv cpu_fetch_syscall_args().
Mar 22 2024, 9:31 AM
trasz abandoned D27140: Rework handling of TDF_EXEC and TDF_FORK.
Mar 22 2024, 9:30 AM
trasz abandoned D27573: WIP: also handle sigfastblock.
Mar 22 2024, 9:30 AM
trasz abandoned D33967: handbook: Don't mention svnlite; it's obsolete.
Mar 22 2024, 9:29 AM
trasz abandoned D17582: sh: use larger BUFSIZ.
Mar 22 2024, 9:29 AM
trasz abandoned D26567: Reorder struct sysentvec.
Mar 22 2024, 9:28 AM
trasz abandoned D33971: website: Update link URLs, drop "purchase media", improve wording.
Mar 22 2024, 9:28 AM
trasz abandoned D26955: Try to canonicalize the first argument to mount(8).
Mar 22 2024, 9:27 AM
trasz abandoned D29750: rc: make 'ddb' and 'dumpon' require disks, not the other way around.
Mar 22 2024, 9:27 AM
trasz abandoned D29753: rc: remove redundant upercase dependencies.
Mar 22 2024, 9:25 AM
trasz abandoned D35222: Add kern.reboot_on_halt sysctl.
Mar 22 2024, 9:25 AM
trasz abandoned D29992: camcontrol(8): add "smart" command.
Mar 22 2024, 9:24 AM
trasz abandoned D27784: nsdispatch(3): drop useless atexit hook.
Mar 22 2024, 9:23 AM
trasz abandoned D27572: Add a mechanism to enable/disable syscall slow path.
Mar 22 2024, 9:23 AM
trasz abandoned D26624: Inline userret() in syscallret().
Mar 22 2024, 9:22 AM
trasz abandoned D27132: Clear TDB_USERWR in ast().
Mar 22 2024, 9:22 AM
trasz abandoned D26785: Get rid of useless stat(2) call.
Mar 22 2024, 9:22 AM
trasz abandoned D26650: Predict that the userspace trap will likely be syscall.
Mar 22 2024, 9:20 AM

Mar 21 2024

trasz added a comment to D44373: Capsicum vs the Pathnames, a PoC.

Can you describe the dlopen threat model a bit more? My assumption is, a typical Capsicum-aware app wouldn't be setting the rootdir/curdir at all. Or, if it does, it could call cap_enter(2) again before calling dlopen(3), clearing those vnodes.

Mar 21 2024, 2:03 PM
trasz updated the diff for D44372: Allow subset of wait4(2) functionality in Capsicum mode.

Fix panic which occured when the PID is specified explictly.
Also handle wait6(2). Add some documentation. Pacify a test.

Mar 21 2024, 1:33 PM
trasz added a comment to D44372: Allow subset of wait4(2) functionality in Capsicum mode.

I agree this should be documented somewhere, but at the moment wait(2) doesn't mention Capsicum at all, and capsicum(4) doesn't mention wait(2). Perhaps a paragraph in pdfork(2), something along the lines of "processes created with pdfork cannot be waited for by a parent running in capsicum(4) mode"?

Mar 21 2024, 12:45 PM

Mar 16 2024

trasz added inline comments to D44375: linux: use sa_family_t for address family conversions.
Mar 16 2024, 2:20 PM

Mar 15 2024

trasz added reviewers for D44373: Capsicum vs the Pathnames, a PoC: val_packett.cool, jonathan.
Mar 15 2024, 1:51 PM
trasz updated the summary of D44373: Capsicum vs the Pathnames, a PoC.
Mar 15 2024, 1:50 PM
trasz added a reviewer for D44373: Capsicum vs the Pathnames, a PoC: capsicum.
Mar 15 2024, 12:48 PM
trasz requested review of D44373: Capsicum vs the Pathnames, a PoC.
Mar 15 2024, 12:48 PM
trasz added a reviewer for D44372: Allow subset of wait4(2) functionality in Capsicum mode: capsicum.
Mar 15 2024, 12:24 PM
trasz requested review of D44372: Allow subset of wait4(2) functionality in Capsicum mode.
Mar 15 2024, 12:22 PM