Skip to content

harden qnx runtime signal and prompt paths - #89

Open
wordgitet wants to merge 1 commit into
ibara:mainfrom
wordgitet:sig-detection-experiment
Open

harden qnx runtime signal and prompt paths#89
wordgitet wants to merge 1 commit into
ibara:mainfrom
wordgitet:sig-detection-experiment

Conversation

@wordgitet

Copy link
Copy Markdown
Contributor

Hello Brian,

I put together a another PR that hardens the QNX runtime path in a few targeted spots:

  • trap.c: make signal message handling more defensive (sys_siglist bounds-safe + stable fallback)
  • confstr.c: avoid overriding libc confstr() on QNX
  • lex.c: harden PS1 hostname expansion (\h / \H) when gethostname() fails

I tested this with QNX SDP 8.0 in QEMU and the shell now starts cleanly, shows the expected hostname prompt, and handles basic commands/arithmetic correctly.

Quick demo from VM:

Startup complete
QNX oksh-smoke 8.0.0 2025/07/30-19:24:08EDT x86pc x86_64
 
# 
# 
# /system/bin/oksh
oksh-smoke# echo "
> Hi
> "

Hi

oksh-smoke# echo $((3+7))
10
oksh-smoke# 

Cross-builds also pass for:

  • qcc -V12.2.0,gcc_ntox86_64
  • qcc -V12.2.0,gcc_ntoaarch64le

Linux native build/smoke stayed fine on my side too.

Note: this PR focuses on runtime hardening. It does not yet add stronger configure-time signal detection for cross-build scenarios (--no-thanks), which I can experiment in a separate follow-up.

Guard signal message setup in inittraps, avoid fallback confstr override on QNX, and harden PS1 hostname expansion when gethostname fails.
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.

1 participant