From nobody Thu Jan 15 20:53:08 2026 X-Original-To: freebsd-hackers@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 4dsZvF4LRqz6PR0B for ; Thu, 15 Jan 2026 20:53:13 +0000 (UTC) (envelope-from minsoochoo0122@proton.me) Received: from mail-106104.protonmail.ch (mail-106104.protonmail.ch [79.135.106.104]) (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 "protonmail.com", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dsZvF1zzKz3DfQ for ; Thu, 15 Jan 2026 20:53:13 +0000 (UTC) (envelope-from minsoochoo0122@proton.me) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1768510389; x=1768769589; bh=1IbTfTUtgDI+e7Sd4kA2PWaFajz2wJ6VYHmlsYjNPOo=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=LiQF5L8HjT1CaplMUiJoEIJH/hWYWA43bDeGkpEhm3mhaPNv+n0Y1kQSOXQYKcjl0 No9827obB2y3Wv2oyyfTUEft+eqgtgcTclnG9Diks3l+URiA7wIkaUs70hdlH1XVKM 0prVfLdAv8p+Ht9M1LjE4VIzHVArsY3eMVAUPL0ACN+2xFk86aKt36a715meKNbx+0 8YfmNpf7NvD33vBEJRbve27Q6MXe4tyOPf/2jkSaxuc45Kge2Av0O3dCAZvn1chhB+ QvjPZmYHp1+6AxdeF9ju0XT5RyX65XDn1OgVpzxfLxkL4XS1Lv/CE76+oasJX61t5d TdD1nmg4M7ncQ== Date: Thu, 15 Jan 2026 20:53:08 +0000 To: Shawn Webb From: Minsoo Choo Cc: freebsd-hackers Subject: Re: HMP scheduling on FreeBSD Message-ID: In-Reply-To: <5a2sxxiqkafxdolq362ivmpyfemi5wc75zknnuzqdhstezumrq@2p7o2dmf7r6n> References: <0Ng09S3rEB0BvT9vzHqVKU7rWxoad96kjEc7U2LCwDFJKmmswXujip7qbRlo_BIhNKcI7d-2CUHdp9Dxr3-7hhafpD6uagJSFUCjtC9qRr4=@proton.me> <5a2sxxiqkafxdolq362ivmpyfemi5wc75zknnuzqdhstezumrq@2p7o2dmf7r6n> Feedback-ID: 45891198:user:proton X-Pm-Message-ID: 41cc90c1f924e5acd0d46be669d93d14d21818b6 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:62371, ipnet:79.135.106.0/24, country:CH] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dsZvF1zzKz3DfQ On Thursday, January 15th, 2026 at 2:22 PM, Shawn Webb wrote: Hi Shawn, >=20 > Thank you very much for working on this! I've merged the patch locally > on one of my systems running HardenedBSD. I can confirm compilation > succeeds (and boots). >=20 Great to hear. Since the cpucap patch doesn't do anything functional on run= time, it shouldn't have any impact on the system. >=20 > One question I have regarding the security posture of heterogeneous > cores is whether constant-time cryptographic/string/math/etc > operations take between cores. Would it be possible for an attacker to > do by virtue of the different types of cores? >=20 ISA on different cores for a same chip is identical. For example, an Arm he= terogeneous chip should provide same Arm ISA version (e.g. v9.3) rather tha= n different ISA for different cores. The scheduler has no idea on the ISA v= ersion of a specific binary. However, as David noted, different cores can execute same ISA differently. = An example given by David was cpu cycle that takes to access L1 cache, but = this can apply for cryptographic instructions as well. >=20 > For example, when installing FreeBSD with a geli-backed root > filesystem, geli determines how quickly cryptographic operations take > and will adjust the number of rounds accordingly. If that operation > takes place on an efficiency core, would that result in fewer > encryption rounds with geli? >=20 > Can some sort of timing oracle exist by virtue of the different cores? > How are speculative execution vulnerabilities manifest? >=20 First of all, knowing the performance difference between cores in absolute = scale is impossible because my proposed change (and Linux kernel) normalize= s capacity to 0-1024. A relative performance difference, which is normalized to 0-1024 from diffe= rent sources (e.g. device tree have cpu-capacity that is measured in DMIPS/= MHz) can be accessed through sysctl (still being worked on). This sysctl wi= ll expose CPU's capacity (static) and dynamic scores (dynamic by cpu thrott= ling, temperature, etc). I will set CTLFLAG_CAPRD for these sysctls so we c= an add a layer of protection for these information. The measurement (or benchmark) done by GELI on boot is inaccurate on hetero= geneous platforms. This is not about pre versus post HMT scheduler support,= but if FreeBSD runs on existing devices like Intel Alder lake, GELI encryp= tion and decryption are already done on cores with different performance. I= n other words, the best method for disc encryption is to have something lik= e Apple's T2 or Secure Enclave. Exploiting the scheduler to run a task (like disc encryption) on a specific= core is hard. Attackers can spawn many tasks concurrently and run benchmar= ks to identify the core's performance, but this information is very unrelia= ble because the task could be moved to other core by load balancer or its i= nteractivity score (however, note that ULE scheduler is by design very hars= h on moving tasks between different cores). To speculative execution, they = need to retrieve relative performance scale on all cores (thus retrieving r= elative length of each run queue) and "guess" a task's interactivity score = which is very hard and almost impossible, and make there task run in a cert= ain way by faking scheduler to put the job into performance or efficient co= re. But because a process has no idea on what other processes are doing, gu= essing interactivity score will be very hard. Side note: ULE scheduler is vulnerable to starvation compared to fairness s= chedulers like CFS/EEVDF so theoretically a malicious process can intention= ally trigger starvation under certain circumstance. However, I haven't hear= d any use cases of this method. > I'm not expecting an answer to any of these questions. I'm just > writing down some thoughts. But, if anyone can answer those questions, > all the better. :-) >=20 > Thanks, >=20 > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD >=20 > Signal Username: shawn_webb.74 > Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/0= 3A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc