Page MenuHomeFreeBSD
Feed Advanced Search

Oct 5 2023

jfree added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

I created this patch to make the Capsicumization experience less intimidating for inexperienced developers. Both David and Mariusz may not be the target audience for this change because they already know how to extract the information that the tracing provides. Developers that are unfamiliar with Capsicum's semantics could use this tracing mode to easily determine why their program is not working in capability mode. I think it provides a solid starting point so new developers don't get lost and discouraged.

Oct 5 2023, 11:50 PM · capsicum

Sep 28 2023

jfree added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

Again, maybe I just need some more context to understand the reasoning behind this change.

Sep 28 2023, 6:39 PM · capsicum

Sep 4 2023

jfree accepted D41708: Linux ABI timerfd can't work on FreeBSD 14 stable..
Sep 4 2023, 4:28 PM

Sep 3 2023

jfree updated the diff for D41641: timerfd: Namespace pollution adjustments.

Reword comment to say the namespace instead of just namespace.

Sep 3 2023, 3:45 AM
jfree updated the diff for D41477: syslogd: Watch for dead pipe processes.

Update to avoid rebase conflicts.

Sep 3 2023, 3:27 AM
jfree updated the diff for D41467: syslogd: Enter capability mode.

Update to avoid rebase conflicts.

Sep 3 2023, 3:27 AM
jfree added inline comments to D41465: syslogd: Log messages using libcasper.
Sep 3 2023, 3:26 AM
jfree updated the diff for D41465: syslogd: Log messages using libcasper.

Create a new cap_filed structure and accompanying cfiled SLIST for filed integrity verification in libcasper's cap_p_open().

Sep 3 2023, 3:23 AM
jfree added inline comments to D41464: syslogd: Refresh configuration using libcasper.
Sep 3 2023, 3:20 AM
jfree updated the diff for D41464: syslogd: Refresh configuration using libcasper.

Create filed nvlist directly from readconfigfile() and address Mark's comments.

Sep 3 2023, 3:18 AM
jfree requested review of D41703: syslogd: Use anonymous union in struct filed.
Sep 3 2023, 3:16 AM

Sep 1 2023

jfree updated the diff for D41641: timerfd: Namespace pollution adjustments.

Add comment explaining intentional namespace pollution.

Sep 1 2023, 6:50 PM
jfree abandoned D38459: timerfd: Add native support for Linux's timerfd.

This patch has been applied to src under commit af93fea710385b2b11f0cabd377e7ed6f3d97c34.

Sep 1 2023, 6:41 PM · linuxkpi, Linux Emulation
jfree abandoned D40177: Improve header self-containment.
Sep 1 2023, 6:39 PM
jfree accepted D38459: timerfd: Add native support for Linux's timerfd.
Sep 1 2023, 6:35 PM · linuxkpi, Linux Emulation

Aug 30 2023

jfree requested review of D41641: timerfd: Namespace pollution adjustments.
Aug 30 2023, 4:41 AM
jfree requested review of D41640: timerfd: Relocate 32-bit compat code.
Aug 30 2023, 4:40 AM
jfree updated the diff for D41600: timerfd: Define a locking regime.

This patch was getting long, as @bsdimp pointed out. Split it into three separate patches. This patch will still define the locking regime.

Aug 30 2023, 4:39 AM

Aug 29 2023

jfree updated the summary of D41600: timerfd: Define a locking regime.
Aug 29 2023, 4:10 PM
jfree updated the diff for D41600: timerfd: Define a locking regime.

Include <sys/time.h> instead of <sys/timespec.h>. This causes intentional namespace pollution that mimics Linux.

Aug 29 2023, 4:09 PM

Aug 28 2023

jfree updated the diff for D41600: timerfd: Define a locking regime.
  • Remove locking around knlist_add() and set islocked arg to 0
  • Add space under declarations in timerfd_getboottime()
Aug 28 2023, 12:50 AM

Aug 27 2023

jfree added inline comments to D41600: timerfd: Define a locking regime.
Aug 27 2023, 3:08 PM
jfree added inline comments to D41600: timerfd: Define a locking regime.
Aug 27 2023, 12:31 AM

Aug 26 2023

jfree updated the summary of D41600: timerfd: Define a locking regime.
Aug 26 2023, 9:36 PM
jfree updated the diff for D41600: timerfd: Define a locking regime.
  • Do not initialize tfd_lock with MTX_RECURSE.
  • Add assertion in filt_timerfdread(), showing that the tfd_lock is held.
  • Place tfd_count in kn->kn_data.
Aug 26 2023, 9:35 PM
jfree added a comment to D41600: timerfd: Define a locking regime.
In D41600#948035, @kib wrote:

Recursive locks is much harder to reason about and correctly use. In this case there is no sense in making the lock recursive, at worst you should add assertions instead of acquiring it more than needed.

Aug 26 2023, 9:25 PM
jfree added inline comments to D41600: timerfd: Define a locking regime.
Aug 26 2023, 5:29 AM
jfree updated the diff for D41600: timerfd: Define a locking regime.
  • Add recursion to tfd_lock mtx.
  • Return boolean in filt_timerfdread().
  • Don't check if tfd == NULL.
  • Declare struct thread in timerfd.h instead of including sys/proc.h.
Aug 26 2023, 5:28 AM
jfree requested review of D41600: timerfd: Define a locking regime.
Aug 26 2023, 4:11 AM

Aug 25 2023

jfree updated the diff for D41465: syslogd: Log messages using libcasper.

Add assertions to guarantee that the iovec count returned by nvlist_get_nvlist_array() is less or equal to than TTYMSG_IOV_MAX, the maximum amount of iovecs allowed by ttymsg().

Aug 25 2023, 10:13 PM
jfree updated the diff for D41464: syslogd: Refresh configuration using libcasper.

Fix minor mistyping in populate_config(). filed_count should be declared as size_t, not uint64_t.

Aug 25 2023, 10:10 PM
jfree updated the diff for D41463: syslogd: Create syslogd libcasper service.

Fix incorrect handling of the nvlist size argument for in nvlist_get_nvlist_array() and nvlist_get_binary()

Aug 25 2023, 10:08 PM

Aug 24 2023

jfree added inline comments to D38459: timerfd: Add native support for Linux's timerfd.
Aug 24 2023, 11:44 PM · linuxkpi, Linux Emulation
jfree updated the diff for D40218: timerfd: Add manual page.

Address @grahamperrin's comments.

Aug 24 2023, 5:12 PM · manpages
jfree added inline comments to D41463: syslogd: Create syslogd libcasper service.
Aug 24 2023, 4:08 PM
jfree added inline comments to D41465: syslogd: Log messages using libcasper.
Aug 24 2023, 4:01 PM
jfree updated the diff for D41465: syslogd: Log messages using libcasper.

Don't manually add the iovec count to the nvlist. The iovec count is fetched when getting the nvlist iovec array.

Aug 24 2023, 3:57 PM
jfree updated the diff for D41464: syslogd: Refresh configuration using libcasper.

Don't manually add the filed count to the nvlist. The filed count is fetched when getting the nvlist filed array.

Aug 24 2023, 3:56 PM
jfree updated the diff for D41463: syslogd: Create syslogd libcasper service.
  • Address Mark's style(9) comments
  • Add error checking for strdup() in prop_filter_compile()
Aug 24 2023, 3:53 PM
jfree added inline comments to D41465: syslogd: Log messages using libcasper.
Aug 24 2023, 3:18 PM
jfree added inline comments to D41364: syslogd: Only use peerlist during flag parsing.
Aug 24 2023, 3:06 PM
jfree added inline comments to D41463: syslogd: Create syslogd libcasper service.
Aug 24 2023, 3:00 PM
jfree added inline comments to D41364: syslogd: Only use peerlist during flag parsing.
Aug 24 2023, 2:20 PM
jfree added a comment to D38459: timerfd: Add native support for Linux's timerfd.
In D38459#947334, @imp wrote:

Are there any tests?

Aug 24 2023, 2:08 PM · linuxkpi, Linux Emulation
jfree abandoned D38460: timerfd: Add libc syscall wrappers.
Aug 24 2023, 2:01 PM · linuxkpi, Linux Emulation
jfree abandoned D38497: specialfd: Extend interface to support many fds.
Aug 24 2023, 2:01 PM

Aug 23 2023

jfree updated the summary of D41467: syslogd: Enter capability mode.
Aug 23 2023, 10:14 PM
jfree updated the diff for D41467: syslogd: Enter capability mode.

Open the renamed syslogd.casper service (used to be syslogd.*).

Aug 23 2023, 10:13 PM
jfree updated the diff for D41459: syslogd: Use pipe to communicate with daemon.

Address Mark's comments

Aug 23 2023, 10:12 PM
jfree updated the diff for D41466: syslogd: Block timezone updating in capability mode.

Add XXX comment for needed future tzcode capability module

Aug 23 2023, 10:12 PM
jfree updated the diff for D41465: syslogd: Log messages using libcasper.
  • Do not allocate a new iovlist in nvlist_to_iovec()
  • Use calloc() when allocating memory for the iovlist array.
Aug 23 2023, 10:11 PM
jfree updated the diff for D41463: syslogd: Create syslogd libcasper service.
  • Change service name to syslogd.casper
  • Compile the regex exp in nvlist_to_prop_filter()
Aug 23 2023, 10:09 PM
jfree updated the diff for D41526: syslogd: Do not add shutdown sockets to the kqueue.
  • Do not add sockets with sl_recv == NULL to the kqueue.
  • Remove listen() altogether.
Aug 23 2023, 10:06 PM
jfree added inline comments to D41465: syslogd: Log messages using libcasper.
Aug 23 2023, 9:32 PM
jfree added inline comments to D41463: syslogd: Create syslogd libcasper service.
Aug 23 2023, 6:11 PM
jfree added inline comments to D41463: syslogd: Create syslogd libcasper service.
Aug 23 2023, 5:31 PM
jfree added a comment to D41403: syslogd: Create regression tests.

Do you have any updates to this patch? I think I will commit it first, since I'm still waiting for the stable/14 branch, but having extra tests poses no problems.

Aug 23 2023, 4:02 PM
jfree added a comment to D41526: syslogd: Do not add shutdown sockets to the kqueue.

I believe that you could leave the block which calls listen() alone (and I do think that block is totally bogus and could be deleted, syslogd doesn't handle listening sockets) and the problem would still be gone. Is that right?

Aug 23 2023, 4:00 PM
jfree added inline comments to D41477: syslogd: Watch for dead pipe processes.
Aug 23 2023, 3:45 PM
jfree added inline comments to D41463: syslogd: Create syslogd libcasper service.
Aug 23 2023, 3:37 PM
jfree added a comment to D41526: syslogd: Do not add shutdown sockets to the kqueue.

I don't really understand this change. You wrote, "To fix this, listen() should not be called if syslogd is in secure mode.", but nothing has changed with respect to listen() calls. All that's changed is that we don't call shutdown().

If the problem is that data on unread sockets is thrashing kevent(), why not avoid creating EVFILT_READ events for those sockets?

Notice the else on line 3751. If we're in secure mode and we have INET sockets, then sl_recv will be set to NULL, else we will listen. No listening happens in secure mode for INET sockets.

Now I'm even more confused. :) hints.ai_socktype = SOCK_DGRAM in the sole caller of socksetup(), so when is it the case that ai->ai_socktype != SOCK_DGRAM?

Aug 23 2023, 3:30 PM
jfree added a comment to D41526: syslogd: Do not add shutdown sockets to the kqueue.

I don't really understand this change. You wrote, "To fix this, listen() should not be called if syslogd is in secure mode.", but nothing has changed with respect to listen() calls. All that's changed is that we don't call shutdown().

If the problem is that data on unread sockets is thrashing kevent(), why not avoid creating EVFILT_READ events for those sockets?

Aug 23 2023, 3:04 PM

Aug 22 2023

jfree updated the summary of D41465: syslogd: Log messages using libcasper.
Aug 22 2023, 6:59 PM
jfree updated the diff for D41465: syslogd: Log messages using libcasper.

Use cap_xfer_nvlist() to transfer nvlists in cap_wallmsg(). Previously, cap_send_nvlist() was used without cap_recv_nvliust(), leaving an extra nvlist on libcasper's queue. This resulted in future nvlist transfers to retreive the wrong result.

Aug 22 2023, 6:54 PM
jfree updated the diff for D41464: syslogd: Refresh configuration using libcasper.

Update to avoid rebase conflicts

Aug 22 2023, 6:52 PM
jfree updated the diff for D41463: syslogd: Create syslogd libcasper service.

Make sure that filed->f_type is F_FILE before adding descriptor to nvlist

Aug 22 2023, 6:50 PM
jfree updated the diff for D41380: syslogd: Do not open console descriptor.

Close console/tty descriptors while config parsing.

Aug 22 2023, 6:49 PM
jfree abandoned D41401: ttymsg: Create ttymsgat().
Aug 22 2023, 6:47 PM

Aug 21 2023

jfree updated the diff for D41467: syslogd: Enter capability mode.

Use cap_ttymsg() instead of ttymsgat()

Aug 21 2023, 10:55 PM
jfree updated the diff for D41465: syslogd: Log messages using libcasper.

Add cap_ttymsg() and update to avoid rebasing conflicts

Aug 21 2023, 10:52 PM
jfree updated the diff for D41464: syslogd: Refresh configuration using libcasper.

Use logerror() to log errors instead of exiting. This makes debugging significantly easier when something goes wrong during configuration parsing.

Aug 21 2023, 10:49 PM
jfree updated the diff for D41380: syslogd: Do not open console descriptor.
Aug 21 2023, 10:46 PM
jfree updated the diff for D41373: syslogd: Move prop_filter allocation into function.

In prop_filter_compile(), the filter string pointer is modified so free()'ing it leads to unintended behavior. Save a filter_begpos pointer and free() that during cleanup.

Aug 21 2023, 10:43 PM
jfree updated the diff for D40177: Improve header self-containment.

Update diff to include context

Aug 21 2023, 6:09 PM
jfree requested review of D41526: syslogd: Do not add shutdown sockets to the kqueue.
Aug 21 2023, 4:25 PM

Aug 20 2023

jfree updated the diff for D41459: syslogd: Use pipe to communicate with daemon.

Call die() instead of err() in waitdaemon when an error occurs so the pidfile is removed.

Aug 20 2023, 10:19 PM
jfree updated the diff for D41381: syslogd: Pre-open null file descriptor.

Update after peerlist rebase, adding pidfile_remove()

Aug 20 2023, 10:17 PM
jfree updated the diff for D41380: syslogd: Do not open console descriptor.

Update after peerlist rebase, adding pidfile_remove() in cleanup

Aug 20 2023, 10:16 PM
jfree updated the diff for D41364: syslogd: Only use peerlist during flag parsing.

Bring back peerlist -- see updated patch summary

Aug 20 2023, 10:14 PM
jfree updated the summary of D41364: syslogd: Only use peerlist during flag parsing.
Aug 20 2023, 10:14 PM

Aug 17 2023

jfree updated the diff for D41477: syslogd: Watch for dead pipe processes.

Update after rebase conflicts

Aug 17 2023, 7:00 PM
jfree updated the diff for D41459: syslogd: Use pipe to communicate with daemon.

Fix conflicts after rebase. The previous revision has been squashed into a patch earlier in the stack.

Aug 17 2023, 6:59 PM
jfree updated the diff for D41415: syslogd: Do not reap child processes.

Update after rebase conflicts

Aug 17 2023, 6:49 PM
jfree updated the diff for D41363: syslogd: Centralize operations into a kevent loop.

Fix bug where syslogd would stall upon startup, never getting the chance to fsync().

Aug 17 2023, 6:46 PM
jfree updated the diff for D41459: syslogd: Use pipe to communicate with daemon.

Remove ts and tsp variables altogether (see updated patch summary)

Aug 17 2023, 5:21 PM
jfree added a comment to D41363: syslogd: Centralize operations into a kevent loop.

I am use syslogd for collectiong messages from many sourcses.
I have moderate message flow (about 1..10 messages/second average).
I am applay D41357, D41358, D41359, D41360, D41362 -- no problems.
I am applay D41363 -- after about 1..5 minutes syslogd stop to got and processing remote messages. Local messages still processing.
Most of remote messages don't recived and lost -- no action in kevent().
After D41363 syslogd is broken.

I was able to reproduce this issue and it seems Mark was right, removing EV_CLEAR from kevent() flags, fixes the messages stalling.

Oddly enough, this bug doesn't occur when the messages are sent through syslogd's UDP socket locally. This only happens when the messages are coming from another host.

@slw_zxy.spb.ru, would you mind seeing if this new patch works for you?

Yes, now work for me.

Aug 17 2023, 5:06 PM
jfree updated the diff for D41363: syslogd: Centralize operations into a kevent loop.

Remove EV_CLEAR flag when adding logsocket kevents to kqueue so we don't drop INET messages.

Aug 17 2023, 3:39 PM
jfree added a comment to D41363: syslogd: Centralize operations into a kevent loop.

I am use syslogd for collectiong messages from many sourcses.
I have moderate message flow (about 1..10 messages/second average).
I am applay D41357, D41358, D41359, D41360, D41362 -- no problems.
I am applay D41363 -- after about 1..5 minutes syslogd stop to got and processing remote messages. Local messages still processing.
Most of remote messages don't recived and lost -- no action in kevent().
After D41363 syslogd is broken.

Aug 17 2023, 3:36 PM

Aug 16 2023

jfree updated the diff for D41477: syslogd: Watch for dead pipe processes.

Remove reload parameter in close_filed(). Move kqueue deletion into closelogfiles() instead.

Aug 16 2023, 2:27 PM
jfree updated the diff for D41477: syslogd: Watch for dead pipe processes.

Add boolean reload parameter to close_filed(). When set to true, remove kevents that reference the filed.

Aug 16 2023, 1:30 AM
jfree requested review of D41477: syslogd: Watch for dead pipe processes.
Aug 16 2023, 12:10 AM

Aug 15 2023

jfree updated the diff for D41403: syslogd: Create regression tests.

Launch syslogd with the -d debug flag to provide more diagnostic information upon test failures.

Aug 15 2023, 4:17 AM
jfree requested review of D41467: syslogd: Enter capability mode.
Aug 15 2023, 4:11 AM
jfree requested review of D41466: syslogd: Block timezone updating in capability mode.
Aug 15 2023, 4:10 AM
jfree requested review of D41465: syslogd: Log messages using libcasper.
Aug 15 2023, 4:08 AM
jfree requested review of D41464: syslogd: Refresh configuration using libcasper.
Aug 15 2023, 4:07 AM
jfree requested review of D41463: syslogd: Create syslogd libcasper service.
Aug 15 2023, 4:06 AM

Aug 14 2023

jfree requested review of D41459: syslogd: Use pipe to communicate with daemon.
Aug 14 2023, 11:47 PM
jfree updated the diff for D41381: syslogd: Pre-open null file descriptor.

The nulldesc descriptor is used in waitdaemon() so open it prior to calling waitdaemon()

Aug 14 2023, 5:52 PM
jfree updated the diff for D41380: syslogd: Do not open console descriptor.

Move consfile setup before waitdaemon() to align with nulldesc ordering in https://reviews.freebsd.org/D41381

Aug 14 2023, 5:51 PM