There are 10 open security issues in bookworm.
There are 9 open security issues in bullseye.
commit ce12343f4efbc0c59c5b7b196b3029d21a8013af
Author: Renaud Métrich <rmetrich@redhat.com>
Date: Mon Oct 5 13:00:28 2026 +0200
ASAN and UBSAN compilation support
configure:
- add "--enable-asan", requires libasan
- add "--enable-ubsan", requires libubsan
Caveats:
- static libraries and binaries have ASAN/UBSAN disabled
---
At runtime, ASAN and/or UBSAN can be enabled for a binary through
setting environment variables, e.g.
export ASAN_OPTIONS=quarantine_size_mb=512:max_free_fill_size=4096:\
strict_string_checks=1:detect_stack_use_after_return=1:\
check_initialization_order=1:strict_init_order=1:halt_on_error=1:\
detect_leaks=1:log_path=/tmp/pmproxy-asan.log
export UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=0:\
log_path=/tmp/pmproxy-ubsan.log
Note that for pmproxy as least, the full UBSAN report will be pushed to
pmproxy.log anyway for some reason, it looks like it's due to how stderr
is being redirected.
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
commit c260a39030bad4aedcb0bbb203b86b90fdf9f6b0
Merge: 13f7c834 ce360eff
Author: Ken McDonell <kenj@kenj.id.au>
Date: Fri Oct 9 10:29:28 2026 +1100
Merge pull request #2756 from rmetrich/ubsan__8
e_labels: fix UBSAN misaligned loads in __pmLogLoadLabelSet
commit 13f7c834d3f768224b4e7b44e1bfe4a0f013a068
Merge: 91c2db55 1c0f07ae
Author: Ken McDonell <kenj@kenj.id.au>
Date: Fri Oct 9 10:26:09 2026 +1100
Merge pull request #2758 from rmetrich/asan__10
labels: fix double-free in __pmDupLabelSets on allocation failure
commit 91c2db5518e3ffc6e1a7aebc5e73ea0c30aba8ee
Merge: 9a1b9def ebde43c4
Author: Ken McDonell <kenj@kenj.id.au>
Date: Fri Oct 9 06:51:16 2026 +1100
Merge pull request #2755 from rmetrich/ubsan__7
logmeta: fix UBSAN left shift of negative value in __pmLoadTimestamp
commit 9a1b9def1fc30537aeb4baf7ebb71954973ab02c
Merge: 0d181a1e 3f28cfc7
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 21:20:12 2026 +1100
Merge pull request #2762 from kmcdonell/gethostname
gethostname - audit and rework
commit 3f28cfc7fc88f0ff71a5eef8a95a04ea026c8108
Merge: 2d35efb8 3f359732
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 16:58:59 2026 +1100
Merge branch 'gethostname' of https://github.com/kmcdonell/pcp into gethostname
commit 2d35efb8d65170bd7e8c52ea5b696838d576b214
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 16:57:59 2026 +1100
src/libpcp/src/context.c: avoid NULL dereference after gethostname() failure
commit 201fb2777c5dabd63f6f0bf449e2a3b3129f3655
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 16:51:37 2026 +1100
src/libpcp/src/util.c: fix missing UNLOCK after gethostname() change
commit 3f359732bace7ee936e4f07d10f3bc2469105638
Merge: cb6b2574 0d181a1e
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 16:37:33 2026 +1100
Merge branch 'performancecopilot:main' into gethostname
commit 0d181a1ea7de33a77ef20d8ad339e968c78e13b6
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Oct 7 15:32:24 2026 +1100
build: add gitignore file for pmimprot lib on macos
commit caa2da898c7d530a1485e6a77a8003e82f1da49a
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Oct 7 15:32:04 2026 +1100
docs: update version number and next planned release date
commit 725a6e7ff4b9461f3ea6da265d1e1370d9d102fb
Merge: 87fc51f5 79708000
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 14:59:18 2026 +1100
Merge pull request #2761 from kmcdonell/nextrel
QA updates held over from last release
commit 797080009a6069114a3be7e878e2e28776e5cca0
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 14:57:07 2026 +1100
src/libpcp_web/install-dev: better error handling control and exit status
commit 55a510e08d18a6aed2f4cf64db406d597da3b333
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 14:55:22 2026 +1100
src/pmdas/bpftrace/examples: keep raw files from github
So we can isolate problems as (a) from github or (b) from our local
rewriting.
modified: src/pmdas/bpftrace/examples/Download
new file: src/pmdas/bpftrace/examples/biolatency-v27.bt.raw
new file: src/pmdas/bpftrace/examples/runqlat-v27.bt.raw
commit b1905348834c00eec35dc0b97b85086808743f34
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 13:42:01 2026 +1100
install-dev: update scripts for *BSD where make is not gmake
modified: src/libpcp/src/install-dev
modified: src/libpcp_web/install-dev
commit 6e0283ea7e23e1edb152bcad41ffb0e3b5c2e30a
Merge: 8b632443 6525a5c9
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 13:37:40 2026 +1100
Merge branch 'main' into nextrel
commit 6525a5c91ef9e5288e6165b25fde7ae5819677df
Merge: dc4077fc 87fc51f5
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 13:32:49 2026 +1100
Merge branch 'main' of https://github.com/performancecopilot/pcp
commit 8b632443fb63363f09708f719ae7643b994d05ce
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 06:56:44 2026 +1100
src/pmsearch/.gitignore: add a couple of build by-products
commit 59367a2d1deb1ca76ffe9db5733553540fad8f4e
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 06:55:30 2026 +1100
qa/group: add 1211 to sanity group
Provides pmseries coverage in CI via -g sanity QA run.
commit 2f53a1d0357f60381294254663bbd4522119bacb
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 06:55:00 2026 +1100
qa/1742: tweak filter
commit 5938df6c8f007c9bc312a4897f984aef3650f77d
Merge: c2a2b701 dc4077fc
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 06:54:14 2026 +1100
Merge branch 'main' into nextrel
commit dc4077fcce7a411cfd89b6187aeee7272f652e46
Merge: 9a6a70a2 aa1ce942
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 7 06:53:06 2026 +1100
Merge branch 'main' of https://github.com/performancecopilot/pcp
commit 1c0f07ae88e90f2968401f8489543c19113bbd7b
Author: Renaud Métrich <rmetrich@redhat.com>
Date: Tue Oct 6 10:19:47 2026 +0200
labels: fix double-free in __pmDupLabelSets on allocation failure
When __pmDupLabelSets is called with a source that points directly into
the archive metadata hash (as returned by __pmLogLookupLabel before the
caller makes a copy), a partial allocation failure leaves unprocessed
entries with their json/labels/hash pointer fields still aliasing the
source (archive hash).
The cleanup path then calls pmFreeLabelSets(sets, nsets), which frees
those aliased pointers. Later, logFreeHashLabels frees the same pointers
again as it tears down the archive hash, producing the double-free caught
by ASAN:
==1391192==ERROR: AddressSanitizer: attempting double-free on 0x502000434410 in thread T0:
#0 0x7f75656fb1a8 in free.part.0 (/lib64/libasan.so.8+0xfb1a8) (BuildId: 704906ef2c282931655ba79621782b22a4eaea8a)
#1 0x7f7564344666 in logFreeHashLabels [...]/src/libpcp/src/logutil.c:577
#2 0x7f7564344666 in logFreeMeta [...]/src/libpcp/src/logutil.c:660
#3 0x7f7564347f90 in __pmArchCtlFree [...]/src/libpcp/src/logutil.c:3400
#4 0x7f756423e847 in pmDestroyContext [...]/src/libpcp/src/context.c:1986
#5 0x7f756517fd31 in pmDiscoverFree [...]/src/libpcp_web/src/discover.c:165
#6 0x7f7565180054 in pmDiscoverPurgeDeleted [...]/src/libpcp_web/src/discover.c:259
#7 0x7f75651b27e8 in changed_callback [...]/src/libpcp_web/src/discover.c:2193
#8 0x7f7565198adf in fs_change_callBack [...]/src/libpcp_web/src/discover.c:510
#9 0x7f7565d72d91 in uv__inotify_read.isra.0 /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/linux.c:2647
#10 0x7f7565d7354c in uv__io_poll /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/linux.c:1546
#11 0x7f7565d5d9f1 in uv_run /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/core.c:460
#12 0x56328407ea93 in main_loop [...]/src/pmproxy/src/server.c:949
#13 0x56328407b60a in main [...]/src/pmproxy/src/pmproxy.c:473
#14 0x7f756405158d in __libc_start_call_main (/lib64/libc.so.6+0x2a58d) (BuildId: cc6959d636202b0e1d6e17b273bf4060ec9265e5)
#15 0x7f7564051648 in __libc_start_main_alias_2 (/lib64/libc.so.6+0x2a648) (BuildId: cc6959d636202b0e1d6e17b273bf4060ec9265e5)
#16 0x56328407c014 in _start ([...]/src/pmproxy/src/pmproxy+0xd014) (BuildId: 0ff0d5440313ebe8225d2d57af1546f9d46c6556)
0x502000434410 is located 0 bytes inside of 10-byte region [0x502000434410,0x50200043441a)
freed by thread T0 here:
#0 0x7f75656fb448 in realloc.part.0 (/lib64/libasan.so.8+0xfb448) (BuildId: 704906ef2c282931655ba79621782b22a4eaea8a)
#1 0x7f756515579b in hi_realloc deps/hiredis/alloc.h:66
#2 0x7f756515579b in sdsMakeRoomFor deps/hiredis/sds.c:223
#3 0x7f7565161fe4 in sdscatfmt deps/hiredis/sds.c:596
#4 0x7f75650d7fd9 in keyMapRequest [...]/src/libpcp_web/src/schema.c:166
#5 0x7f75650d7fd9 in keyGetMap [...]/src/libpcp_web/src/schema.c:204
#6 0x7f75650d9bc4 in annotate_metric [...]/src/libpcp_web/src/schema.c:504
#7 0x7f756427f1f0 in stash_label [...]/src/libpcp/src/labels.c:444
#8 0x7f7564296b86 in __pmMergeLabelSets [...]/src/libpcp/src/labels.c:905
#9 0x7f75642a33df in pmMergeLabelSets [...]/src/libpcp/src/labels.c:1011
#10 0x7f756521607b in metric_labelsets.constprop.0 [...]/src/libpcp_web/src/util.c:223
#11 0x7f75650db059 in series_metric_label_mapping [...]/src/libpcp_web/src/schema.c:671
#12 0x7f75650f27dc in keys_series_metric [...]/src/libpcp_web/src/schema.c:728
#13 0x7f75650f27dc in server_cache_metric [...]/src/libpcp_web/src/load.c:45
#14 0x7f75650f27dc in series_cache_update [...]/src/libpcp_web/src/load.c:502
#15 0x7f756517e1c8 in pmDiscoverInvokeValuesCallBack [...]/src/libpcp_web/src/discover.c:749
#16 0x7f75651af9e2 in process_logvol [...]/src/libpcp_web/src/discover.c:1910
#17 0x7f75651af9e2 in pmDiscoverInvokeCallBacks [...]/src/libpcp_web/src/discover.c:2057
#18 0x7f75651af9e2 in directory_changed_cb [...]/src/libpcp_web/src/discover.c:2104
#19 0x7f75651b2793 in pmDiscoverTraverseArg [...]/src/libpcp_web/src/discover.c:226
#20 0x7f75651b2793 in changed_callback [...]/src/libpcp_web/src/discover.c:2181
#21 0x7f7565198adf in fs_change_callBack [...]/src/libpcp_web/src/discover.c:510
#22 0x7f7565d72d91 in uv__inotify_read.isra.0 /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/linux.c:2647
previously allocated by thread T0 here:
#0 0x7f75656fb448 in realloc.part.0 (/lib64/libasan.so.8+0xfb448) (BuildId: 704906ef2c282931655ba79621782b22a4eaea8a)
#1 0x7f756515579b in hi_realloc deps/hiredis/alloc.h:66
#2 0x7f756515579b in sdsMakeRoomFor deps/hiredis/sds.c:223
#3 0x7f7565161fe4 in sdscatfmt deps/hiredis/sds.c:596
#4 0x7f75650d7fd9 in keyMapRequest [...]/src/libpcp_web/src/schema.c:166
#5 0x7f75650d7fd9 in keyGetMap [...]/src/libpcp_web/src/schema.c:204
#6 0x7f75650d9bc4 in annotate_metric [...]/src/libpcp_web/src/schema.c:504
#7 0x7f756427f1f0 in stash_label [...]/src/libpcp/src/labels.c:444
#8 0x7f7564296b86 in __pmMergeLabelSets [...]/src/libpcp/src/labels.c:905
#9 0x7f75642a33df in pmMergeLabelSets [...]/src/libpcp/src/labels.c:1011
#10 0x7f756521607b in metric_labelsets.constprop.0 [...]/src/libpcp_web/src/util.c:223
#11 0x7f75650db059 in series_metric_label_mapping [...]/src/libpcp_web/src/schema.c:671
#12 0x7f75650f27dc in keys_series_metric [...]/src/libpcp_web/src/schema.c:728
#13 0x7f75650f27dc in server_cache_metric [...]/src/libpcp_web/src/load.c:45
#14 0x7f75650f27dc in series_cache_update [...]/src/libpcp_web/src/load.c:502
#15 0x7f756517e1c8 in pmDiscoverInvokeValuesCallBack [...]/src/libpcp_web/src/discover.c:749
#16 0x7f75651af9e2 in process_logvol [...]/src/libpcp_web/src/discover.c:1910
#17 0x7f75651af9e2 in pmDiscoverInvokeCallBacks [...]/src/libpcp_web/src/discover.c:2057
#18 0x7f75651af9e2 in directory_changed_cb [...]/src/libpcp_web/src/discover.c:2104
#19 0x7f75651b2793 in pmDiscoverTraverseArg [...]/src/libpcp_web/src/discover.c:226
#20 0x7f75651b2793 in changed_callback [...]/src/libpcp_web/src/discover.c:2181
#21 0x7f7565198adf in fs_change_callBack [...]/src/libpcp_web/src/discover.c:510
#22 0x7f7565d72d91 in uv__inotify_read.isra.0 /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/linux.c:2647
(NOTE: the line numbers above differ because it was encountered on RHEL10.2 PCP 7.0.3)
Fix: after memcpy, immediately null out the three heap-owned pointer
fields (json, labels, hash) so that pmFreeLabelSets on any failure path
only frees memory that was actually allocated by this function. Adjust
the subsequent empty-set guard to test source->json (the original value)
instead of target->json (which is now always NULL at that point).
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
commit ce360effc6b3a04a1ca7cc14c436905aae017eff
Author: Renaud Métrich <rmetrich@redhat.com>
Date: Tue Oct 6 10:08:16 2026 +0200
e_labels: fix UBSAN misaligned loads in __pmLogLoadLabelSet
tbuf is a plain char buffer; the offset k has no alignment guarantee.
Casting &tbuf[k] to unsigned int * or pmLabel * and dereferencing
requires 4-byte alignment that k does not provide, yielding:
e_labels.c:295:12: runtime error: load of misaligned address 0x506000011931 for type 'unsigned int', which requires 4 byte alignment
0x506000011931: note: pointer points here
75 78 22 7d 00 00 00 01 00 02 05 02 00 09 00 07 00 00 00 b9 96 6e cc b9 96 6e cc 50 19 01 00 60
^
#0 0x7f30e8683c64 in __pmLogLoadLabelSet [...]/src/libpcp/src/e_labels.c:295
#1 0x7f30e852c89d in __pmLogLoadMeta [...]/src/libpcp/src/logmeta.c:933
#2 0x7f30e843a443 in __pmLogOpen [...]/src/libpcp/src/logutil.c:1010
#3 0x7f30e843a443 in __pmFindOrOpenArchive [...]/src/libpcp/src/context.c:695
#4 0x7f30e84442cd in initarchive [...]/src/libpcp/src/context.c:947
#5 0x7f30e84442cd in pmNewContext [...]/src/libpcp/src/context.c:1362
#6 0x7f30e95af431 in pmDiscoverInvokeCallBacks [...]/src/libpcp_web/src/discover.c:1961
#7 0x7f30e95af431 in directory_changed_cb [...]/src/libpcp_web/src/discover.c:2104
#8 0x7f30e95b2993 in pmDiscoverTraverseArg [...]/src/libpcp_web/src/discover.c:226
#9 0x7f30e95b2993 in changed_callback [...]/src/libpcp_web/src/discover.c:2181
#10 0x7f30e9598cdf in fs_change_callBack [...]/src/libpcp_web/src/discover.c:510
#11 0x7f30ea148d91 in uv__inotify_read.isra.0 /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/linux.c:2647
#12 0x7f30ea14954c in uv__io_poll /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/linux.c:1546
#13 0x7f30ea1339f1 in uv_run /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/core.c:460
#14 0x556f59155a93 in main_loop [...]/src/pmproxy/src/server.c:949
#15 0x556f5915260a in main [...]/src/pmproxy/src/pmproxy.c:473
#16 0x7f30e825158d in __libc_start_call_main (/lib64/libc.so.6+0x2a58d) (BuildId: cc6959d636202b0e1d6e17b273bf4060ec9265e5)
#17 0x7f30e8251648 in __libc_start_main_alias_2 (/lib64/libc.so.6+0x2a648) (BuildId: cc6959d636202b0e1d6e17b273bf4060ec9265e5)
#18 0x556f59153014 in _start ([...]/src/pmproxy/src/pmproxy+0xd014) (BuildId: 0ff0d5440313ebe8225d2d57af1546f9d46c6556)
(NOTE: the line numbers above differ because it was encountered on RHEL10.2 PCP 7.0.3)
Replace all pointer-cast dereferences against tbuf[k] with memcpy, which
is the standard C idiom for unaligned reads and is optimised by GCC/Clang
into the same load instructions on x86.
Also fix the equivalent patterns for typep/identp/nsets (lines 244-250)
that carry the same bug but were not yet hit by UBSAN.
Co-Authored-By: Claude Sonnet 4.6 (1M context) noreply@anthropic.com
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
commit ebde43c476e838457c2017b5fd592e7e5262e657
Author: Renaud Métrich <rmetrich@redhat.com>
Date: Tue Oct 6 09:56:49 2026 +0200
logmeta: fix UBSAN left shift of negative value in __pmLoadTimestamp
buf is `const __int32_t *` (signed 32-bit). When a network-encoded
timestamp byte in buf[0]/buf[1] has its sign bit set, the implicit
widening cast to __int64_t preserves the sign, and shifting a negative
signed value left is undefined behaviour in C:
logmeta.c:1856:38: runtime error: left shift of negative value -896613526
#0 0x7fc41191874b in __pmLoadTimestamp [...]/src/libpcp/src/logmeta.c:1856
#1 0x7fc41183b35e in __pmLogLoadIndex [...]/src/libpcp/src/e_index.c:272
#2 0x7fc41183b35e in __pmLogOpen [...]/src/libpcp/src/logutil.c:1020
#3 0x7fc41183b35e in __pmFindOrOpenArchive [...]/src/libpcp/src/context.c:695
#4 0x7fc4118442cd in initarchive [...]/src/libpcp/src/context.c:947
#5 0x7fc4118442cd in pmNewContext [...]/src/libpcp/src/context.c:1362
#6 0x7fc4129af431 in pmDiscoverInvokeCallBacks [...]/src/libpcp_web/src/discover.c:1961
#7 0x7fc4129af431 in directory_changed_cb [...]/src/libpcp_web/src/discover.c:2104
#8 0x7fc4129b2993 in pmDiscoverTraverseArg [...]/src/libpcp_web/src/discover.c:226
#9 0x7fc4129b2993 in changed_callback [...]/src/libpcp_web/src/discover.c:2181
#10 0x7fc412998cdf in fs_change_callBack [...]/src/libpcp_web/src/discover.c:510
#11 0x7fc412705d91 in uv__inotify_read.isra.0 /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/linux.c:2647
#12 0x7fc41270654c in uv__io_poll /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/linux.c:1546
#13 0x7fc4126f09f1 in uv_run /usr/src/debug/libuv-1.52.1-1.el10_2.x86_64/src/unix/core.c:460
#14 0x556da71d3a93 in main_loop [...]/src/pmproxy/src/server.c:949
#15 0x556da71d060a in main [...]/src/pmproxy/src/pmproxy.c:473
(NOTE: the line numbers above differ because it was encountered on
RHEL10.2 PCP 7.0.3)
Fix by routing the cast through uint32_t -> uint64_t before the shift.
This zero-extends (no sign), makes the shift well-defined on an unsigned
type, and then the final (__int64_t) cast reinterprets the resulting
bit-pattern as signed — which is the intended semantics.
The redundant & 0xffffffff00000000LL mask is removed as it is a no-op
once the shift is performed on a 64-bit unsigned value.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
commit c2a2b701a7dbc9a451e1694ae44dec2dd34dc748
Author: Ken McDonell <kenj@kenj.id.au>
Date: Tue Oct 6 07:55:31 2026 +1100
bpftrace PMDA: add examples for v27 of bpftrace
Seen on Debian unstable.
Also correct typo in qa/1721 for message to warn about newer version
of bpftrace.
commit 9a6a70a25bfd3d59267b180e1e09a9b346300d71
Author: Ken McDonell <kenj@kenj.id.au>
Date: Tue Oct 6 07:36:51 2026 +1100
qa/1334: tweak hostname(1) usage
pmhostname works better (and hostname -f does not work everywhere).
commit 086e60c1016738dedaefde8721611c4e739b0a8d
Author: Ken McDonell <kenj@kenj.id.au>
Date: Tue Oct 6 07:24:20 2026 +1100
src/libpcp_web/install-dev: small improvements
- use install-dev in each dir if it exists ... ensures
multiarch install for libpcp_web updates the "right" DSOs
- pmsearch is not built on all platforms
commit 568901e78f00ecef9309d1edfefe401eb199cd3e
Author: Ken McDonell <kenj@kenj.id.au>
Date: Tue Oct 6 06:30:21 2026 +1100
Revert "libpcp_web: fix follow-up Coverity use-after-free issues"
This reverts commit 8dccebd1adffaf5af67e61c6fbcc4cab2b292206.
commit cb6b257494147da65cfe697f66f7a1a033bc06bf
Author: Ken McDonell <kenj@kenj.id.au>
Date: Mon Oct 5 08:13:56 2026 +1100
refactor gethostname() uses
Resolves github issue #2745 and follows a full code audit for the issues
identifed in PR #2744 (libpcp: fix gethostname() buffer length off by one)
but only partially fixed there.
Changes include:
1. make buffer size MAXHOSTNAMELEN+1, not MAXHOSTNAMELEN
2. outside declarations use sizeof(buf) instead of MAXHOSTNAMELEN+1
and sizeof(buf)-1 instead of MAXHOSTNAMELEN to improve readability and
to reduce noise from grepping for MAXHOSTNAMELEN
3. check return value from gethostname() and handle errors appropriately
4. ensure buf[] is null-byte terminated after call to gethostname()
5. clarify buffer sizing in pmGetHostName(3) man page
There are 6 open security issues in trixie.
You can find information about how to handle these issues in the security team's documentation.