]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pam: Fix "buffer overflow" in pam ZTS tests on F38
authorTony Hutter <hutter2@llnl.gov>
Wed, 10 May 2023 00:55:19 +0000 (17:55 -0700)
committerGitHub <noreply@github.com>
Wed, 10 May 2023 00:55:19 +0000 (17:55 -0700)
commitd3db900a4e457c3a75e6cef8e9bac8d278ddc929
tree7dc76e42ef65ca44d88b77b4bba8208452b2dc4e
parent903c3613d490d1321d587982abb5e4dda4a43308
pam: Fix "buffer overflow" in pam ZTS tests on F38

The pam ZTS tests were reporting a buffer overflow on F38, possibly
due to F38 now setting _FORTIFY_SOURCE=3 by default.  gdb and
valgrind narrowed this down to a snprintf() buffer overflow in
zfs_key_config_modify_session_counter().  I'm not clear why this
particular snprintf() was being flagged as an overflow, but when
I replaced it with an asprintf(), the test passed reliably.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #14802
Closes #14842
contrib/pam_zfs_key/pam_zfs_key.c