User Details
- User Since
- Jan 15 2026, 1:06 PM (25 w, 1 d)
Sat, Jul 4
- Address mhorne@'s comments, thanks for testing, and it's great to know that KASAN already caught a real bug!
- Rebase to origin/main
- Move the MI interceptor code to a separate parent revision.
Fri, Jun 26
clarify cmsg
move NETLINK_GET_STRICT_CHK and NETLINK_MSG_INFO to another revision.
remove NETLINK_SND_SYNC.
Linux actually has a specific netlink socket flag, NETLINK_NO_ENOBUFS, which suggests that a lot of Linux software depends on the default ENOBUFS behavior.
As obiwac@ mentioned, our initial thought was to align this behavior with Linux, especially in preparation for the synchronous Netlink patch I plan to introduce.
Thu, Jun 25
Add a test to check the recv buffer, as suggested by obiwac@.
Include this in the revision where I add this flag.
change the commit order.
- change the commit order.
- include the manual change.
Wed, Jun 24
Address some of obiwac@'s comments.
Tue, Jun 23
rebase
Based on the code flow I mentioned above, I found that the DMA_TO_DEVICE and
DMA_FROM_DEVICE directions in dma_sync_single_for_device might be reversed.
Mon, Jun 22
I re-read the manual today:
BUS_DMASYNC_PREREAD Perform any synchronization required prior
to an update of host memory by the device.IMO, hselasky said we cannot pass multiple flags to the non-bidirectional DMA cases. I think that is correct.
But I guess his thought was that some USB controllers might access the DMA buffer after the dma_sync_single_for_cpu, so he added the PREREAD flag. However, under Linux semantics, the device should not access the DMA buffer after the dma_sync_single_for_cpu.
Sat, Jun 20
do sync conversion in setsockopt handler, tearing down the taskqueue and returning an error if some messages are pending procesding.
I think you're right, it's weird to set sync mid-session. I will change it later
- Move some logic in sync path to a separate function.
- Move the lock acquisition inside the branch
Linux is sync. Its behavior is this send() will succeed and process all requests (5, for example). But it drops the replies that exceed the receive buffer(3 replies). And will return ENOBUFS in the next recv() to indicate we have dropped some replies.
In other words, the success of send() does not depend on whether the receive buffer is full. So I align with its behavior, the corresponding part is the nl_dropped_bytes in nl_soreceive().
Fri, Jun 19
- Can pass the test
- Add SB_WAIT
- Remove timeout
- Refactor nl_process_nbuf_sync. The difference from nl_process_nbuf is that
the sync version removes nlmsg_ignore_limit and returns the actual error.
- Make recv return ENOBUF when it sees nl_dropped_messages.
Add the test mentioned in my previous comment, but without changing the kernel
code yet, so it currently fails as expected.
After investigating the behavior of netlink send when the buffer is full, I found:
FreeBSD async send path behavior:
- Send buffer full: Deadlocks (this indicates the recv buffer is also full).
- Recv buffer full: Send doesn't depend on it, so it will never block. It just keeps filling the send buffer.
Linux send path behavior:
- Send buffer will never fill up because of sync.
- Recv buffer full: Send doesn't depend on it, so it will never block, but it will fail on the next recv.
Therefore, I think the FreeBSD sync send path behavior should be:
- Send buffer full: Deadlock.
- Recv buffer full: Same as linux
Wed, Jun 17
Hi, I think this is a good change overall. I actually tried to solve the same problem before in D55328, but I ended up abandoning it because my use case no longer required it.
Fri, Jun 12
fix potential deadlock
Jun 10 2026
Jun 8 2026
Jun 7 2026
Fixed hart boot hang on riscv smp caused by KASAN, by initializing the tp register earlier in the assembly stage.
Jun 4 2026
Jun 2 2026
Address review feedback.
As suggested by @jrtc27, KASAN shouldn't intercept unsupported riscv atomic functions.
Prevent KASAN from intercepting atomic functions that are unsupported by the
architecture. The specific changes can be summarized as follows:
- Use ARCH_SUPPORT_ATOMIC_*_WIDTH x-macros to control the generation of interceptor functions in subr_asan.c.
- Use #undef in machine/atomic.h to undefine the macros that are forcibly defined by sys/atomic_san.h but lack actual MD implementations.
Jun 1 2026
Fix segment order
May 22 2026
To support the FAM cmd for udmabuf, I first decided to improve the linuxkpi ioctl through this patch, but due to some hacks in this patch and the suggestion from my GSoC mentor Aymeric, I decided to enhance the native FreeBSD ioctl call stack - to let the native FreeBSD ioctl support FAM.