]> git.alsa-project.org Git - alsa-lib.git/commit
ucm: confine sysw and cfg-save paths with realpath()
authorHarsh Raj Singhania <raj.harshraut@gmail.com>
Wed, 30 Sep 2026 18:59:06 +0000 (00:29 +0530)
committerTakashi Iwai <tiwai@suse.de>
Thu, 15 Oct 2026 13:47:05 +0000 (15:47 +0200)
commita47c8bc3fef190e7eb463283230263c82208597a
tree0c28cbbf7c8363a834c55556b1071afc967b4da4
parent81c4a89eb445f8e991ca80ab55b5649530c0aacd
ucm: confine sysw and cfg-save paths with realpath()

1: execute_sysw() concatenated the sysfs root with a caller path via
snprintf() with no traversal check. Use realpath() and reject paths
that escape the sysfs root.

2: execute_cfgsave() opened a caller-supplied filename with no
restriction. Confine writes to XDG_RUNTIME_DIR (or /tmp) via
realpath().

[ rewritten with check_realpath() helper function -- tiwai ]

Closes: https://github.com/alsa-project/alsa-lib/pull/527
Signed-off-by: Harsh Raj Singhania <raj.harshraut@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/ucm/main.c