From nobody Fri Apr 12 23:09:55 2024 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 4VGXMm1Qv7z5GKln; Fri, 12 Apr 2024 23:09:56 +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 4VGXMm0cHcz4xPV; Fri, 12 Apr 2024 23:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712963396; 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=Baqp5YMZhk2fMr4me/eFhhPoTTHeoGNE7XQZDi8F1yQ=; b=owPbWp7sPIXhvsQP4nbS4pot8zBfZuUR1BJ+zAwd4T2XWQh6CyZoTuTmXgWYuAqqg+7vua oTIJqqLBvU+cMN00QLFOLd9BQdBZlqZGY4xwO0bMXamnPhTTeciHtq22Gc0Hq34dU0gCfc BsCFJ4jTLFfaRr1GAHJ8rvTNz4oOcX0XfmXYwuhpS1rwmcVyLJD4GXpZ+6Qaj+SCRyT5Im U3ukwvTXFEw55K/Rmndk7c9rGnjgsC3cN5WPnkvbcNnx97m+YSHSX8bD5yetNJAuMwSB+4 xktwoCfSIPYD/V/zSGM8SbmS3X9kbotFFgsW4MqNxMZ0Kz7utU4lC0aUABmQIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712963396; a=rsa-sha256; cv=none; b=WLMCD0ZWQnysJPmylVSbZBEP2sW/dgMh/sPkEVaCinKNpCU+byOg8cV8pCPNvaZGRQikrK L4xVLy+LDhZj9RaqB1QqQsVyWcqaRGBkiGsvNOymKeaU3FSrhr7Mbq31t2Mx+PI5992Hck S3hHEIqlkFdoANf8UQKC673Dd4WkRW8YNQnbv65GFeiS2oJukd/mbQRBoXyuLQRTEXLeK2 h61mozaoGCu4kOGMLZBgO2oI1QKe90XK0C9wmD4CY7dPw1CIHZEyyx8tnKFgsymdVBaQ01 ne4n9lp0wHTCvVW1mdN2eXOgtXxCA2q6sV3a60sgkqQoXVx+rt9D18tFmi++aQ== 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=1712963396; 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=Baqp5YMZhk2fMr4me/eFhhPoTTHeoGNE7XQZDi8F1yQ=; b=PZa4QowryA42Eebo9WweKi52YCWgAuQiXM2f4lHDQV2Zatxc7HtGkae0ht2fG6kTvBBaCE Yfq48Ie7G+b47maqNf4aTAs1PoYK+0Joga+EuH66ZkQKdJuFNNuyLQEz7VEKTT/mSoLs7T fmTjKA2PKAQfhxmFrd38ctAeTnMcP1Qk8os8Pz4gEV8kdQturM0pFG3oZaqOyiDqzzIXcH nDoV9BGz319Uin3/iUhcPPuhXlHOJFK203wMYLMzL61JEs7jx2NYqbQDEGMgLP+SQ42qgL Uq7aI3vLoyHY9LbySl4GdSMzNhlSdhnKZqSMaUO0S0R5Sl9KtbQQIg4nCsDIhw== 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 4VGXMm0CwTz17Zm; Fri, 12 Apr 2024 23:09:56 +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 43CN9tOI070680; Fri, 12 Apr 2024 23:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CN9tJp070677; Fri, 12 Apr 2024 23:09:55 GMT (envelope-from git) Date: Fri, 12 Apr 2024 23:09:55 GMT Message-Id: <202404122309.43CN9tJp070677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 218b2ccf8cc9 - main - LinuxKPI: implement memzero_explicit() 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 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/main X-Git-Reftype: branch X-Git-Commit: 218b2ccf8cc90698487515c681f3e3453b0dcead Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=218b2ccf8cc90698487515c681f3e3453b0dcead commit 218b2ccf8cc90698487515c681f3e3453b0dcead Author: Bjoern A. Zeeb AuthorDate: 2024-04-02 09:30:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-12 23:09:19 +0000 LinuxKPI: implement memzero_explicit() Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D44586 --- 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 1365b7d7823a..9e1818a38594 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -289,4 +289,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_ */