HomeFreeBSD

PAM: Fix unchecked return value from zfs_key_config_load()

Description

PAM: Fix unchecked return value from zfs_key_config_load()

9a49c6b782443ba6e627f2261c45f082ad843094 was intended to fix this issue,
but I had missed the case in pam_sm_open_session(). Clang's static
analyzer had not reported it and I forgot to look for other cases.

Interestingly, GCC gcc-12.1.1_p20220625's static analyzer had caught
this as multiple double-free bugs, since another failure after the
failure in zfs_key_config_load() will cause us to attempt to free the
memory that zfs_key_config_load() was supposed to allocate, but had
cleaned up upon failure.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13978

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Oct 6 2022, 12:09 AM
Tony Hutter <hutter2@llnl.gov>Committed on Dec 1 2022, 8:39 PM
Parents
rGc562bbefc00f: Fix potential NULL pointer dereference in dsl_dataset_promote_check()
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rGfa74250cd379: PAM: Fix unchecked return value from zfs_key_config_load() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Dec 1 2022, 8:39 PM