Page MenuHomeFreeBSD

kevans (Kyle Evans)
User

Projects (10)

User Details

User Since
Oct 2 2015, 1:17 PM (539 w, 4 h)

Recent Activity

Today

kevans added a comment to D54833: kern: mac: add a prison_cleanup entry point.

rer: removing the prlabel, @csjp noted (paraphrasing, maybe poorly) that that's a MAC-philosophical thing that policy (writers?) shouldn't have to have 'that' much knowledge of kernel internals. It turns out that they often do anyways, but the historically consistent thing is that object labels get passed along with the labels to avoid the policy reaching into the object when it's something that they'll want to act on.

Mmm... I agree it's historical, and think it's essentially because the first MAC policies revolved around labels. However, "recent" ones have departed from these completely, so not sure if we should continue with the same trend. It's also slightly confusing at first that the same information are made available through different ways, e.g., via prlabel and pr->pr_label, leading to questions about what prlabel is exactly (e.g., is it stored outside the 'struct prison'?). Redundancy always introduce the consistency question, so in general should be avoided (here, it's not too hard to find what prlabel is, but that requires reading internal MAC code, defeating more or less the purpose of this "abstraction"). All this, compared to the only benefit I see which is avoiding code changes if we ever change pr_label to some other name or move it somewhere else, makes this practice really dubious to me. And we can actually have the same advantage differently by just providing a getter and a setter (or some variant).

I won't strongly object for this revision, but I think we should really consider removing passing labels in subsequent commits and replace with some getters/setters (possibly).

Fri, Jan 30, 5:42 PM
kevans added a comment to D54833: kern: mac: add a prison_cleanup entry point.

prison_created is done after we know that the jail's going to stick around because I wanted the prison state to be 'final' (post-OSD) before we do any label propagation stuff... maybe that wasn't quite the right call.

Irrespective of labels, it seems important that we have a hook that is called when the prison is final and will (or is likely to) go live.

It seems to make sense to propagate labels only then, although I'm not sure the actual point of occurrence really matters in the end since I don't see cases where that propagation could affect modules setting data on the jail itself.

Perhaps should we remove the prlabel argument from both hooks (prison_cleanup and prison_created) as it feels really redundant?

For prison_created it makes more sense because that's the specific point where you're ideally propagating the label (to, e.g., the root vnode) now that all of these other things that could have possibly failed haven't done so. I would agree that there's probably not much point in prison_cleanup taking a label, though, since a labelled policy would probably just use destroy_label and an unlabelled policy wouldn't be able to do anything constructive with it.

But if some label is propagated to the root vnode on jail creation, shouldn't it be "unpropagated" on jail shutdown? In other words, I'm not sure I see a case for an asymmetry of hooks. And it seems we could have simple jail policies where there's no label propagation. With my current understanding, I'd still remove prlabel from these hooks (and probably more of them, such as check_get or check_set).

Fri, Jan 30, 3:12 PM
kevans added inline comments to D54956: 15.0/relnotes: document allow.unprivileged_parent_tampering.
Fri, Jan 30, 1:55 AM
kevans committed rGfdcd67be8274: firmware: Fix inverted FIRMWARE_GET_NOWARN logic (authored by guest-seuros).
firmware: Fix inverted FIRMWARE_GET_NOWARN logic
Fri, Jan 30, 12:04 AM
kevans closed D54955: firmware: Fix inverted FIRMWARE_GET_NOWARN logic.
Fri, Jan 30, 12:03 AM

Yesterday

kevans retitled D54956: 15.0/relnotes: document allow.unprivileged_parent_tampering from 15.0/relnotes: document allow.unprivilged_parent_tampering to 15.0/relnotes: document allow.unprivileged_parent_tampering.
Thu, Jan 29, 11:33 PM
kevans requested review of D54956: 15.0/relnotes: document allow.unprivileged_parent_tampering.
Thu, Jan 29, 11:23 PM
kevans added inline comments to D54955: firmware: Fix inverted FIRMWARE_GET_NOWARN logic.
Thu, Jan 29, 11:07 PM
kevans accepted D54944: lindebugfs: check that name is set as otherwise pfs_alloc_node_flags() panics.

I have some more pseudofs patches in the pipeline still, I'll look at being consistent there as follow-up

Thu, Jan 29, 6:25 PM
kevans accepted D54853: touch: Test for -m flag.
Thu, Jan 29, 5:21 AM
kevans accepted D54852: touch: Test for -a flag.
Thu, Jan 29, 5:20 AM
kevans accepted D54836: touch: Tests for -h flag.
Thu, Jan 29, 5:20 AM

Wed, Jan 28

kevans added a comment to D54833: kern: mac: add a prison_cleanup entry point.

The /* Symmetry with prison_created */ comment is indeed welcome to clear the slight but apparently necessary confusion coming from the hook prison_cleanup being called in mac_prison_destroy() while prison_created is not called from mac_prison_init(). :-)

Wed, Jan 28, 7:12 PM
kevans committed rGb41b6fdb3a16: flua: lposix: fix WARNS=6 issues (authored by kevans).
flua: lposix: fix WARNS=6 issues
Wed, Jan 28, 3:44 PM

Tue, Jan 27

kevans added a comment to D54833: kern: mac: add a prison_cleanup entry point.

Gentle ping

Tue, Jan 27, 12:17 PM

Fri, Jan 23

kevans requested review of D54833: kern: mac: add a prison_cleanup entry point.
Fri, Jan 23, 3:00 PM

Wed, Jan 21

kevans committed rGeacc501eff52: truncate: fix a minor nit + add a hole-punching test (authored by kevans).
truncate: fix a minor nit + add a hole-punching test
Wed, Jan 21, 11:36 PM
kevans closed D51207: truncate: fix a minor nit + add a hole-punching test.
Wed, Jan 21, 11:36 PM

Tue, Jan 20

kevans committed rG4f0342cf84db: lualoader: fix pruning of non-existent default kernel (authored by kevans).
lualoader: fix pruning of non-existent default kernel
Tue, Jan 20, 4:10 AM
kevans committed rG919c1e19058d: bectl: log modifying functions to zpool history (authored by rob.norris_klarasystems.com).
bectl: log modifying functions to zpool history
Tue, Jan 20, 4:10 AM
kevans committed rG6dabfd3efefa: lualoader: fix pruning of non-existent default kernel (authored by kevans).
lualoader: fix pruning of non-existent default kernel
Tue, Jan 20, 4:10 AM
kevans committed rGd3c523b6f5aa: makedev(9): drop an additional note about cdevpriv dtors (authored by kevans).
makedev(9): drop an additional note about cdevpriv dtors
Tue, Jan 20, 4:10 AM
kevans committed rGbc859baeea57: bectl: log modifying functions to zpool history (authored by rob.norris_klarasystems.com).
bectl: log modifying functions to zpool history
Tue, Jan 20, 4:10 AM
kevans committed rG57b08d98db0a: libutil: defer setting the MAC label until after the login class (authored by kevans).
libutil: defer setting the MAC label until after the login class
Tue, Jan 20, 4:10 AM
kevans committed rGb196a718ca0e: libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails (authored by kevans).
libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails
Tue, Jan 20, 4:10 AM
kevans committed rGf00ebc7eb3a6: libc: fix description issues in mac_text(3)/mac_free(3) (authored by kevans).
libc: fix description issues in mac_text(3)/mac_free(3)
Tue, Jan 20, 4:10 AM
kevans committed rG5b2a74210408: makedev(9): drop an additional note about cdevpriv dtors (authored by kevans).
makedev(9): drop an additional note about cdevpriv dtors
Tue, Jan 20, 4:09 AM
kevans committed rGe760f45b5974: libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails (authored by kevans).
libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails
Tue, Jan 20, 4:09 AM
kevans committed rGd15be6d470d6: libutil: defer setting the MAC label until after the login class (authored by kevans).
libutil: defer setting the MAC label until after the login class
Tue, Jan 20, 4:09 AM
kevans committed rGb5b3bf57e9fb: libc: fix description issues in mac_text(3)/mac_free(3) (authored by kevans).
libc: fix description issues in mac_text(3)/mac_free(3)
Tue, Jan 20, 4:09 AM
kevans committed R9:437d92b9a2ca: [PHB]: Document recent __FreeBSD_version bumps along main (authored by kevans).
[PHB]: Document recent __FreeBSD_version bumps along main
Tue, Jan 20, 4:01 AM
kevans committed rGbef0475b6810: mac(4): also list jails in the example enumeration of objects (authored by kevans).
mac(4): also list jails in the example enumeration of objects
Tue, Jan 20, 2:58 AM
kevans committed rG3f3b53e68a7b: jail(3): fix common usage after mac.label support (authored by kevans).
jail(3): fix common usage after mac.label support
Tue, Jan 20, 2:58 AM
kevans closed D54786: jail(3): fix common usage after mac.label support.
Tue, Jan 20, 2:58 AM
kevans closed D54748: mac(4): also list jails in the example enumeration of objects.
Tue, Jan 20, 2:58 AM
kevans added a comment to D54786: jail(3): fix common usage after mac.label support.

In the interest of not leaving main broken, I'm going to push this since it's functional both with a jail policy and without- noting that I fully expect to perhaps need another round to cleanup some remaining issue(s) pertaining to the expedited timeline.

Tue, Jan 20, 2:51 AM

Mon, Jan 19

kevans updated the summary of D54786: jail(3): fix common usage after mac.label support.
Mon, Jan 19, 11:12 PM
kevans updated the diff for D54786: jail(3): fix common usage after mac.label support.

Extra fixes, also for bd55cbb50c58876

Mon, Jan 19, 10:32 PM
kevans added a comment to D54786: jail(3): fix common usage after mac.label support.

I think this is not sufficient (just to avoid a missing mac.conf entry):
I will test it thoroughly later, but for now:

# jail -c path=/ name=D54786 persist
# jls -s
Mon, Jan 19, 9:47 PM
kevans requested review of D54786: jail(3): fix common usage after mac.label support.
Mon, Jan 19, 8:19 PM
kevans added a comment to D54760: loader/lua: auto-load p9fs if vfs.root.mountfrom requires it.

(Scales a little better in the sense that one can have an image that can do any number of multiple fs, and they can only disable autoloading of specific rootfs)

Mon, Jan 19, 6:44 PM
kevans added a comment to D54760: loader/lua: auto-load p9fs if vfs.root.mountfrom requires it.

My preference would be that we add in a config.isModuleDisabled():

Mon, Jan 19, 6:43 PM

Sat, Jan 17

kevans accepted D54759: spi: use better logic for earlier change.

I'm not sure I'm convinced that dir is actually always set, but I haven't spent that much time reading the above logic. An assertion on that here might be good to try and do something useful instead of infinitely looping, but I don't insist

Sat, Jan 17, 5:35 PM
kevans added inline comments to D54734: spi(8) - "-S" option for continuous stream from standard input to bus.
Sat, Jan 17, 10:14 AM

Fri, Jan 16

kevans requested review of D54748: mac(4): also list jails in the example enumeration of objects.
Fri, Jan 16, 7:43 PM
kevans committed rG22569a1d8020: Bump __FreeBSD_version for MAC changes (authored by kevans).
Bump __FreeBSD_version for MAC changes
Fri, Jan 16, 9:08 AM
kevans committed rGc18631fe7958: RELNOTES: document the MAC/jail integration (authored by kevans).
RELNOTES: document the MAC/jail integration
Fri, Jan 16, 9:08 AM
kevans closed D54737: RELNOTES: document the MAC/jail integration.
Fri, Jan 16, 9:08 AM
kevans requested review of D54737: RELNOTES: document the MAC/jail integration.
Fri, Jan 16, 12:26 AM
kevans committed rG1e8c28712aaf: jail: document the mac.label parameter (authored by kevans).
jail: document the mac.label parameter
Fri, Jan 16, 12:25 AM
kevans committed rGdb3b39f063d9: libjail: extend struct handlers to included MAC labels (authored by kevans).
libjail: extend struct handlers to included MAC labels
Fri, Jan 16, 12:25 AM
kevans committed rGbd55cbb50c58: kern: add a mac.label jail parameter (authored by kevans).
kern: add a mac.label jail parameter
Fri, Jan 16, 12:25 AM
kevans committed rG1af8d5652a01: libjail: start refactoring struct ioctl support (authored by kevans).
libjail: start refactoring struct ioctl support
Fri, Jan 16, 12:25 AM
kevans committed rG626fe12e2801: kern: mac: pull mac_label_copyin_string out (authored by kevans).
kern: mac: pull mac_label_copyin_string out
Fri, Jan 16, 12:25 AM
kevans closed D54067: jail: document the mac.label parameter.
Fri, Jan 16, 12:25 AM
kevans committed rG31c2728185d1: mac_set_fd(3): add support for jail descriptors (authored by kevans).
mac_set_fd(3): add support for jail descriptors
Fri, Jan 16, 12:25 AM
kevans committed rGd7a517eb6d77: jaildesc: add an accessor for the struct prison in a jaildesc (authored by kevans).
jaildesc: add an accessor for the struct prison in a jaildesc
Fri, Jan 16, 12:25 AM
kevans closed D53960: libjail: extend struct handlers to included MAC labels.
Fri, Jan 16, 12:25 AM
kevans closed D53958: kern: add a mac.label jail parameter.
Fri, Jan 16, 12:25 AM
kevans closed D53959: libjail: start refactoring struct ioctl support.
Fri, Jan 16, 12:25 AM
kevans committed rG8254b0dec02b: kern: mac: add various jail MAC hooks (authored by kevans).
kern: mac: add various jail MAC hooks
Fri, Jan 16, 12:25 AM
kevans closed D53957: kern: mac: pull mac_label_copyin_string out.
Fri, Jan 16, 12:25 AM
kevans committed rG92b7366e438d: mac: add macros for 5-argument SDT probes (authored by kevans).
mac: add macros for 5-argument SDT probes
Fri, Jan 16, 12:25 AM
kevans closed D53956: mac_set_fd(3): add support for jail descriptors.
Fri, Jan 16, 12:25 AM
kevans closed D53955: jaildesc: add an accessor for the struct prison in a jaildesc.
Fri, Jan 16, 12:24 AM
kevans committed rG11d6ea47f06a: kern: mac: add a MAC label to struct prison (authored by kevans).
kern: mac: add a MAC label to struct prison
Fri, Jan 16, 12:24 AM
kevans closed D53954: [RFC] kern: mac: add various jail MAC hooks.
Fri, Jan 16, 12:24 AM
kevans closed D54658: mac: add macros for 5-argument SDT probes.
Fri, Jan 16, 12:24 AM
kevans closed D53953: kern: mac: add a MAC label to struct prison.
Fri, Jan 16, 12:24 AM

Wed, Jan 14

kevans committed rG5e1c7867e1b9: vt(4): allow up to _SIG_MAXSIG (128) for VT_SETMODE (authored by quentin.thebault_defenso.fr).
vt(4): allow up to _SIG_MAXSIG (128) for VT_SETMODE
Wed, Jan 14, 12:56 AM
kevans closed D53615: vt(4): allow up to _SIG_MAXSIG (128) for VT_SETMODE.
Wed, Jan 14, 12:54 AM
kevans added a reviewer for D54355: stdio: rename short _fileno to _fileno_short for legacy abi compatibility, add new int _fileno in struct __sFILE: adrian.
Wed, Jan 14, 12:49 AM
kevans added a reviewer for D54354: stdio: rename _file to _fileno in struct __sFILE: adrian.
Wed, Jan 14, 12:49 AM
kevans added reviewers for D54355: stdio: rename short _fileno to _fileno_short for legacy abi compatibility, add new int _fileno in struct __sFILE: des, jhb.
Wed, Jan 14, 12:49 AM
kevans added reviewers for D54354: stdio: rename _file to _fileno in struct __sFILE: des, jhb.

+des for recent stdio work, jhb for having worked on something like this specifically that hadn't landed

Wed, Jan 14, 12:49 AM

Sun, Jan 11

kevans requested review of D54658: mac: add macros for 5-argument SDT probes.
Sun, Jan 11, 5:20 PM

Fri, Jan 9

kevans added a reviewer for D54622: libutil: take a size_t in trimdomain(): manpages.
Fri, Jan 9, 5:02 PM
kevans requested review of D54623: libutil: avoid an out-of-bounds read in trimdomain(3).
Fri, Jan 9, 5:00 PM
kevans requested review of D54622: libutil: take a size_t in trimdomain().
Fri, Jan 9, 5:00 PM

Wed, Jan 7

kevans committed rGe30086ab4c87: lualoader: fix pruning of non-existent default kernel (authored by kevans).
lualoader: fix pruning of non-existent default kernel
Wed, Jan 7, 6:25 PM
kevans updated the diff for D51207: truncate: fix a minor nit + add a hole-punching test.

Address review comments

Wed, Jan 7, 6:18 PM

Tue, Jan 6

kevans updated the summary of D53954: [RFC] kern: mac: add various jail MAC hooks.
Tue, Jan 6, 3:59 PM
kevans accepted D54544: ng_tty: avoid the sign extention of char.
Tue, Jan 6, 12:26 AM

Fri, Jan 2

kevans added a comment to D54168: speaker(4): drop NEEDGIANT.

Ahh, sorry, I got confused with the missing context- can you reupload this with either git-arc or -U99999, please?

Done. But IMHO I find this workflow tremendously impractical. With github I can do 1) fine-grained commits, with separate commit per logical change and 2) git push -f to update the PR.

Here all this gets mashed up together and I need to copy-paste the diff manually in a HTML form... 😭

Fri, Jan 2, 2:26 PM

Thu, Jan 1

kevans added a comment to D54168: speaker(4): drop NEEDGIANT.

Ahh, sorry, I got confused with the missing context- can you reupload this with either git-arc or -U99999, please? It's immensely useful to be able to scroll back up and confirm where different hunks are applying

Thu, Jan 1, 11:50 PM
kevans added a comment to D54168: speaker(4): drop NEEDGIANT.

I am quite confused about what happened here. Can you explain the connection between my previous note and the changes made?

Thu, Jan 1, 8:39 PM
kevans added a comment to D54168: speaker(4): drop NEEDGIANT.

I don't think this is actually sufficient, but I don't think fixing it will be all that hard. sprkopen currently uses the fact that it's locked by Giant, so you'll probably want one spkr mutex to be taken in spkropen() and spkrclose() to be sure it's only opened by a single thread (and not leaking an allocation if spkr_inbuf gets clobbered`).

Thu, Jan 1, 2:54 AM

Dec 23 2025

kevans added a comment to D53958: kern: add a mac.label jail parameter.

I'd put all new functions of sys/security/mac/mac_syscalls.c into sys/security/mac/mac_prison.c instead, as these are not really system calls, and export mac_label_copyin_string() from the former.

Dec 23 2025, 12:35 AM

Dec 20 2025

kevans added inline comments to D53958: kern: add a mac.label jail parameter.
Dec 20 2025, 10:54 PM

Dec 19 2025

kevans requested review of D54322: wg: add a more useful debug message for an unknown family.
Dec 19 2025, 10:24 PM
kevans committed rGa8c594d27779: files.amd64: remove some lines duplicated from files.x86 (authored by kevans).
files.amd64: remove some lines duplicated from files.x86
Dec 19 2025, 10:18 PM
kevans closed D54295: files.amd64: remove some lines duplicated from files.x86.
Dec 19 2025, 10:17 PM
kevans added inline comments to D53954: [RFC] kern: mac: add various jail MAC hooks.
Dec 19 2025, 4:05 AM
kevans updated the diff for D53954: [RFC] kern: mac: add various jail MAC hooks.

Highlights:

  • Remove vfs_opterror() for those entry points that take the opts already
  • Move one case of mac_prison_check_get back as a special-case to avoid breaking jail enumeration.
  • Unbreak the build of this patch: prison_copy_label comes in a later change
  • Drop redundant JAIL_ATTACH check
Dec 19 2025, 4:05 AM

Dec 18 2025

kevans requested review of D54295: files.amd64: remove some lines duplicated from files.x86.
Dec 18 2025, 8:12 PM
kevans committed rG33a3ccfc1618: if_tuntap: defer transient destroy_dev() to a taskqueue (authored by kevans).
if_tuntap: defer transient destroy_dev() to a taskqueue
Dec 18 2025, 3:53 AM

Dec 17 2025

kevans committed rG2a87929671e6: bectl: log modifying functions to zpool history (authored by rob.norris_klarasystems.com).
bectl: log modifying functions to zpool history
Dec 17 2025, 5:02 PM

Dec 16 2025

kevans added a comment to D53954: [RFC] kern: mac: add various jail MAC hooks.

I'm not sure I understand this last bit

Oh... It's just a pilot error on my part, sorry!

I'm already passing the struct vfsoptlist all around so that MAC modules can reject jail_[sg]et operations based on the parameters they want to fetch or set.

Don't know how I managed to forget that for a while.

I just wanted to limit propagation of struct vfsoptlist elsewhere, but passing it makes sense for some hooks, so nevermind.

Dec 16 2025, 4:03 PM
kevans added a comment to D53954: [RFC] kern: mac: add various jail MAC hooks.

I'm not too worried about that, though it does occur to me that it probably makes sense to stop setting an error in the opts for any of those checks. The MAC policy should probably have free reign over both errno and error probably in case it's some kind of custom vendor integration.

I agree, we should probably stop setting the err opt. But that doesn't solve the discoverability of whether MAC (and not, e.g., real nonexistence of a jail) was the reason some access was denied, as in non-MAC we still set "errmsg" in the VFS options.

Giving this control to MAC modules would be nice; that requires obviously changing the interface of the hooks (if you do it, please don't pass struct vfsoptlist all around, but instead some function pointer to a printf-like function, so that we can clean up the use of struct vfsoptlist in jails at some point).

Dec 16 2025, 3:51 PM
kevans added a comment to D53954: [RFC] kern: mac: add various jail MAC hooks.

Coming back to highlights, there's indeed still the problem that enumeration returns an error if the last jail is denied via mac_prison_check_get(), so doing what you suggest is probably mandatory: Put back the MAC check in the loop, and once a jail is returned, jump to a prison_found_nomac label, even a _nomac_noalive variant as to eliminate also the (harmless) redundant test.

Additionally, as mentioned before, there's that, if mac_prison_check_get() denies access, we return a VFS error saying "access denied by MAC" which would be an info leak for situations where the jail must remain hidden. E.g., we could have mac_prison_check_get() return EPERM for a visible deny and ENOENT for an invisible one, and then treat them differently with respect to vfs_opterror(). But it seems that goes farther than what you're envisioning at this point (I haven't checked further revisions in the series thoroughly yet, to see if they need something like this).

Dec 16 2025, 2:24 PM