There are 10 open security issues in bookworm.
There are 9 open security issues in bullseye.
commit 3751a9d148d5b83af6e9d51a3b889ecb67772a13
Author: lmchilton <lauren.chilton26@gmail.com>
Date: Tue Oct 13 13:53:56 2026 -0400
Resolves: RHEL-130497 fix for too strict parsing, specifically handling empty scope in json object
commit 5ef01f172b74e7214c86b004cfa8f4e8d26546fe
Merge: ce12343f 0325e8d2
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Oct 14 06:20:41 2026 +1100
Merge pull request #2757 from rmetrich/asan__9
derive_parser: fix strdup'd token strings leaked on error paths
commit 0325e8d2ee72cebbd6dcace5dfdef9612a6b2150
Author: Renaud Métrich <rmetrich@redhat.com>
Date: Fri Oct 9 10:38:24 2026 +0200
derive_parser: reclaim discarded semantic values with %destructor
Generalizes the per-error-path frees from 7ae26498cd. Those only
cover the rules that happen to have an error production; they cannot
reach the values bison discards on its own. Declare
%destructor { free($$); } <s>
%destructor { free_expr_ctx($$); } <n>
so the parser reclaims the lookahead token that triggered a syntax
error, every symbol popped while resynchronizing on the error token,
and everything left on the stack at YYABORT.
Note bison explicitly does _not_ run destructors for the symbols of
the rule whose action called YYERROR or YYABORT, so those rules keep
cleaning up after themselves and the two mechanisms compose.
Supporting changes:
- the "derive_error(NULL); return -1;" paths become YYABORT, so bison
unwinds the stack. A raw return from an action leaks every node
built so far. No caller uses derive_parse()'s return value, they
all test parse_tree, so this is a no-op for them.
- mkconst() and novalue() no longer build their node in a mid-rule
action. Bison cannot attach a %destructor to a mid-rule value, so
a node parked there is lost if the speclist does not parse. The
node is built in the final action instead, which also leaves the
number string owned by the parser stack (and so covered by the <s>
destructor) for the whole of the speclist. As a side effect both
"mkconst(1)" and "mkconst(1, bogus=1)" are handled by the one
free($3) in the error rule, so the mkconst_np tracking static
suggested during review is not needed.
- "$$ = NULL" is added to the YYERROR rules. Bison cannot tell they
never reduce and otherwise warns that the <n> destructor could see
an unset $$ (65 new warnings against a baseline of none).
- error actions use free_expr_ctx() rather than free_expr(), so a
discarded matchinst() tree gets its compiled regex regfree()d.
- reset_parser_state() clears lexpeek, in_matchinst, specflags and
specmeta before each parse. These file-scope statics are only
cleared on the success paths of the productions that use them, so
after a failed parse they leaked and bled into the next expression
parsed in the process: a stale specmeta was grafted onto an
unrelated mkconst(), stale META_* flags overrode the metadata it
inherited, and a stale in_matchinst made the lexer read '/' as a
regex delimiter instead of division.
- two meta= in the one speclist no longer leaks the first node.
- the anon() illegal type branch no longer falls through to use and
return the node it just freed.
Also fix the ownership of the compiled regex on teardown.
bind_expr() shallow copies the regex_t into the per-context copy it
builds for a global derived metric, so only the registered[] node
owns the compiled buffers. free_expr() must therefore not
regfree(), and free_expr_ctx() must -- which makes free_expr_ctx()
the right call for the registered[] tree in pmUnregisterDerived(),
and for a per-context metric, which bind_expr() binds in place
rather than copying. Three call sites had it backwards and leaked
884 bytes per registered matchinst() metric (the regex, plus the
N_PATTERN value string, which free_expr() also skips). The rule is
now spelled out above free_expr().
qa/2113 checks the diagnostics and the cross-expression state
isolation; qa/2114 checks the same expressions, plus the regex
teardown, for leaks under valgrind. Note 2114 deliberately bundles
many expressions into one config: the parser keeps its most recent
allocations in np, specmeta and derive_lval, so the last thing a
failed parse leaks is still reachable at exit and one expression per
run reports nothing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
commit aac4469ac3dafc4375e6c4e2fd7e41ac61810e1a
Author: Renaud Métrich <rmetrich@redhat.com>
Date: Fri Oct 9 10:31:21 2026 +0200
derive_fetch: fix read off the end of an aliased pmid_ctl
valgrind, fetching any derived metric from an archive:
Invalid read of size 4
at __dmpostvalueset (derive_fetch.c:2021)
by __dmpostfetch (derive_fetch.c:2260)
by __pmFinishResult (fetch.c:98)
by __pmFetch (fetch.c:242)
by pmFetch_ctx (fetch.c:294)
by pmFetch (fetch.c:332)
Address 0x554d098 is 0 bytes after a block of size 8 alloc'd
at malloc
by __pmLogFetch (logutil.c:2385)
When a requested metric is absent from a log record, __pmLogFetch()
points vset[j] at a pmid_ctl struct that has only pmid and numval
fields. Reading valfmt from it would be past the end of that
allocation. There are no values anyway, so PM_VAL_INSITU is a safe
placeholder.
__dmpostvalueset() hoisted the valfmt read out of the loop over the
values, so it ran even when there are no values to copy. Only read
it when numval > 0, matching what __pmLogFetchInterp() already does
in interp.c, and use PM_VAL_INSITU otherwise -- valfmt carries no
information when there are no values, and the consumers agree:
__pmFreeResultValueSets() guards on "numval > 0 && valfmt ==
PM_VAL_DPTR", and interp.c leaves valfmt uninitialized altogether
for the numval == 0 case it builds.
Found while leak-checking the derived metrics parser; it predates
that work and is unrelated to it.
qa/2115 is a new valgrind test covering the derived metric fetch
path. f.nomatch is the case that matters, a matchinst() that
matches no instances and so comes back with numval == 0; the others
check that values are still copied correctly alongside it.
Co-Authored-By: Ken McDonell <kenj@kenj.id.au
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 f44620472d9081587f0f62807f33accbc68f8e5a
Author: Renaud Métrich <rmetrich@redhat.com>
Date: Tue Oct 6 10:34:42 2026 +0200
coderabbitai comment
https://github.com/performancecopilot/pcp/pull/2757#pullrequestreview-5425698655
commit 7ae26498cda8a0699b6c0c306b50a0f24b4ac5d7
Author: Renaud Métrich <rmetrich@redhat.com>
Date: Tue Oct 6 10:14:48 2026 +0200
derive_parser: fix strdup'd token strings leaked on error paths
ASAN report:
Direct leak of 18 byte(s) in 3 object(s) allocated from:
#0 0x7f04d4af61a8 in strdup (/lib64/libasan.so.8+0xf61a8) (BuildId: 704906ef2c282931655ba79621782b22a4eaea8a)
#1 0x7f04d36cb249 in derive_lex [...]/src/libpcp/src/derive_parser.y:5194
#2 0x7f04d36e9866 in derive_parse.isra.0 [...]/src/libpcp/src/derive_parser.tab.c:5644
#3 0x7f04d36beb7a in registerderived [...]/src/libpcp/src/derive_parser.y:2026
#4 0x7f04d36e37cd in __dminit_configfile [...]/src/libpcp/src/derive_parser.y:2610
#5 0x7f04d36e37cd in __dminit_component.constprop.0 [...]/src/libpcp/src/derive_parser.y:175
#6 0x7f04d36e1cc6 in __dminit_component.constprop.0 [...]/src/libpcp/src/derive_parser.y:208
#7 0x7f04d36964ba in __dminit_parse [...]/src/libpcp/src/derive_parser.y:260
#8 0x7f04d36c07ca in __dminit [...]/src/libpcp/src/derive_parser.y:339
#9 0x7f04d36c3f04 in __dmopencontext [...]/src/libpcp/src/derive_parser.y:3930
#10 0x7f04d3443bac in pmNewContext [...]/src/libpcp/src/context.c:1406
#11 0x7f04d43af231 in pmDiscoverInvokeCallBacks [...]/src/libpcp_web/src/discover.c:1961
#12 0x7f04d43af231 in directory_changed_cb [...]/src/libpcp_web/src/discover.c:2104
#13 0x7f04d43b2793 in pmDiscoverTraverseArg [...]/src/libpcp_web/src/discover.c:226
#14 0x7f04d43b2793 in changed_callback [...]/src/libpcp_web/src/discover.c:2181
#15 0x7f04d4398adf in fs_change_callBack [...]/src/libpcp_web/src/discover.c:510
#16 0x7f04d48b3d91 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)
The lexer allocates L_NAME, L_STRING, L_INTEGER and L_INSTNAME tokens
via strdup() and stores them in derive_lval.s. Five grammar rule error
paths discard these strings without freeing them.
1. "| L_NAME error" — $1 (the name string) is held on the parser stack
when the error reduction fires; it is not freed before YYERROR.
2. "| L_MKCONST L_LPAREN L_INTEGER error" — $3 (the integer string) is
on the stack and is not freed before YYERROR.
3. "L_TYPE L_ASSIGN specval" — the else branch calls return -1 after
gramerr() but the free($3) that follows the if/else is never reached.
4. "L_SEMANTICS L_ASSIGN specval" — same pattern as the type rule.
5. "L_UNITS L_ASSIGN specval" — same pattern: free(errmsg) is called
but free($3) is not before return -1.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.