]> git.proxmox.com Git - mirror_zfs.git/commit
Fix potential buffer overflow in zpool command
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Sun, 4 Dec 2022 02:43:33 +0000 (21:43 -0500)
committerTony Hutter <hutter2@llnl.gov>
Thu, 19 Jan 2023 20:50:36 +0000 (12:50 -0800)
commite23ed1b3307fed4edf349c44434985092b3244d6
tree7d465a6a219dcf1c9772de5a71db483ef760a411
parent572114d8465bb928dec51b7668e6627df255b1d1
Fix potential buffer overflow in zpool command

The ZPOOL_SCRIPTS_PATH environment variable can be passed here. This
allows for arbitrarily long strings to be passed to sprintf(), which can
overflow the buffer.

I missed this in my earlier audit of the codebase. CodeQL's
cpp/unbounded-write check caught this.

Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14264
cmd/zpool/zpool_main.c