mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] tools/nolibc: fix verrx() and errx()
@ 2026-09-24 12:09 Danish Khateeb
  2026-09-24 12:09 ` [PATCH 1/2] tools/nolibc: fix verrx() and errx() message formatting Danish Khateeb
  2026-09-24 12:09 ` [PATCH 2/2] selftests/nolibc: add a test for errx() Danish Khateeb
  0 siblings, 2 replies; 3+ messages in thread
From: Danish Khateeb @ 2026-09-24 12:09 UTC (permalink / raw)
  To: Willy Tarreau, Thomas Weißschuh
  Cc: Shuah Khan, linux-kselftest, linux-kernel, Danish Khateeb

verrx() passes its va_list to the variadic warnx() instead of vwarnx(),
so errx() and verrx() print their messages with the wrong arguments,
and can crash when the format has a "%s".

Patch 1 fixes it. Patch 2 adds a nolibc-test case for errx(), which
would have caught it.

The series is independent of the readdir_r()/FD_* series [1] and merges
cleanly with it.

Tested on top of nolibc/for-next 61fb00d6efee, on x86_64 and i386, and
on arm, arm64 and sparc64 under qemu-user:

- nolibc-test, all tests: no failures with the series. The only
  difference from before is the new errx test, which passes. It also
  passes against glibc (make libc-test).

- Without patch 1, the errx test fails on all five. On x86_64 the child
  is killed by SIGSEGV.

[1] https://lore.kernel.org/all/20260924015222.31693-1-danishkhateeb03@gmail.com/

Danish Khateeb (2):
  tools/nolibc: fix verrx() and errx() message formatting
  selftests/nolibc: add a test for errx()

 tools/include/nolibc/err.h                   |  2 +-
 tools/testing/selftests/nolibc/nolibc-test.c | 47 ++++++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)


base-commit: 61fb00d6efeeeb9fd65c81db3bd8b2ac140f573c
-- 
2.55.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-24 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 12:09 [PATCH 0/2] tools/nolibc: fix verrx() and errx() Danish Khateeb
2026-09-24 12:09 ` [PATCH 1/2] tools/nolibc: fix verrx() and errx() message formatting Danish Khateeb
2026-09-24 12:09 ` [PATCH 2/2] selftests/nolibc: add a test for errx() Danish Khateeb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®