From: "Theo de Raadt" Subject: Re: sys/net/pf_ioctl.c fix two MSAN findings To: Johann Höpfner Cc: tech@openbsd.org Date: Fri, 04 Sep 2026 18:49:04 -0600 > In general, strlcpy with discarded return value seems like an > antipattern to me. These cases should probably use a function that does > not scan the source until the next null-byte, but returns as soon as the > destination is full. As far as I know this is exactly what linux has > strScpy for. I'll make one more point here. If you pass a non-string to strlcpy, and wander into bad memory, you crash. You learn about the crash. You fix it. If on the other hand you use a function which does not reach that bad memory, you truncate. Silently. You never know that you have truncated. More than 50% of the time, the return value will not be checked. The trend is that developers don't look at failure return values because doing so forces them to consider what action to take for dealing with tricky failure modes at deeper layers of code. But in the end, all failures modes must be accomodated. One of these lets them be discovered. You opened with: > Please find below two kernel memory sanitizer findings, which I find to > be bugs, and their respective fixes. Does your scanner search for truncated objects and consider the invariant conditions created due to them? I doubt it.