From nobody Mon Apr 11 16:27:44 2022 X-Original-To: dev-commits-src-main@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 D01A48D1751; Mon, 11 Apr 2022 16:27:44 +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 4KcZ5X52Fgz4T1Y; Mon, 11 Apr 2022 16:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649694464; 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=b/oGCVq6t/WFUlLkE1FjMCJfJp78mEpiPgyC1LwsuQE=; b=HDVfO5CV29FuC9aCzRuJL4nd3d8cHaQSzFhuizU4N+5qpiu3K2If40UHmDmEBnFRr7kw2C QSyipxMVjQBsvoy2Q6WiOGb3/ZX04xonwop1iR82TKUfLvkrUiVOd8nZ2LqHQ0M2UZcaTv tVlqFrkISy3o2ErfddskoEC+T7hFxnze30+Rsnri5u8tsL9qAbYWmOVND+bE9odapKkH20 15eiARMZoV+h2070lRt27aoE+fqZ/t49T0q1yMuDLy0hCCwHIh/IX/OiZegdkxqWv0SWJP uertnoUCkUn5+D8FSwYIjM4RvDAYUG8DWEDa77gpK9uMaKu3ce027fHqZJT6Nw== 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 7263826579; Mon, 11 Apr 2022 16:27:44 +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 23BGRilP045797; Mon, 11 Apr 2022 16:27:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23BGRiMU045796; Mon, 11 Apr 2022 16:27:44 GMT (envelope-from git) Date: Mon, 11 Apr 2022 16:27:44 GMT Message-Id: <202204111627.23BGRiMU045796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando Apestegu=C3=ADa?= Subject: git: 0f2041a5b032 - main - [linprocfs] add sys/kernel/random/boot_id List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f2041a5b03259a8a7b20ffc98e34884cc5590b3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649694464; 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=b/oGCVq6t/WFUlLkE1FjMCJfJp78mEpiPgyC1LwsuQE=; b=M2ilvV/YL/dIOYcUG27Qq9erKPzdC5tSIhQdO4/28AnaVn3XgcvUKX7UTo5BkrXwdnvV8J Il1BVj+NPc4ZpsLKbByR9Uux8zuI7rPomx0bEd0mDIz+Xuivg8dmUcR8BSKMXFNNrSzpob UbXK2ziAtIb/DLy4jqOiIvbaQEgG+5PbQeNpF/A3+v7HcP3zWeMQeKRWpH5KrIYtup/xKC 3xKAgkttXqFNMNxC9JoThDCHurndO+L8MK43P0Qj6uIaMF0Kme+XmLg/6vvXU1dc+OqnHl mJf+MYz1sjcD7cLxUqTq545q0AnODLbCa0IH642uvd2G1lsP24x6Dq7VFLVmRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649694464; a=rsa-sha256; cv=none; b=jz1uVsKnK6Z2QfsIxric+VdGOZbLZY5J0vyy5/14hFaEnrywffXPlH+RgpF98xKQPyizLb xriArKdcgyebaU9XYiFq+SA1wuXD/Fjjw9sj8d9VN6HfTAyapJbDaeskA4sUYpYS+GSTtO aDLGcyWiyDGJZb2kS4w4A+7aotNzM/xjpybQYUL9yB8AibzJE2vwGdeSS7UI5SAHdjOok+ 2PDP1Ox+/kZkMSXc5OmHzClwUy0JXj8yv6+5pm/nQ+4MBlV63iizmnoIstg2Qo9LsImXmG QSH2vopTGPJuWfiTpk4h14nKtm1SuGoIqTu/YB7DH16isYr872UOtcsHYYa6mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0f2041a5b03259a8a7b20ffc98e34884cc5590b3 commit 0f2041a5b03259a8a7b20ffc98e34884cc5590b3 Author: Fernando ApesteguĂ­a AuthorDate: 2022-03-08 14:19:53 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2022-04-11 16:23:28 +0000 [linprocfs] add sys/kernel/random/boot_id This file holds a UUID that is invariant for every boot. In our case, it is invariant per mount. PR: 262369 Reported by: sodynet1@gmail.com Approved by: dchagin@ Differential Revision: https://reviews.freebsd.org/D34860 --- sys/compat/linprocfs/linprocfs.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 8a9525b4375d..f930c1d71987 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1887,6 +1887,24 @@ linprocfs_douuid(PFS_FILL_ARGS) return(0); } +/* + * Filler function for proc/sys/kernel/random/boot_id + */ +static int +linprocfs_doboot_id(PFS_FILL_ARGS) +{ + static bool firstboot = 1; + static struct uuid uuid; + + if (firstboot) { + kern_uuidgen(&uuid, 1); + firstboot = 0; + } + sbuf_printf_uuid(sb, &uuid); + sbuf_printf(sb, "\n"); + return(0); +} + /* * Filler function for proc/pid/auxv */ @@ -2097,6 +2115,8 @@ linprocfs_init(PFS_INIT_ARGS) dir = pfs_create_dir(dir, "random", NULL, NULL, NULL, 0); pfs_create_file(dir, "uuid", &linprocfs_douuid, NULL, NULL, NULL, PFS_RD); + pfs_create_file(dir, "boot_id", &linprocfs_doboot_id, + NULL, NULL, NULL, PFS_RD); /* /proc/sys/vm/.... */ dir = pfs_create_dir(sys, "vm", NULL, NULL, NULL, 0);