From f14a14eea03ef4e500c8f6fb03cd695d41d4a542 Mon Sep 17 00:00:00 2001 From: Oliver Pinter Date: Sat, 17 Dec 2016 20:04:20 +0100 Subject: [PATCH] smartmontools: fix panic on INVARIANTS enabled kernel after r308351 in base After r308351 commit the INVARIANTS enabled kernel gets too "eager" when checking the cam ccb flags. But the real problem was not the previous, but the smartmontools does not zeroed out the ccb on stack, and pass this dirty ccb to kernel, which is catched by an ASSERT. So fix this by filling up with 0 this ccb. This commit is similar, what's happen in r307684 in camcontrol. So this is the same followup patch in smartmontools. https://svnweb.freebsd.org/base?view=revision&revision=307684 https://svnweb.freebsd.org/base?view=revision&revision=308351 Sponsored-by: opBSD --- sysutils/smartmontools/files/patch-os__freebsd.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sysutils/smartmontools/files/patch-os__freebsd.cpp diff --git a/sysutils/smartmontools/files/patch-os__freebsd.cpp b/sysutils/smartmontools/files/patch-os__freebsd.cpp new file mode 100644 index 0000000..8a11cb5 --- /dev/null +++ b/sysutils/smartmontools/files/patch-os__freebsd.cpp @@ -0,0 +1,11 @@ +--- os_freebsd.cpp.orig 2016-12-17 18:42:22 UTC ++++ os_freebsd.cpp +@@ -1936,6 +1936,8 @@ smart_device * freebsd_smart_interface:: + int i; + const char * test_name = name; + ++ memset(&ccb, 0, sizeof(ccb)); ++ + // if dev_name null, or string length zero + if (!name || !*name) + return 0; -- 2.10.2