From owner-freebsd-scsi@freebsd.org Fri Feb 23 15:25:13 2018 Return-Path: Delivered-To: freebsd-scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 276E8F2A995 for ; Fri, 23 Feb 2018 15:25:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A91458630F for ; Fri, 23 Feb 2018 15:25:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id o13so3399256ito.2 for ; Fri, 23 Feb 2018 07:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=57x6gk5u3UJ1rAgtdN2Vp5Im4GVC/PyG0iIEqWSIhME=; b=g92o57cw67c9Nq7R6nQX7mqJekafXFPobpGQTgQIwKtvEEqwrrLE7CVITwdEKn2/Db MF/GsAVL6ammm3dqzlrHUxXV2nIQYVaoTurXugLzU4sGBwP+qZOE/altEapLn2tsOlJF rKScnP2GpE8A2AtspnnSRMx+igTrhSHPyKksqdlw+/WcMguCGCb4xoNAeTqsATC5ZBLN +VVWEMqJMsNF/SlY8ctcaPnWh7NCzLaYLsQvZBjX109yFB6SEGbeXnW8okk5CkUh0NL1 pFttSI5kuow+UEF9cjP08YKK5sx9j9nm4TQX6QiEBH/ZA40b8k2xD94YesCLn5j5ooQH RRrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=57x6gk5u3UJ1rAgtdN2Vp5Im4GVC/PyG0iIEqWSIhME=; b=ZBQNWvI7GQ5Wa0dVf/UXLmWCPOh9EukJvwRQqHgrEWifGHKDJqCcEV+I3JM9GlLcF1 fdDhnDTvlU4O378fwf9KpDV7C95X3kHhNKIUnF1B2ENtX8jf+aYriv/3ENMHHhcHCcDr RghBppM5NFCRbakT1Ex3xejWoQG63hKPMpKuxT/7M14ZagYuzvxgP/K9/F73kme81K+O DmDQOmgjQmwG3Gh5GtzeUhp3K6nBJXajMZzl7NJQfmdZvz3s5tm22Kvr8Ix7DzckdoNf CCP9GQ6tk5FuVsqG3u7ljgkr7gv7PjHTS/wY1CgDaj45TzEZt2MiORKrO/KotnRPgvLJ LNdg== X-Gm-Message-State: APf1xPDjdabI+m1Xay5Fhpw2oNVHdE7wFLmZROVUdgs4zHiQoifnAg1J scPxU0nfVnaAMQSCGZy0BCZMJyFEtIHEOncyon8vug== X-Google-Smtp-Source: AH8x224LogmwLaimTZETHkR7C7qHo3MzbShtZHG5mh4djC6VyhhXEJoc328mXVnASQzhoK/SuBlR2oskfpAQl2tk+gc= X-Received: by 10.36.222.2 with SMTP id d2mr2655954itg.1.1519399511955; Fri, 23 Feb 2018 07:25:11 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 23 Feb 2018 07:25:11 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <0985ABD3-D141-4EE2-B1B3-3016B16E2B68@gmail.com> References: <0985ABD3-D141-4EE2-B1B3-3016B16E2B68@gmail.com> From: Warner Losh Date: Fri, 23 Feb 2018 08:25:11 -0700 X-Google-Sender-Auth: y7xCWKcfNa74SB8xfO3E5Xk-11c Message-ID: Subject: Re: smartmontools and kern.securelevel To: Ben RUBSON Cc: Freebsd fs , FreeBSD-scsi Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 15:25:13 -0000 On Fri, Feb 23, 2018 at 8:20 AM, Ben RUBSON wrote: > Hi, > > I run smartmontools on my storage servers, to launch periodic disk tests > and alert on disk errors. > > Unfortunately, if we set sysctl kern.securelevel >=2, smartmontools does > not work anymore. > Certainly because it needs to write directly to raw devices. > (details of the levels, -1 to 3, in security(7)) > > Any workaround to this ? > > Perhaps we could think about allowing SMART commands to be written to > disks when sysctl kern.securelevel >=2 ? > (I assume smartmontools writes SMART commands) > Sending raw disks commands is inherently insecure. It's hard to create a list of those commands that are OK because of the complexity and diversity of the needed functionality. That complexity also makes it hard to put the commands into a series of ioctls which could be made more secure. Warner