From nobody Wed Jun 12 19:16:39 2024 X-Original-To: dev-commits-src-branches@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 4VzwJR4hGBz5NHdp; Wed, 12 Jun 2024 19:16:39 +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 4VzwJR2yCQz56J2; Wed, 12 Jun 2024 19:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718219799; 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=3km4zg+HDVWdqomKnjU9cp93AACkolhQSO6vzICJgvo=; b=xSC/Ia+XNpBXKuTwHkboI1tEU2ZFfs8syZbE/hcSpUzgECy8bS4XLJAwpwq4XqrjhwQgJY gQVthLRfQL7jdKCHBqBcKUuDGkcvHLZz9RBGioewXlIS3bYRxK5ipXHA0yXnax9C8Cb3cC EGVFK/LpHMNvJreuJJDynX/u0KK6wXQs498mTFdHaSNs9tghyr1oxQjBFN68FhDr6pNpY3 hO9uvu0NExlmlgV8IwjSMhG1WRO+G8dFObdJI7g9wXQZxlVNAzXu6KqqC+Dc6X/mP0U5WF WMhSGsHM0Ne4UsUCHvGGaHghjcv5aowDFmqasrWtuONIPMAQ3Z86n0d1tVc8wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718219799; a=rsa-sha256; cv=none; b=LNjxFMxaC7T76CNeOe8zmZ8IHekfywaX8Le04nNREkSA5aCO3utxjUPlWOhJIZEQpKS41g h0AJktSQ/Pwl+BQT9w5oS3Fo3B7+s7ntYUi1KpClFqt6tvWv1oNs4T1xCbOrEkgHyAZtsZ eK5s2wJiD3vFOvQ87cXpPAPjSZoE+Sc7ARnnutYfqCjwoHy5AEp3uboZ2Bpp+LqmPL0kOB AkrxRnU681OxLWiblkMCO0TaYxMc+yZuXujSpEQBR/ASAspv0KX5V18s/9be+Nvi62E7Jq xMD1oC/2HE5XKs9S/9fLKClZidi3q2Wzo6iotWsKT0MaeanaVe3OWBQIYIgTsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718219799; 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=3km4zg+HDVWdqomKnjU9cp93AACkolhQSO6vzICJgvo=; b=d7CbzPQAZTGDg7C3JPD0PALWZ82ynnpegyKhY5553A0mCQEJXqpIPOhWfuHVoq9gMlHxJ6 vqWHKUo68iLxaB8mwOUOpWaebel3B9P968gdXM37M4uM9L6Ixobl+WNLtteN73QLTkb9vz ZFFsPxOA3KH+GmPHBJDEc+kAaSLlL2vkroYfCVsFaeX+s57KqR7Q2tHcjNdcwucxA9E8aR qpBGXqAAyDsszL5IMtEuuAhS3ypZvnDxjBPcLr/ioEWqSfF8ABC0RGu4W49mjnmXl7j0O5 2xNSWzbro2AWcs3FDPzbvoxfMmlCaPWC6tp8qeu6TCWeFO/d4gwzjVaEMld8mA== 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 4VzwJR2XC9z1584; Wed, 12 Jun 2024 19:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45CJGdTJ003677; Wed, 12 Jun 2024 19:16:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CJGdnN003674; Wed, 12 Jun 2024 19:16:39 GMT (envelope-from git) Date: Wed, 12 Jun 2024 19:16:39 GMT Message-Id: <202406121916.45CJGdnN003674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 25878310adcb - stable/13 - LinuxKPI: implement memzero_explicit() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25878310adcbb361b31bc89b34f744c0c5a29bb1 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=25878310adcbb361b31bc89b34f744c0c5a29bb1 commit 25878310adcbb361b31bc89b34f744c0c5a29bb1 Author: Bjoern A. Zeeb AuthorDate: 2024-04-02 09:30:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-06-12 16:57:01 +0000 LinuxKPI: implement memzero_explicit() Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D44586 (cherry picked from commit 218b2ccf8cc90698487515c681f3e3453b0dcead) --- sys/compat/linuxkpi/common/include/linux/string.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index f745c2f6d343..06dcdbd97663 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -273,4 +273,11 @@ memcpy_and_pad(void *dst, size_t dstlen, const void *src, size_t len, int ch) memset(_ptr + _o, _c, sizeof(*(ptr)) - _o); \ }) +static inline void +memzero_explicit(void *p, size_t s) +{ + memset(p, 0, s); + __asm__ __volatile__("": :"r"(p) :"memory"); +} + #endif /* _LINUXKPI_LINUX_STRING_H_ */