User avatar
Kees Cook @kees@hachyderm.io
2mo
We can remove strncpy() from the Linux kernel finally! I did the last 6 instances, and dropped all the implementations:
git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/log/?h=dev/v7.0-rc2/strncpy

Over the last 6 years working on this, there were 362 commits by 70 contributors. The folks with more than 1 commit were:

211 Justin Stitt <justinstitt@google.com>
22 Xu Panda <xu.panda@zte.com.cn>
21 Kees Cook <kees@kernel.org>
17 Thorsten Blum <thorsten.blum@linux.dev>
12 Arnd Bergmann <arnd@arndb.de>
4 Pranav Tyagi <pranav.tyagi03@gmail.com>
4 Lee Jones <lee@kernel.org>
2 Steven Rostedt <rostedt@goodmis.org>
2 Sam Ravnborg <sam@ravnborg.org>
2 Marcelo Moreira <marcelomoreira1905@gmail.com>
2 Krzysztof Kozlowski <krzk@kernel.org>
2 Kalle Valo <kvalo@kernel.org>
2 Jaroslav Kysela <perex@perex.cz>
2 Daniel Thompson <danielt@kernel.org>
2 Andrew Lunn <andrew@lunn.ch>

Thank you to all of you! (And especially to Justin Stitt who took on the brunt of the work.)
3
2
2
0
User avatar
artlog @artlog@agora.l0g.eu
2mo
@kees

That's very recent, those last commits are less than one hour ago !

To get the juice of it could you quickly give context ?

Why removing strncpy() from kernel is great ?

What are good practices in kernel when dealing with strings ? ie What does replace strncpy in kernel ?
1
0
1
0
User avatar
illy [Shrimple-mode] protomoji_orange_flag_lesbian @illyBytes@shrimp.imsofucking.gay
2mo
@artlog @kees from what i could gleam, strncpy wasn't safe because it never ensured that the copied string would be null terminated
0
0
2
0