From nobody Tue Nov 11 04:18:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4d5Cv45Qt0z66mty; Tue, 11 Nov 2025 04:18:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d5Cv44q2gz3hD0; Tue, 11 Nov 2025 04:18:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762834688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3b4JmI3t/5vwVy/+jRVR5kebFm177yOrh0+yJ1/SrT8=; b=J7+9z5EU++ctSBFl7iDJ7bxNeWXsm1vGzrpaeiElTdoFtxidmz7bX+lM1bFem1i4Fa7cgG 4Gkt3YrK8vapel7AgLCWDiGIIE6v4wcNM5tSPjN0CHuBAjvI4pWnWoi01UGAzJ3NgMaGoK BZVD2VN468hxQH8rlXnlQj2tVMiJIHNe2ygBR+EtLPXgsyRbs/x645TLuIwq95DC8irIjr iUe1PtGvmkLQYVODZXL8PRbJ5nr0z11AZKDaN7IhHrOdvcsmS093PLzpu3ilxWWhz9w32C qUTExxJWDVgVxpPjEt7CYKDX/eqWRHtA+JKc0OfSEwWtikBOaP73gzQIi+duEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762834688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3b4JmI3t/5vwVy/+jRVR5kebFm177yOrh0+yJ1/SrT8=; b=oen9jP1op/uiTLFZJ37fiYasOYC65Xomf8YEQn7wCJ0+IQuNWKLpjtwAsP0iDAHTMNNYso 8FkHnyCjHgmmPNZW0Gq7WK5GWlYqQXZcznmRpOH4EgDRTXnwKCESBA7m+Ar/OUSpkCm07b ASxldsxLAjJScaUZ3aJqjfa8jWq2FXSjIN+EPe+7udcgMPPMRWlsnLXbLBintYMrrqoxLa iF69H9QQsb3Bh+d/scjovUeWFs0nEi9sKzVE//UxKES5Yhon/Z34oGiQLu68NVdGHbd31/ xW5vnnvOuTPpU6m8iZ80T7NtZvNj5zizdNjAcqAC101FQaRKSKWWwHxE0ioPrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762834688; a=rsa-sha256; cv=none; b=PGBbWI8Ke1CUfocHDbKtiK6yOb6slY29p7kUY7VdyY6awCkXZglhLprWGL5uqlm971zGEb dCg9vPKF3EP9gSpmV+QWq2J2PI4sJlLVUVAukUDorbDZTCT8pgjdEh9V6OYDe4zjWt6tu4 y9O6aylxN6FqRtRc/eMv7zB2glhVRVdqvuhqoo3KACFmrjzGH3xR7lA2pDBq+keIwSv5Zf Q4sTg+jAPngsU68jLoY2+1wXYEhahfuoONYwChaST10DwyfoD9ZMgcHegUop912s8S78o4 gZW5icBJn51k6jBO0kpFQwRCZ9l/X3WWqnqYWUfU52tt8wXD3w03/Gr21bGpew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4d5Cv44JJtzp9x; Tue, 11 Nov 2025 04:18:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5AB4I8Ub049255; Tue, 11 Nov 2025 04:18:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5AB4I8VT049252; Tue, 11 Nov 2025 04:18:08 GMT (envelope-from git) Date: Tue, 11 Nov 2025 04:18:08 GMT Message-Id: <202511110418.5AB4I8VT049252@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "David E. O'Brien" Subject: git: d6f10a5d013f - main - random: allow disabling of entropy harvesting from keyboard & mice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obrien X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6f10a5d013fdcc92847644ffbaf65cbf491bb39 Auto-Submitted: auto-generated The branch main has been updated by obrien: URL: https://cgit.FreeBSD.org/src/commit/?id=d6f10a5d013fdcc92847644ffbaf65cbf491bb39 commit d6f10a5d013fdcc92847644ffbaf65cbf491bb39 Author: David E. O'Brien AuthorDate: 2025-10-28 02:57:21 +0000 Commit: David E. O'Brien CommitDate: 2025-11-11 02:47:41 +0000 random: allow disabling of entropy harvesting from keyboard & mice Reviewed by: jmg Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D53390 --- sys/amd64/conf/GENERIC | 2 ++ sys/amd64/conf/MINIMAL | 2 ++ sys/arm/conf/GENERIC | 2 ++ sys/arm64/conf/std.arm64 | 2 ++ sys/conf/NOTES | 2 ++ sys/conf/options | 2 ++ sys/dev/vt/vt_core.c | 2 ++ sys/dev/vt/vt_sysmouse.c | 3 ++- sys/powerpc/conf/GENERIC64 | 4 ++++ sys/powerpc/conf/GENERIC64LE | 4 ++++ sys/riscv/conf/GENERIC | 4 ++++ 11 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 1de895a5b333..4e710e47fdae 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -326,6 +326,8 @@ device bpf # Berkeley packet filter device rdrand_rng # Intel Bull Mountain RNG device tpm # Trusted Platform Module options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 +options RANDOM_ENABLE_KBD +options RANDOM_ENABLE_MOUSE # USB support options USB_DEBUG # enable debug msgs diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL index 2bd8851ab20c..8df3349b4c34 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -124,6 +124,8 @@ device bpf # Berkeley packet filter device rdrand_rng # Intel Bull Mountain RNG device tpm # Trusted Platform Module options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 +options RANDOM_ENABLE_KBD +options RANDOM_ENABLE_MOUSE # VirtIO support device virtio # Generic VirtIO bus (required) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 0d741a7e584a..89841947713d 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -219,6 +219,8 @@ device smsc # SMSC LAN91C111 # random(4) device tpm # Trusted Platform Module options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 +options RANDOM_ENABLE_KBD +options RANDOM_ENABLE_MOUSE # Sound support device sound diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 index 003f13c8f1cc..02bdd25f2d52 100644 --- a/sys/arm64/conf/std.arm64 +++ b/sys/arm64/conf/std.arm64 @@ -110,3 +110,5 @@ device smbios # random(4) device tpm # Trusted Platform Module options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 +options RANDOM_ENABLE_KBD +options RANDOM_ENABLE_MOUSE diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 71d14dc8915f..3d5f7dd8a71b 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2825,6 +2825,8 @@ options RANDOM_ENABLE_UMA # slab allocator # environment. options RANDOM_ENABLE_ETHER # ether_input +options RANDOM_ENABLE_KBD +options RANDOM_ENABLE_MOUSE options RANDOM_ENABLE_TPM # implies TPM_HARVEST # Module to enable execution of application via emulators like QEMU diff --git a/sys/conf/options b/sys/conf/options index 963263e8a732..2437c2c6908a 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -956,6 +956,8 @@ RANDOM_LOADABLE opt_global.h # the uma slab allocator. RANDOM_ENABLE_UMA opt_global.h RANDOM_ENABLE_ETHER opt_global.h +RANDOM_ENABLE_KBD opt_global.h +RANDOM_ENABLE_MOUSE opt_global.h RANDOM_ENABLE_TPM opt_global.h # This options turns TPM into entropy source. diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index bcf67ddc9689..a1376be954ee 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -876,7 +876,9 @@ vt_processkey(keyboard_t *kbd, struct vt_device *vd, int c) { struct vt_window *vw = vd->vd_curwindow; +#ifdef RANDOM_ENABLE_KBD random_harvest_queue(&c, sizeof(c), RANDOM_KEYBOARD); +#endif #if VT_ALT_TO_ESC_HACK if (c & RELKEY) { switch (c & ~RELKEY) { diff --git a/sys/dev/vt/vt_sysmouse.c b/sys/dev/vt/vt_sysmouse.c index f2f5a0fa5c3a..873dce123f7a 100644 --- a/sys/dev/vt/vt_sysmouse.c +++ b/sys/dev/vt/vt_sysmouse.c @@ -32,7 +32,6 @@ * SUCH DAMAGE. */ -#include #include "opt_evdev.h" #include @@ -222,7 +221,9 @@ sysmouse_process_event(mouse_info_t *mi) unsigned char buf[MOUSE_SYS_PACKETSIZE]; int x, y, iy, z; +#ifdef RANDOM_ENABLE_MOUSE random_harvest_queue(mi, sizeof *mi, RANDOM_MOUSE); +#endif mtx_lock(&sysmouse_lock); switch (mi->operation) { diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 91c91d58d058..e215651e4c3d 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -207,6 +207,10 @@ device xz # lzma decompression # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter +# random(4) +options RANDOM_ENABLE_KBD +options RANDOM_ENABLE_MOUSE + # USB support options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 5fb9715de655..4759b70a3d1f 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -203,6 +203,10 @@ device xz # lzma decompression # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter +# random(4) +options RANDOM_ENABLE_KBD +options RANDOM_ENABLE_MOUSE + # USB support options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index a7e1200e3884..36e3fcd41970 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -197,6 +197,10 @@ device mmcsd # MMC/SD flash cards # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter +# random(4) +options RANDOM_ENABLE_KBD +options RANDOM_ENABLE_MOUSE + # Flattened Device Tree options FDT