From nobody Mon Feb 21 08:07:45 2022 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 F297F19C93BD; Mon, 21 Feb 2022 08:07:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K2FKF44w1z3qDL; Mon, 21 Feb 2022 08:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645430865; 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=rJDt9HPSNduNZKpqk/3Q4y7k1Y1KCkPUwfAwbX5httQ=; b=VY4fqshk833daUGpKYFZRWyvAdZTXt4b1ZlCoNltA1O5OXxfV5pIsWkSxljJdxq5xIqzkx A/9ZiOWtLAr5IUFGDjY9fxhd5GfnjBnPP9WNMNLAacELYB/Kvyd1UCBHTL58R/Q6zuiDR8 7e24vOpjRwKIpdyops8ka33DJhkSAeG7QpxiioY4kG4fr+82SrFOhyJpaxxH23xuRnKQCJ VDuaEVg0pghmA/KmU0uKX+FGJb73O3i+Dy4aXDRWKrtNhhbUOJLIfgas+/5CNxmKvbnLNu /ElDrXaEVgObIVvHW1dhjD6S3r0xUx3riYEgGH3mMZ5enubuUCsert0tNrWOMg== 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 5C71249EB; Mon, 21 Feb 2022 08:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21L87jHB036998; Mon, 21 Feb 2022 08:07:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21L87jkQ036997; Mon, 21 Feb 2022 08:07:45 GMT (envelope-from git) Date: Mon, 21 Feb 2022 08:07:45 GMT Message-Id: <202202210807.21L87jkQ036997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "David E. O'Brien" Subject: git: 5f5c20f3b2a8 - stable/12 - Avoid returning a NULL pointer from the Intel hw PRNG ifunc resolver. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 5f5c20f3b2a8f58e1f4ace73aa92a9f4ae46568c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645430865; 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=rJDt9HPSNduNZKpqk/3Q4y7k1Y1KCkPUwfAwbX5httQ=; b=T8wBsMAgc4uHTkQmjadHr1phnj1G3LODFWzMa4Eg62xj/xRfcyyAEwOb+yedlNURzvbnvI mQhGogRjh7isf3QyGa36bgRqEF2E2M9JjVSvZ2wg/0FDWEf+ndCGPCBOBFLi+HvUkq5Ope L3k+vNqDL/iDeiy8B2wWuco5sJ44JqdO87RI+aphp0pLLuLM+WsgHfynt3E8dUti/2B5J2 z/2Fkhum5TNPCuMjsvXoxUXtV80167+st9kdkifD+73ET7iPqz7p+FrzsC58eVP7GwRC9g ryHJ6TxdZOswR+WNYSezSP1eL6uXWA9qFBeP0uT0a2+yaGdTFdq8fYwbcrLV5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645430865; a=rsa-sha256; cv=none; b=kQcDNLZUeX2Zth1DsSIGjo7zKfqeEF9d+7tefCVmJdPJeAg+rD0q3M7fNIrkjhWeo85clE GgAf2ARIpw+k4UZXwqq4PpLbz266eoyJ5kQBpIEt52/FCcyX284TcfMMwBMOFxJeUwM3x6 vIgD3j7kuBPLFey1p4KshU0nu21nasy0zUQJmnumqi+tqcRvEXP4h0D4yVdqKr6ik910v1 OUKRm5SCQEkHRNVqA7wQcMgYdWbDJc6u7+6ZweiP0ECJrwblCMW4sjroctTuH7tzYvFGAN LOHbr0uBWpwTl/nw0bfWHSkVEgcruu8r5BymR5t/0lf0p5NTtv/KLAF4SDCClw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by obrien: URL: https://cgit.FreeBSD.org/src/commit/?id=5f5c20f3b2a8f58e1f4ace73aa92a9f4ae46568c commit 5f5c20f3b2a8f58e1f4ace73aa92a9f4ae46568c Author: Mark Johnston AuthorDate: 2019-05-10 04:28:17 +0000 Commit: David E. O'Brien CommitDate: 2022-02-21 05:56:42 +0000 Avoid returning a NULL pointer from the Intel hw PRNG ifunc resolver. DTrace expects kernel function symbols of a non-zero size to have an implementation, which is a reasonable invariant to preserve. (cherry picked from commit b870199522666a66e378e90ca3dbef39c30f12c6) --- sys/dev/random/ivy.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/random/ivy.c b/sys/dev/random/ivy.c index 5ff288b394ac..e45e6a2d1242 100644 --- a/sys/dev/random/ivy.c +++ b/sys/dev/random/ivy.c @@ -97,6 +97,13 @@ x86_rdseed_store(u_long *buf) return (retry); } +static int +x86_unimpl_store(u_long *buf __unused) +{ + + panic("%s called", __func__); +} + DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) { has_rdrand = (cpu_feature2 & CPUID2_RDRAND); @@ -107,7 +114,7 @@ DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) else if (has_rdrand) return (x86_rdrand_store); else - return (NULL); + return (x86_unimpl_store); } /* It is required that buf length is a multiple of sizeof(u_long). */