NetBSD Problem Report #61009

From www@netbsd.org  Sat Nov 14 18:37:09 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0CAAF1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 14 Nov 2026 18:37:09 +0000 (UTC)
Message-Id: <20261114183707.6ACBC1A923F@mollari.NetBSD.org>
Date: Sat, 14 Nov 2026 18:37:07 +0000 (UTC)
From: el@horse64.org
Reply-To: el@horse64.org
To: gnats-bugs@NetBSD.org
Subject: There seems to be a missing NetBSD sysctl equivalent to Linux's "mitigations=full"
X-Send-Pr-Version: www-1.0
X-From4GNATS: "el@horse64.org via gnats" <gnats-admin@NetBSD.org>

>Number:         61009
>Category:       kern
>Synopsis:       There seems to be a missing NetBSD sysctl equivalent to Linux's "mitigations=full"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 14 18:40:00 +0000 2026
>Originator:     Ellie
>Release:        11.0
>Organization:
>Environment:
NetBSD ruby-b-s-delly 11.0_STABLE NetBSD 11.0_STABLE (GENERIC) #0: Fri Oct 30 19:02:53 UTC 2026  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
There seems to be a missing NetBSD sysctl equivalent to Linux's "mitigations=full", some way for the user to indicate I care more about process isolation than performance. Some single command that should enable all the available fixes.

This page only lists a few scattered individual options: https://wiki.netbsd.org/security/meltdown_spectre/ And some of them don't seem to be enabled by default:

# sysctl -w machdep.spectre_v4.mitigated=1
machdep.spectre_v4.mitigated: 0 -> 1

I was also surprised to not see IBRS mentioned, for me the kernel claims there are no hardware mitigations for this Ryzen 5 5500U:

# sysctl -w machdep.spectre_v2.hwmitigated=1
sysctl: machdep.spectre_v2.hwmitigated: Operation not supported
# sysctl machdep.spectre_v2.hwmitigated
machdep.spectre_v2.hwmitigated = 0

...with the method not mentioning IBRS:

# sysctl machdep.spectre_v2.method
machdep.spectre_v2.method = [GCC retpoline]

I wonder if it shouldn't be using IBRS...? Do I need to do something else to enable that? But I'm not an expert so this could be completely wrong.

Anyway, having a "enable everything available" option would really help. And perhaps also a more central way to list what techniques are being used in total, e.g. like Linux listing them in "lscpu".
>How-To-Repeat:
1. Read https://wiki.netbsd.org/security/meltdown_spectre/

2. Try to find some unified way of 1. enabling all available mitigations with one single command (on Linux: "mitigaitons=full"), and 2. listing all in-use mitigations with one single command (on Linux: "lscpu").
>Fix:
not known

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.