diff options
| author | Abdelkader Boudih <freebsd@seuros.com> | 2026-08-03 18:11:49 +0000 |
|---|---|---|
| committer | Adrian Chadd <adrian@FreeBSD.org> | 2026-08-03 18:11:56 +0000 |
| commit | 5078280bb42c00eecffeabf93706c145e87b4b2b (patch) | |
| tree | 4f9bdadf843311ef4777292216c1ce19e9839e0a | |
| parent | 396e6d69955669b564cb605418e9d8025b3592bd (diff) | |
kqueue: fix the always-empty NT_PROCSTAT_KQUEUES core note
sbuf reserves a byte of its buffer for the terminator, so the sbuf
created with maxlen held one byte less than the sizing pass had
computed. The last record overflowed it, sbuf_bcat() failed, and the
error == 0 guard skipped the copy into the caller's sbuf, so the note
has been emitted at full size but zero filled since 5e7c43ff02dc.
Fixes: 5e7c43ff02dc
Reviewed by: adrian, markj
Differential Revision: https://reviews.freebsd.org/D58583
MFC after: 1 week
| -rw-r--r-- | sys/kern/kern_event.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index e8395707a29d..31dab74bd7bd 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -3366,7 +3366,7 @@ kern_proc_kqueues_out(struct proc *p, struct sbuf *sb, size_t maxlen, sb_len = 128; else sb_len = maxlen; - s = sbuf_new(&sm, NULL, sb_len, SBUF_FIXEDLEN); + s = sbuf_new(&sm, NULL, sb_len + 1, SBUF_FIXEDLEN); error = kern_proc_kqueues_out1(curthread, p, s, compat32); sbuf_finish(s); if (error == 0) |
