Skip to content

hostmot2: check hal_malloc results in sserial and abs_encoder setup - #4633

Merged
andypugh merged 1 commit into
LinuxCNC:masterfrom
grandixximo:sserial-hal-malloc-checks
Oct 4, 2026
Merged

andypugh merged 1 commit into
LinuxCNC:masterfrom
grandixximo:sserial-hal-malloc-checks

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

The sserial and abs_encoder load paths dereference hal_malloc results without checking. On HAL shared-memory exhaustion, or on a garbage record count read from an unresponsive remote, the next statement writes through NULL and kills the loading process with no useful message. Fail with -ENOMEM and the channel name instead.

One of three candidates for @andypugh's hostmot2 SIGSEGV on master (see #4453, #4632). Split out of #4626.

The load path dereferenced hal_malloc results without a check. On HAL
shared-memory exhaustion, or on a garbage global/conf count read from
an unresponsive remote, the next statement wrote through NULL and
killed the loading process with no useful message. Fail with -ENOMEM
and the channel name instead.
@andypugh
andypugh merged commit 5c18701 into LinuxCNC:master Oct 4, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants