From 13a313ede7b58992266adf73d04fe77ae25bf300 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 13 Jun 2019 05:19:42 +0000 Subject: [PATCH] Don't print the request we may be aborting in ciss_notify_abort as part of ciss_detach. It's a left-over debug that isn't needed and also discloses a kernel address. Only root could provoke as part of a devctl or kldunload. Submitted by: Fuqian Huang MFC After: 1 week --- sys/dev/ciss/ciss.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index e4b887a38e60..b4ead0994bb2 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -107,6 +107,10 @@ #include #include +#ifdef CISS_DEBUG +#include "opt_ddb.h" +#endif + static MALLOC_DEFINE(CISS_MALLOC_CLASS, "ciss_data", "ciss internal data buffers"); @@ -197,7 +201,9 @@ static void ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn); static void ciss_notify_physical(struct ciss_softc *sc, struct ciss_notify *cn); /* debugging output */ +#ifdef DDB static void ciss_print_request(struct ciss_request *cr); +#endif static void ciss_print_ldrive(struct ciss_softc *sc, struct ciss_ldrive *ld); static const char *ciss_name_ldrive_status(int status); static int ciss_decode_ldrive_status(int status); @@ -3811,8 +3817,9 @@ ciss_notify_abort(struct ciss_softc *sc) cnc->opcode = CISS_OPCODE_WRITE; cnc->command = CISS_COMMAND_ABORT_NOTIFY; cnc->length = htonl(CISS_NOTIFY_DATA_SIZE); - +#if 0 ciss_print_request(cr); +#endif /* * Submit the request and wait for it to complete. @@ -4237,6 +4244,7 @@ ciss_kill_notify_thread(struct ciss_softc *sc) /************************************************************************ * Print a request. */ +#ifdef DDB static void ciss_print_request(struct ciss_request *cr) { @@ -4290,6 +4298,7 @@ ciss_print_request(struct ciss_request *cr) } } } +#endif /************************************************************************ * Print information about the status of a logical drive. @@ -4353,8 +4362,6 @@ ciss_print_ldrive(struct ciss_softc *sc, struct ciss_ldrive *ld) } } -#ifdef CISS_DEBUG -#include "opt_ddb.h" #ifdef DDB #include /************************************************************************ @@ -4409,7 +4416,6 @@ DB_COMMAND(ciss_prt, db_ciss_prt) } } #endif -#endif /************************************************************************ * Return a name for a logical drive status value.