summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2026-04-27 17:30:38 +0300
committerJakub Kicinski <kuba@kernel.org>2026-04-29 04:28:12 +0300
commit869cd6490fafe09c89a15d01610e8a03932d79f0 (patch)
treeae964878a6e357fd20a1ec407f94b79466f1f119 /include/linux/timerqueue.h
parent92ceb7bff62c2606f664c204750eca0b85d44112 (diff)
downloadlinux-869cd6490fafe09c89a15d01610e8a03932d79f0.tar.xz
netconsole: restore userdatum value on update_userdata() failure
userdatum_value_store() updates udm->value first and only then calls update_userdata() to rebuild the on-the-wire payload. If update_userdata() fails (e.g. -ENOMEM from kmalloc), the function returns the error to userspace, but udm->value already holds the new string while the live nt->userdata buffer still reflects the old one. The next successful write to any sibling userdatum on the same target will call update_userdata() again, which walks every entry and packs the now-stale udm->value into the payload. The failed write is thus silently activated later, with no indication to userspace that the value it tried to set was rejected. Snapshot the previous value before overwriting udm->value and restore it if update_userdata() fails so the visible state and the active payload stay consistent. Fixes: eb83801af2dc ("netconsole: Dynamic allocation of userdata buffer") Signed-off-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20260427-netconsole_ai_fixes-v2-4-59965f29d9cc@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions