Page MenuHomeFreeBSD

markj (Mark Johnston)
User

Projects (9)

User Details

User Since
Mar 12 2014, 1:00 AM (651 w, 14 h)

Recent Activity

Today

markj accepted D59319: syslogd: reap pipe children on config reload.

I wrote a regression test case for this bug, will commit it after this patch lands.

Wed, Sep 2, 2:32 PM
markj added a comment to D58094: Capsicumise truss(1).

Some test cases were added to usr.bin/truss/tests recently. I wonder if they pass when truss is running in capmode?

Wed, Sep 2, 2:01 PM
markj accepted D35406: intr/x86: remove ->pic_vector() from x86 interrupt framework.
Wed, Sep 2, 1:55 PM
markj committed rG7cb1a76f8815: devstat: Fix a kernel stack disclosure (authored by markj).
devstat: Fix a kernel stack disclosure
Wed, Sep 2, 1:33 PM
markj closed D59309: devstat: Fix a kernel stack disclosure.
Wed, Sep 2, 1:32 PM
markj added a comment to D58094: Capsicumise truss(1).

Why is capability mode optional?

Wed, Sep 2, 1:28 PM
markj added inline comments to D59281: dtrace/arm: Really trap translation faults.
Wed, Sep 2, 1:17 PM
markj accepted D59280: dtrace/arm: Fix and de-pessimize dtrace_copy.
Wed, Sep 2, 1:15 PM
markj added a comment to D59279: sys/arm: Fix DTrace trap hook.

Looks good to me, just a small comment.

Wed, Sep 2, 1:07 PM
markj accepted D59320: powerpc/radix: acquire the pmap lock in mmu_radix_extract().
Wed, Sep 2, 12:59 PM
markj accepted D59317: ptrace(2): allow ptrace(PT_TRACE_ME) in cap mode.
Wed, Sep 2, 12:57 AM

Yesterday

markj added a comment to D59309: devstat: Fix a kernel stack disclosure.
In D59309#1360831, @kib wrote:

You could memset only device_name then, right before strcpy(). It would be more clear IMHO.

Tue, Sep 1, 8:21 PM
markj accepted D59130: git-arc: SC2223 DoS-via-glob hardening.

A heretofore undiscovered (and unmitigated) exploit that allows an attacker to write to a region of memory may allow setting one but not the other.

Tue, Sep 1, 6:42 PM · Src Committers
markj added a comment to D59309: devstat: Fix a kernel stack disclosure.

Use of memset() should be systematic on stack-allocated structures for security reasons. The compiler normally eliminates the dead stores.

Tue, Sep 1, 6:14 PM
markj added a comment to D59307: syslogd: do not turn pipe exec process into zombies.
*.* |exec /home/bapt/crap.sh

cat /home/bapt/crap.sh

#!/bin/sh
id
echo plop
sleep 1

It creates defunct for me on latest current without my patch.

Tue, Sep 1, 5:53 PM
markj added a comment to D59307: syslogd: do not turn pipe exec process into zombies.

I can't reproduce any zombie leak if I do something like *.* |sleep 10 in syslog.conf. Do you have some repro steps?

Tue, Sep 1, 5:03 PM
markj added a comment to D59309: devstat: Fix a kernel stack disclosure.

Use of memset() should be systematic on stack-allocated structures for security reasons. The compiler normally eliminates the dead stores.

That said, here, it's unclear to me there is a problem in the first place: All fields are effectively filled, they are all 4-byte aligned, including the fields with enumeration type (the underlying type being int), and the total structure size is a multiple of 8, so there's no padding anywhere. Which are the bytes that are actually leaked?

Tue, Sep 1, 4:59 PM
markj added a comment to D59130: git-arc: SC2223 DoS-via-glob hardening.

Context.

All my seceng colleagues point out that unquoted parameter expansion with the unintended consequences of glob expansion is a lack of defense-in-depth architecture with security implications.

In that context, this is very much a security bug.

Tue, Sep 1, 4:47 PM · Src Committers
markj requested review of D59309: devstat: Fix a kernel stack disclosure.
Tue, Sep 1, 4:07 PM
markj added inline comments to D59307: syslogd: do not turn pipe exec process into zombies.
Tue, Sep 1, 4:05 PM
markj accepted D59285: tests/sys/kern/ktls_test: fix -Wsign-compare issue.
Tue, Sep 1, 3:43 PM
markj committed rG1b8ccb02ac72: lib9p: Make it a private library (authored by markj).
lib9p: Make it a private library
Tue, Sep 1, 3:35 PM
markj closed D58828: lib9p: Make it a private library.
Tue, Sep 1, 3:35 PM
markj added a comment to D59130: git-arc: SC2223 DoS-via-glob hardening.

What security problem is being fixed here?

Denial-of-Service.

A poisoned LOCALBASE value such as:

LOCALBASE='/*/*/*/*/*/*/*/*/*/* /*/*/*/*/*/*/*/*/*/* /*/*/*/*/*/*/*/*/*/* /*/*/*/*/*/*/*/*/*/* /*/*/*/*/*/*/*/*/*/*'

NB: That's 5x (10x /*)

Causes massive disk I/O and only in the minority of cases with little-to-no filesystem contents does it only result in a minor inconvenience (sub 30 second delay in launch) whereas on moderately to substantially loaded filesystems (with many files) does it in-turn result in never getting passed the : ${LOCALBASE:=...} line.

What's going on when you don't quote the parameter expansion, is that globs get expanded. Yes, it's true that : throws those expanded arguments away, but the damage is done in the I/O and compute required to expand those globs.

Quoting the parameter expansion (as-in : "${LOCALBASE:=...}" prevents any globs stuffed into a poisoned LOCALBASE rendered inert.

Literally ShellCheck's SC2223 DoS-via-glob warning.

If someone can modify your environment variables, you're in a bad place already, e.g., if they point ARC_CMD to a script of their choosing.

While imaginative (injecting a 3rd party into the mix via "someone") that's not exactly the concern.

Tue, Sep 1, 2:51 PM · Src Committers
markj added a comment to D59084: sound: Prefer idle primary channels when allocating.

The patch looks like it does what the review description says it does, but apparently it doesn't actually fix the cited PR?

Yes. I cited the PR because it does fix an issue raised indirectly in the PR. Should I omit the "PR" line?

Tue, Sep 1, 2:29 PM
markj added a comment to D59130: git-arc: SC2223 DoS-via-glob hardening.

What security problem is being fixed here?

Denial-of-Service.

A poisoned LOCALBASE value such as:

LOCALBASE='/*/*/*/*/*/*/*/*/*/* /*/*/*/*/*/*/*/*/*/* /*/*/*/*/*/*/*/*/*/* /*/*/*/*/*/*/*/*/*/* /*/*/*/*/*/*/*/*/*/*'

NB: That's 5x (10x /*)

Causes massive disk I/O and only in the minority of cases with little-to-no filesystem contents does it only result in a minor inconvenience (sub 30 second delay in launch) whereas on moderately to substantially loaded filesystems (with many files) does it in-turn result in never getting passed the : ${LOCALBASE:=...} line.

What's going on when you don't quote the parameter expansion, is that globs get expanded. Yes, it's true that : throws those expanded arguments away, but the damage is done in the I/O and compute required to expand those globs.

Quoting the parameter expansion (as-in : "${LOCALBASE:=...}" prevents any globs stuffed into a poisoned LOCALBASE rendered inert.

Literally ShellCheck's SC2223 DoS-via-glob warning.

Tue, Sep 1, 2:12 PM · Src Committers
markj accepted D59162: git-arc: Fix locals.
Tue, Sep 1, 2:04 PM · Src Committers
markj accepted D59265: arm64 pmap: correct the condition for determining when to flush the icache.
Tue, Sep 1, 1:54 PM
markj accepted D59282: tests/sys/kern/procdesc.c: mark grandchild var in pdopenpid_capmode() as volatile.

Why not use atomics?

Tue, Sep 1, 1:26 PM
markj accepted D59252: pdopenpid(2): in cap mode, translate all errors from pdopenpid1() to ECAPMODE.
Tue, Sep 1, 1:19 PM
markj added a comment to D59276: kyua: Add execution plan concept.
In D59276#1360076, @kp wrote:

That's an interesting idea.

Tue, Sep 1, 12:44 PM

Fri, Aug 28

markj accepted D58586: pdptrace(2).
Fri, Aug 28, 11:30 AM
markj accepted D58989: Allow pdptrace(2) and pdopenpid(2) in capability mode.
Fri, Aug 28, 11:22 AM
markj committed rG44b83210c8ad: unix: Fix a socket leak (authored by markj).
unix: Fix a socket leak
Fri, Aug 28, 11:12 AM
markj closed D59201: unix: Fix a socket leak.
Fri, Aug 28, 11:11 AM
markj committed rGc869a36fc98a: rangelock: Fix format strings for 32-bit kernels (authored by markj).
rangelock: Fix format strings for 32-bit kernels
Fri, Aug 28, 1:26 AM

Thu, Aug 27

markj committed rG2e376cca379b: rangelock: Reimplement _rangelock_cookie_assert() (authored by markj).
rangelock: Reimplement _rangelock_cookie_assert()
Thu, Aug 27, 11:30 PM
markj closed D59222: rangelock: Reimplement _rangelock_cookie_assert().
Thu, Aug 27, 11:30 PM
markj added inline comments to D58989: Allow pdptrace(2) and pdopenpid(2) in capability mode.
Thu, Aug 27, 11:25 PM
markj accepted D58586: pdptrace(2).
Thu, Aug 27, 11:03 PM
markj committed rGfef9077cf816: netipsec: Implement pr_disconnect for PF_KEY sockets (authored by Ryan Campbell <rycampbell@qnx.com>).
netipsec: Implement pr_disconnect for PF_KEY sockets
Thu, Aug 27, 6:38 PM
markj added a comment to D59226: bhyveload: add non-interactive mode.

Does running bhyveload ... </dev/null not provide the desired behaviour?

Thu, Aug 27, 6:26 PM
markj added inline comments to D59201: unix: Fix a socket leak.
Thu, Aug 27, 4:54 PM
markj updated the diff for D59201: unix: Fix a socket leak.

More comments.

Thu, Aug 27, 3:36 PM
markj accepted D59085: snd_dummy: Bump primary channel count.
Thu, Aug 27, 2:35 PM
markj added a comment to D59084: sound: Prefer idle primary channels when allocating.

The patch looks like it does what the review description says it does, but apparently it doesn't actually fix the cited PR?

Thu, Aug 27, 2:35 PM
markj updated the diff for D59222: rangelock: Reimplement _rangelock_cookie_assert().

Improve messages

Thu, Aug 27, 2:21 PM
markj added inline comments to D58989: Allow pdptrace(2) and pdopenpid(2) in capability mode.
Thu, Aug 27, 2:10 PM
markj added inline comments to D58586: pdptrace(2).
Thu, Aug 27, 2:02 PM
markj committed rGd6f5c6531e48: netmap: Use ckdint.h helpers to check for overflow (authored by markj).
netmap: Use ckdint.h helpers to check for overflow
Thu, Aug 27, 1:34 PM
markj committed rG00a793def743: pf: Fix fallout from the STATE_LOOKUP macro removal (authored by markj).
pf: Fix fallout from the STATE_LOOKUP macro removal
Thu, Aug 27, 1:34 PM
markj closed D58896: netmap: Use ckdint.h helpers to check for overflow.
Thu, Aug 27, 1:33 PM
markj closed D59015: pf: Fix fallout from the STATE_LOOKUP macro removal.
Thu, Aug 27, 1:33 PM
markj requested review of D59222: rangelock: Reimplement _rangelock_cookie_assert().
Thu, Aug 27, 1:28 PM
markj added inline comments to D59201: unix: Fix a socket leak.
Thu, Aug 27, 12:58 PM

Wed, Aug 26

markj abandoned D59016: tests/pf: Make divapp more general.
Wed, Aug 26, 8:37 PM
markj added a comment to D59016: tests/pf: Make divapp more general.

Probably a simple parameter like in the following patch could be good enough and a bit more descriptive: https://reviews.freebsd.org/D59067.

Wed, Aug 26, 8:37 PM
markj accepted D59067: netpfil tests: Make divapp packet loop handling opt-in.
Wed, Aug 26, 8:36 PM
markj added inline comments to D59201: unix: Fix a socket leak.
Wed, Aug 26, 8:19 PM
markj added a reviewer for D59201: unix: Fix a socket leak: inquire_JohnEricson.me.
Wed, Aug 26, 8:11 PM
markj requested review of D59201: unix: Fix a socket leak.
Wed, Aug 26, 8:11 PM
markj accepted D59144: install: Fix two bugs in stdin code.
Wed, Aug 26, 3:01 PM
markj added inline comments to D59034: sendfile(2): rework compat implementation.
Wed, Aug 26, 1:34 PM
markj accepted D59034: sendfile(2): rework compat implementation.
Wed, Aug 26, 1:33 PM
markj added a comment to D59198: sendfile: remove COMPAT_FREEBSD4 from kern_sendfile.

This is a bit more complex than I was hoping. I do wonder if we really need all of these separate callbacks, vs. one callback for the initial copyin plus the header and trailer copyins. That would require a bit more code in the callbacks but seems simpler overall.

Wed, Aug 26, 1:32 PM
markj accepted D58496: localedef: Const correctness for C23.
Wed, Aug 26, 1:25 PM

Tue, Aug 25

markj committed rGcb7009867ae6: socket: Restore handling of IPPROTO_DIVERT (authored by markj).
socket: Restore handling of IPPROTO_DIVERT
Tue, Aug 25, 6:18 PM
markj committed rGd70e5b3a735e: conf: Add COMPAT_FREEBSD15 (authored by markj).
conf: Add COMPAT_FREEBSD15
Tue, Aug 25, 6:18 PM
markj committed rG918fbc947356: pf: Re-optimize state key handling (authored by markj).
pf: Re-optimize state key handling
Tue, Aug 25, 6:18 PM
markj closed D58922: pf: Re-optimize state key handling.
Tue, Aug 25, 6:18 PM
markj closed D59018: socket: Restore handling of IPPROTO_DIVERT.
Tue, Aug 25, 6:18 PM
markj closed D59017: conf: Add COMPAT_FREEBSD15.
Tue, Aug 25, 6:18 PM
markj accepted D59030: dtrace/tests: compile D sources at runtime on test target.
Tue, Aug 25, 6:03 PM
markj changed the visibility for D59102: hwpmc: Fix the exec handler.
Tue, Aug 25, 6:00 PM
markj changed the visibility for D58912: dsp: Fix a potential use-after-free in dsp_oss_syncstart().
Tue, Aug 25, 6:00 PM
markj changed the visibility for D59126: tty: Revalidate after dropping the tty lock in ioctl handlers.
Tue, Aug 25, 6:00 PM
markj changed the visibility for D59104: posixshm: Fix a TOCTOU race in the FIOSSHMLPGCNF handler.
Tue, Aug 25, 6:00 PM
markj added inline comments to D59034: sendfile(2): rework compat implementation.
Tue, Aug 25, 5:58 PM
markj accepted D59113: ptrace(PT_GET_ABI_NAME).
Tue, Aug 25, 5:56 PM
markj added a comment to D59164: git-arc: Add a "resolve" subcommand.

I get what you're trying to do. However, I would suggest that instead of a separate sub-command which cannot stand on its own, that we try to leverage common knowledge.

If we emulate "git rebase" by implementing a "--continue" and "--abort" then when a patch fails to apply, we can tell the user that they should try and resolve conflicts and then execute one of:

git arc patch --continue
git arc patch --abort

The combination of (1) catching the error and (2) telling the user to use one of these two (3) saves the user from having to retype the diff argument, at (4) the simple cost of a small cache file that is cleaned up on success.

That would provide direct access to the final patch_commit stage without inventing a partial wrapper over the process as a new sub-command.

Also, --abort could restore the tree from before patch started.

Tue, Aug 25, 5:34 PM
markj accepted D59129: git-arc: Handle -h on subcommands and align usage with the man page.
Tue, Aug 25, 5:33 PM · Src Committers
markj committed rG986bc26c4e73: unix/stream: fix instant panic w/o INVARIANTS (authored by glebius).
unix/stream: fix instant panic w/o INVARIANTS
Tue, Aug 25, 4:07 PM
markj committed rG2fdcba9f607e: openssl: Fix multiple vulnerabilities (authored by gordon).
openssl: Fix multiple vulnerabilities
Tue, Aug 25, 4:03 PM
markj committed rG88e7371d9dc2: Add UPDATING entries and bump version (authored by markj).
Add UPDATING entries and bump version
Tue, Aug 25, 4:03 PM
markj committed rGa372e73712cf: posixshm: Fix a TOCTOU race in the FIOSSHMLPGCNF handler (authored by markj).
posixshm: Fix a TOCTOU race in the FIOSSHMLPGCNF handler
Tue, Aug 25, 4:03 PM
markj committed rG6f2cb690d4b8: unix/stream: fix a race with MSG_PEEK on SOCK_SEQPACKET with MSG_EOR (authored by glebius).
unix/stream: fix a race with MSG_PEEK on SOCK_SEQPACKET with MSG_EOR
Tue, Aug 25, 4:03 PM
markj committed rGcf7a1c605a9f: unix/stream: plug a corner case when control externalization failed (authored by glebius).
unix/stream: plug a corner case when control externalization failed
Tue, Aug 25, 4:03 PM
markj committed rG2af6611275b0: unix/stream: fix instant panic w/o INVARIANTS (authored by glebius).
unix/stream: fix instant panic w/o INVARIANTS
Tue, Aug 25, 4:03 PM
markj committed rG5c00c1e02276: ppp: Fix a buffer overflow in the endpoint discriminator set command (authored by markj).
ppp: Fix a buffer overflow in the endpoint discriminator set command
Tue, Aug 25, 4:03 PM
markj committed rGb936c3417027: tty: Revalidate after dropping the tty lock in ioctl handlers (authored by markj).
tty: Revalidate after dropping the tty lock in ioctl handlers
Tue, Aug 25, 4:03 PM
markj committed rG428f4b194cef: ppp: Reject invalid endpoint discriminator options (authored by markj).
ppp: Reject invalid endpoint discriminator options
Tue, Aug 25, 4:02 PM
markj committed rG23deefa40b8d: ppp: Avoid overflow when formatting endpoint discriminator options (authored by markj).
ppp: Avoid overflow when formatting endpoint discriminator options
Tue, Aug 25, 4:02 PM
markj committed rG97b7439e3b06: cred: Fix group_is_primary() (authored by markj).
cred: Fix group_is_primary()
Tue, Aug 25, 4:02 PM
markj committed rG275b424d3cc2: openssl: Fix multiple vulnerabilities (authored by gordon).
openssl: Fix multiple vulnerabilities
Tue, Aug 25, 4:02 PM
markj committed rG48c25324ff1c: dsp: Fix a potential use-after-free in dsp_oss_syncstart() (authored by markj).
dsp: Fix a potential use-after-free in dsp_oss_syncstart()
Tue, Aug 25, 4:02 PM
markj committed rG0e4c26a82cb1: unix: Fix some bugs in the SOCK_STREAM receive path (authored by markj).
unix: Fix some bugs in the SOCK_STREAM receive path
Tue, Aug 25, 4:02 PM
markj committed rGe034ae898328: hwpmc: Fix the execve handler (authored by markj).
hwpmc: Fix the execve handler
Tue, Aug 25, 4:02 PM
markj committed rG357aa8af5304: crypto/openssl: correct version numbers for pkg-config files (authored by ngie).
crypto/openssl: correct version numbers for pkg-config files
Tue, Aug 25, 4:02 PM
markj committed rG6fb0f1327558: x86/ucode: add const where appropriate (authored by chs).
x86/ucode: add const where appropriate
Tue, Aug 25, 4:02 PM
markj committed rGa0e96483e2ce: ucode: Fix validation on Intel platforms (authored by markj).
ucode: Fix validation on Intel platforms
Tue, Aug 25, 4:02 PM