aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2024-08-26 20:44:24 +0000
committerAlan Somers <asomers@FreeBSD.org>2024-09-19 20:24:04 +0000
commitc6d11ae455a9c5b6e927ac0a5d63570081074208 (patch)
tree52b675256f5a156c4f5d2ec9f4d588d485781e8f
parente2217f809732666a1124147b8cab1aef334acaa5 (diff)
ctl: fix uninitialized data used by PREVENT ALLOW MEDIUM REMOVAL
Zero-initialize the bitmap of preventers. Otherwise, the START STOP UNIT command may not have the intended effect. Sponsored by: Axcient Reviewed by: emaste, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1409 (cherry picked from commit 0f2b2276abc305905e7d88619a7abca26b0dd7eb)
-rw-r--r--sys/cam/ctl/ctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 0e0d79d15d8f..9a99823a5c1c 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -4771,7 +4771,7 @@ fail:
ctl_tpc_lun_init(lun);
if (lun->flags & CTL_LUN_REMOVABLE) {
lun->prevent = malloc((CTL_MAX_INITIATORS + 31) / 32 * 4,
- M_CTL, M_WAITOK);
+ M_CTL, M_WAITOK | M_ZERO);
}
/*