Page MenuHomeFreeBSD

markj (Mark Johnston)
User

Projects (9)

User Details

User Since
Mar 12 2014, 1:00 AM (637 w, 6 d)

Recent Activity

Yesterday

markj committed rG68004e56fdc2: net: Fix handling of unmapped user pages in if_getgroup() (authored by markj).
net: Fix handling of unmapped user pages in if_getgroup()
Mon, Jun 1, 6:30 PM
markj committed rG49d90d9ddfc1: lagg: Handle a port count of zero (authored by markj).
lagg: Handle a port count of zero
Mon, Jun 1, 6:30 PM
markj closed D57154: net: Fix handling of unmapped user pages in if_getgroup().
Mon, Jun 1, 6:30 PM
markj closed D56942: lagg: Handle a port count of zero.
Mon, Jun 1, 6:30 PM
markj added a comment to D57386: linux: Return an error for invalid inotify masks.

Same as D57387.

Mon, Jun 1, 6:25 PM
markj abandoned D57386: linux: Return an error for invalid inotify masks.
Mon, Jun 1, 6:25 PM
markj accepted D57387: linuxulator: Return EINVAL for invalid inotify flags.
Mon, Jun 1, 6:25 PM
markj requested review of D57386: linux: Return an error for invalid inotify masks.
Mon, Jun 1, 6:20 PM
markj updated the diff for D57342: ip6: Drop dead code in ip6_input_hbh().
  • increment more counters
  • add a branch annotation
Mon, Jun 1, 5:07 PM
markj added inline comments to D57342: ip6: Drop dead code in ip6_input_hbh().
Mon, Jun 1, 5:02 PM
markj added a comment to D56942: lagg: Handle a port count of zero.

I'm OK with this revision, although I think an explicit memory barrier while increasing / decreasing sc->sc_count will make the code more clear than a NULL check in the reader side (lagg_rr_start).

A memory barrier isn't sufficient. For sc_count and length(sc_ports) to be consistent with each other, you need a mutex.

The writer side is lagg_port_create() and lagg_port_destroy(). They are serialized. The reader side always checks sc_count before accessing sc_ports, so this order should be sufficient for the writer side,

diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 0333162da0d4..226565633b3a 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -879,7 +879,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
                CK_SLIST_INSERT_AFTER(tlp, lp, lp_entries);
        else
                CK_SLIST_INSERT_HEAD(&sc->sc_ports, lp, lp_entries);
-       sc->sc_count++;
+       atomic_add_rel_int(&sc->sc_count, 1);
 
        lagg_setmulti(lp);
 
@@ -962,8 +962,8 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport)
        }
 
        /* Finally, remove the port from the lagg */
+       atomic_add_rel_int(&sc->sc_count, -1);
        CK_SLIST_REMOVE(&sc->sc_ports, lp, lagg_port, lp_entries);
-       sc->sc_count--;
 
        /* Update the primary interface */
        if (lp == sc->sc_primary) {

The reader side use atomic_load_acq_int() to get sc_count, then iterate sc_ports.

Mon, Jun 1, 4:36 PM
markj added a comment to D57372: mtree: own bhyve run dir by 'vmm' group.

in this case

You might further specify which case this is?

In case of running bhyve as a non-root user.

Mon, Jun 1, 3:55 PM
markj added a comment to D56942: lagg: Handle a port count of zero.

I'm OK with this revision, although I think an explicit memory barrier while increasing / decreasing sc->sc_count will make the code more clear than a NULL check in the reader side (lagg_rr_start).

Mon, Jun 1, 3:33 PM
markj added a comment to D57372: mtree: own bhyve run dir by 'vmm' group.

in this case

Mon, Jun 1, 12:56 PM
markj accepted D57376: MAC/do: Fix double-free on parse error after "executable paths" feature.

Is it possible to add a regression test?

Mon, Jun 1, 12:45 PM
markj accepted D57368: amd64: there is no reason to copy ucode around in ucode_load_bsp().
Mon, Jun 1, 12:40 PM

Sat, May 30

markj committed rGf048a1a1decb: tests/ipsec: Run in parallel (authored by markj).
tests/ipsec: Run in parallel
Sat, May 30, 1:17 AM

Fri, May 29

markj committed rG7f8d45bb5f66: linux: Fix some problems with header pollution (authored by markj).
linux: Fix some problems with header pollution
Fri, May 29, 10:10 PM
markj committed rG795416bc233d: tcp: Remove a no-op eventhandler (authored by markj).
tcp: Remove a no-op eventhandler
Fri, May 29, 10:10 PM
markj committed rG048458a434a1: amd64/vmparam: Fix KASAN shadow map size in comment (authored by zishun.yi.dev_gmail.com).
amd64/vmparam: Fix KASAN shadow map size in comment
Fri, May 29, 10:10 PM
markj committed rGcb62bc13b2a5: kinst/arm64: Handle an additional PC-relative instruction (authored by markj).
kinst/arm64: Handle an additional PC-relative instruction
Fri, May 29, 10:09 PM
markj committed rG25bb939c7871: kinst/arm64: Fix return values from kinst_invop() (authored by markj).
kinst/arm64: Fix return values from kinst_invop()
Fri, May 29, 10:09 PM
markj committed rGe97ce8cae292: tests/if_carp: Run all tests with execenv=jail (authored by markj).
tests/if_carp: Run all tests with execenv=jail
Fri, May 29, 10:09 PM
markj committed rGc5ad71c31160: eventhandler: Fix the NODEBUG build (authored by markj).
eventhandler: Fix the NODEBUG build
Fri, May 29, 9:40 PM
markj committed rG81e894d5f3b4: epoch: Don't idle CPUs when there's pending epoch work (authored by markj).
epoch: Don't idle CPUs when there's pending epoch work
Fri, May 29, 8:58 PM
markj committed rG4a875b186e8d: eventhandler: Fix a race when pruning eventhandlers (authored by markj).
eventhandler: Fix a race when pruning eventhandlers
Fri, May 29, 8:58 PM
markj accepted D57328: imgact_elf: add sysctl kern.elfXX.phnums for the number of program headers.
Fri, May 29, 7:37 PM
markj requested review of D57342: ip6: Drop dead code in ip6_input_hbh().
Fri, May 29, 7:33 PM
markj added a comment to D57154: net: Fix handling of unmapped user pages in if_getgroup().

Ping? I've converted the locking here as requested.

Fri, May 29, 7:24 PM
markj added a comment to D56942: lagg: Handle a port count of zero.

Ping? I'd like to commit this if there are no objections. The bug it fixes is real, and this patch or something like it is required no matter how other if_lagg lifecycle issues are handled.

Fri, May 29, 7:23 PM
markj requested review of D57341: udp: Fix resource leaks in an error path in udp6_send().
Fri, May 29, 7:18 PM
markj added inline comments to D56166: Add filename glob matching to mac_bsdextended.
Fri, May 29, 5:45 PM

Thu, May 28

markj accepted D57291: inpcb: make net.inet.ip.portrange port number limiting sysctls unsigned.
Thu, May 28, 8:26 PM
markj added inline comments to D57305: vfs: work around the race between vget() and vnlru.
Thu, May 28, 7:42 PM
markj added inline comments to D57304: dhclient.conf.5: Add supersede interface-mtu to example.
Thu, May 28, 6:24 PM
markj accepted D57266: rtnetlink: Fix weight overflow in RTA_MULTIPATH.
Thu, May 28, 3:27 PM
markj accepted D57294: imgact_elf: read program headers if not contained in the first page.
Thu, May 28, 3:25 PM
markj added inline comments to D57294: imgact_elf: read program headers if not contained in the first page.
Thu, May 28, 3:15 PM
markj added inline comments to D57294: imgact_elf: read program headers if not contained in the first page.
Thu, May 28, 3:04 PM
markj added a comment to D57274: bsdinstall: Use libarchive secure flags for extract.

I mean, sure, I guess, but what's the threat model here? I sure hope you trust the tarballs you're unpacking to install a system not to be malicious, otherwise what's the point?

I could come up with a contrived exploit scenario, but yes if someone controls the tarballs being unpacked during install it's likely much easier to just provide a trojaned binary.

This came to secteam and I thought "sure, why not."

Thu, May 28, 1:07 PM
markj added inline comments to D57294: imgact_elf: read program headers if not contained in the first page.
Thu, May 28, 12:47 PM
markj accepted D57274: bsdinstall: Use libarchive secure flags for extract.
Thu, May 28, 12:25 PM
markj accepted D57298: certctl: Style nits.
Thu, May 28, 12:16 PM
markj accepted D49566: sys: add safe_read(9).
Thu, May 28, 12:14 PM
markj accepted D57297: tests: Fix reliability issues in POSIX ACL tests.
Thu, May 28, 12:07 PM
markj added inline comments to D57294: imgact_elf: read program headers if not contained in the first page.
Thu, May 28, 11:56 AM

Wed, May 27

markj committed rG96256587b06c: ucode: ucode_error can be defined with static (authored by markj).
ucode: ucode_error can be defined with static
Wed, May 27, 9:13 PM
markj committed rG0beb17289849: ucode: Fix validation on Intel platforms (authored by markj).
ucode: Fix validation on Intel platforms
Wed, May 27, 9:13 PM
markj closed D57209: ucode: Fix validation on Intel platforms.
Wed, May 27, 9:13 PM
markj added inline comments to D57266: rtnetlink: Fix weight overflow in RTA_MULTIPATH.
Wed, May 27, 3:54 PM
markj added a comment to D57247: virtio-scsi: handle device capacity change event.

Not really a domain expert, either, am I. Can you give me a clue about how to test this? I can use virtio-scsi with bhyve. But how does one tell bhyve to tell the guest that the storage capacity has changed?

Wed, May 27, 3:46 PM

Tue, May 26

markj committed rGc564074c9aaa: divert: Avoid using atomic_(load|store)_(acq|rel)_16 (authored by markj).
divert: Avoid using atomic_(load|store)_(acq|rel)_16
Tue, May 26, 6:28 PM
markj committed rGccb14be785f7: bhyve/virtio-scsi: Make all I/O processing parameters configurable (authored by rosenfeld_grumpf.hope-2000.org).
bhyve/virtio-scsi: Make all I/O processing parameters configurable
Tue, May 26, 4:08 PM
markj committed rG9542ddb21dc1: bhyve/virtio-scsi: Support multiple backends (authored by rosenfeld_grumpf.hope-2000.org).
bhyve/virtio-scsi: Support multiple backends
Tue, May 26, 4:08 PM
markj committed rG19728f98cb5c: bhyve/virtio-scsi: Implement task management functions (authored by rosenfeld_grumpf.hope-2000.org).
bhyve/virtio-scsi: Implement task management functions
Tue, May 26, 4:08 PM
markj committed rG895a0ae67fe2: divert: Define semantics for SO_REUSEPORT_LB on divert sockets (authored by markj).
divert: Define semantics for SO_REUSEPORT_LB on divert sockets
Tue, May 26, 4:08 PM
markj committed rG4151296fdcba: bhyve/virtio-scsi: Support for multiple targets (authored by rosenfeld_grumpf.hope-2000.org).
bhyve/virtio-scsi: Support for multiple targets
Tue, May 26, 4:08 PM
markj closed D56563: divert: Define semantics for SO_REUSEPORT_LB on divert sockets.
Tue, May 26, 4:08 PM
markj closed D54073: bhyve/virtio-scsi: Make all I/O processing parameters configurable.
Tue, May 26, 4:07 PM
markj closed D53223: bhyve/virtio-scsi: Support multiple backends.
Tue, May 26, 4:07 PM
markj closed D53222: bhyve/virtio-scsi: Implement task management functions.
Tue, May 26, 4:07 PM
markj closed D53221: bhyve/virtio-scsi: Support for multiple targets.
Tue, May 26, 4:07 PM
markj added inline comments to D49566: sys: add safe_read(9).
Tue, May 26, 3:55 PM
markj added inline comments to D49566: sys: add safe_read(9).
Tue, May 26, 2:28 PM
markj accepted D57244: sigqueue: In capability mode, only allow signalling self.
Tue, May 26, 2:19 PM
markj added a comment to D57244: sigqueue: In capability mode, only allow signalling self.

Shall we update the kill test in tests/sys/capsicum/capmode.cc to verify sigqueue too?

Tue, May 26, 2:18 PM
markj added a comment to D57244: sigqueue: In capability mode, only allow signalling self.

Shall we update the kill test in tests/sys/capsicum/capmode.cc to verify sigqueue too?

Tue, May 26, 2:18 PM
markj accepted D57241: inpcb: a pcb may travel only from the wild hash to exact, not vice versa.
Tue, May 26, 2:15 PM
markj abandoned D57245: divert: Fix handling of the bound state.

Sorry, never mind, I missed that dcb_bound is set implicitly via the union.

Tue, May 26, 1:53 PM
markj requested review of D57245: divert: Fix handling of the bound state.
Tue, May 26, 1:41 PM
markj accepted D53223: bhyve/virtio-scsi: Support multiple backends.
Tue, May 26, 1:49 AM
markj accepted D53221: bhyve/virtio-scsi: Support for multiple targets.
Tue, May 26, 1:48 AM
markj accepted D54073: bhyve/virtio-scsi: Make all I/O processing parameters configurable.
Tue, May 26, 1:34 AM
markj accepted D57046: sysutils/cpu-microcode-intel: Handle extended signature tables.

My comments are just nits, I think the change is fine.

Tue, May 26, 1:25 AM

Mon, May 25

markj added a comment to D57096: Close files that were opened by guest VM via 9pfs.

When all handles referencing a vnode are closed, VOP_INACTIVE (implemented by p9fs_inactive()) should be closed. Isn't that the right place to clunk the file? From what I can see, that's currently happening in p9fs_reclaim() which is too late as you say.

Mon, May 25, 7:01 PM
markj added inline comments to D57124: sys: add pdopenpid(2).
Mon, May 25, 5:03 PM
markj added a comment to D57238: vt: Drain select/poll threads when closing /dev/sysmouse.

Actually this one doesn't matter too much since sysmouse_bufpoll isn't dynamically allocated.

Mon, May 25, 4:46 PM
markj requested review of D57238: vt: Drain select/poll threads when closing /dev/sysmouse.
Mon, May 25, 4:11 PM
markj committed rG151f0971eaa7: eventhandler: Fix the NODEBUG build (authored by markj).
eventhandler: Fix the NODEBUG build
Mon, May 25, 3:59 PM
markj committed rGdeea28af8dce: amd64/vmm: Fix ppt_unmap_mmio() after commit 36b855f18925 (authored by markj).
amd64/vmm: Fix ppt_unmap_mmio() after commit 36b855f18925
Mon, May 25, 3:16 PM
markj committed rG473ba783fa0f: if_vlan: Use the exclusive lock everywhere (authored by markj).
if_vlan: Use the exclusive lock everywhere
Mon, May 25, 3:16 PM
markj committed rGbc70af0acdda: eventhandler: Fix a race when pruning eventhandlers (authored by markj).
eventhandler: Fix a race when pruning eventhandlers
Mon, May 25, 3:16 PM
markj added inline comments to D57124: sys: add pdopenpid(2).
Mon, May 25, 2:58 PM
markj accepted D57185: lpd: Fix issues reported by clang-analyzer.
Mon, May 25, 2:41 PM
markj added a comment to D57163: pddupfd(2).

I cannot apply the patch, it fails in pdfork.2. (I already applied the pdopenpid() patch.) Could you please rebase? Or, if your branch is already public, could you please include a pointer to it in the review description so that it's easier for me to fetch? That makes it easier for me to e.g., write syzkaller descriptions for new syscalls.

Mon, May 25, 2:39 PM
markj accepted D57183: lpd: Drop deprecated -p option.
Mon, May 25, 2:33 PM
markj accepted D50614: tests: Allow building without TIOCSTI.

In my tree I hid the sysctl to find consumers and confirm that the system works without it. The consumers are:

Mon, May 25, 2:30 PM
markj updated the diff for D57209: ucode: Fix validation on Intel platforms.
  • Rework validition to avoid multiplication.
  • Fall back to the extended signature table if the processor flags don't match.
Mon, May 25, 2:28 PM
markj accepted D57233: tty: Add sysctl knob to globally disable TIOCSTI.
Mon, May 25, 2:17 PM
markj added a comment to D50614: tests: Allow building without TIOCSTI.

I don't really understand--if we were to remove TIOCSTI, wouldn't that be done by removing the runtime implementation, rather than hiding the TIOCSTI symbol like this?

Mon, May 25, 2:00 PM
markj added inline comments to D57185: lpd: Fix issues reported by clang-analyzer.
Mon, May 25, 1:56 PM
markj added a comment to D57209: ucode: Fix validation on Intel platforms.
In D57209#1310974, @jrm wrote:

Thanks both. Nice catch to fix the inverted condition. If I understand correctly, before this fix, we would never have detected an extended signature, and thus never applied microcode for processors only listed in the extended signature.

Mon, May 25, 1:48 PM
markj added inline comments to D57104: tcp: improve TCP fast open with source routing.
Mon, May 25, 1:27 PM
markj added a comment to D57183: lpd: Drop deprecated -p option.

I don't really see the point. I'd just keep the option, having it silently do nothing, and remove the documentation.

Mon, May 25, 1:01 PM
markj accepted D57186: lpd: Style and whitespace cleanup.
Mon, May 25, 1:00 PM
markj accepted D57185: lpd: Fix issues reported by clang-analyzer.
Mon, May 25, 12:58 PM
markj accepted D57184: lpd: Avoid buffer overflow when sending a job.
Mon, May 25, 12:48 PM
markj accepted D57182: lpd: Reorder option list in manual page.
Mon, May 25, 12:42 PM
markj accepted D57181: lpd: Restore ability to specify a port number.
Mon, May 25, 12:37 PM

Sat, May 23

markj added inline comments to D49566: sys: add safe_read(9).
Sat, May 23, 5:40 PM