drivers/relays/relays.c builds every sysfs path into fixed stack buffers (p[80] in exported(), ex[80] and p[96] in ensure_ready(), p[96] in warden_relay_get() / warden_relay_set()) with snprintf and never checks for truncation. With WARDEN_GPIO_ROOT set to a root longer than about 70 characters the paths are cut short, every exists() / read fails, and both relays silently report unavailable ("The relay GPIO could not be claimed").
Found while rendering the Relays page in the simulator for flare-edge#312 with a fake GPIO tree under a long scratch path; a short root works. Production uses /sys/class/gpio, so panels are not affected: this bites the simulator and host-test seam only.
Expected: a root that does not fit is reported (log and false) instead of producing a truncated path, or the buffers are sized from PATH_MAX. Regression test: the existing fake-io coverage with a long root.
Not fixed in the flare-edge#312 round: the fix belongs on a branch of this SDK repo plus a submodule bump in flare-edge, outside that UI-only change.
`drivers/relays/relays.c` builds every sysfs path into fixed stack buffers (`p[80]` in `exported()`, `ex[80]` and `p[96]` in `ensure_ready()`, `p[96]` in `warden_relay_get()` / `warden_relay_set()`) with `snprintf` and never checks for truncation. With `WARDEN_GPIO_ROOT` set to a root longer than about 70 characters the paths are cut short, every `exists()` / `read` fails, and both relays silently report unavailable ("The relay GPIO could not be claimed").
Found while rendering the Relays page in the simulator for flare-edge#312 with a fake GPIO tree under a long scratch path; a short root works. Production uses `/sys/class/gpio`, so panels are not affected: this bites the simulator and host-test seam only.
Expected: a root that does not fit is reported (log and `false`) instead of producing a truncated path, or the buffers are sized from `PATH_MAX`. Regression test: the existing fake-io coverage with a long root.
Not fixed in the flare-edge#312 round: the fix belongs on a branch of this SDK repo plus a submodule bump in flare-edge, outside that UI-only change.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
drivers/relays/relays.cbuilds every sysfs path into fixed stack buffers (p[80]inexported(),ex[80]andp[96]inensure_ready(),p[96]inwarden_relay_get()/warden_relay_set()) withsnprintfand never checks for truncation. WithWARDEN_GPIO_ROOTset to a root longer than about 70 characters the paths are cut short, everyexists()/readfails, and both relays silently report unavailable ("The relay GPIO could not be claimed").Found while rendering the Relays page in the simulator for flare-edge#312 with a fake GPIO tree under a long scratch path; a short root works. Production uses
/sys/class/gpio, so panels are not affected: this bites the simulator and host-test seam only.Expected: a root that does not fit is reported (log and
false) instead of producing a truncated path, or the buffers are sized fromPATH_MAX. Regression test: the existing fake-io coverage with a long root.Not fixed in the flare-edge#312 round: the fix belongs on a branch of this SDK repo plus a submodule bump in flare-edge, outside that UI-only change.
Fixed by
b18ed38, merged into flare-edge-next in #11; flare-edge picks it up in blueflare/flare-edge#318.