From nobody Fri Jun 17 19:39:02 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 121D185BCAB; Fri, 17 Jun 2022 19:39:04 +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 4LPq9L5tShz3Qng; Fri, 17 Jun 2022 19:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494744; 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=hXMqYZzpeSoutdJJbaYj73zwjMPhIZX1HZPHiDYSH9A=; b=tQWIrFK3ZMI3I43iB6LkUWbvpBMgrTBR1MBsZoWSXukcxeXU0uMc477fGviu9mL/J+v2y8 v1MUwWz8M7X5JdPHT0pl4P5btG2TcOWt4x0YeCD9FIDjhdWX1efhsyFyMiQRCRWF0poPaw E/ovX5XybzwjurylH/1fWIHcKcCdkd+0lNcOpv6sLVDwm56jJZHREM7gX0tffA5b8SHYq5 OO12+a4C92EwYqGa1guN9XHdQuCCqq7act+m858Xn0gLXYNC28xkSDZVSYX9p126DTPfIH oS2GypOZc6HXXNJP4h6+GrXwKnhthZe0uub4WlMX5ky1xIlgJSAm/iPG4tI7Iw== 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 A2FE925D0B; Fri, 17 Jun 2022 19:39:02 +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 25HJd24f015481; Fri, 17 Jun 2022 19:39:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJd2RV015480; Fri, 17 Jun 2022 19:39:02 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:39:02 GMT Message-Id: <202206171939.25HJd2RV015480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: c43c6efaee52 - stable/13 - [linprocfs] add sys/kernel/random/boot_id 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c43c6efaee52465c1076de3f2ba2d3aef56c5bb7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494744; 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=hXMqYZzpeSoutdJJbaYj73zwjMPhIZX1HZPHiDYSH9A=; b=DUoyAha7RDBZjj1ywQKheBgNlz8ZHjRN3DnqLNSpBZzrzUgDfxzAbaaluNmljS8hzfli4P bXE0GlJ65RLu+8N1igUcLVO7Lq2lNec38Q/d6IJ4/9VRw4K2KYfDn46Bk82oUi0CZePVAc N3IOCZ+kyGvu/l3gXUsylbt1s1N36RzvKw5AC5/t1GU/qD9IJabAqTnqDTcswDI1bcgWnb RlfftZtLOrj07D9NBGVVOVSxBWhkNx8+JTBBCpbYZLX+eMeBvogsM6ic1cGOsV840fPwRr PEKK4O6QQGKkzDFgqH2UVJ9c+4PxrByVNnSQLhXco4gJDFnKXrdtNJbpMSk+6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494744; a=rsa-sha256; cv=none; b=lydPJnq+R+f+lEzRcYnNm5WmUOCZNqdxV1baxG790FjlBqMEi48dJ/0oX6ZhvdvHt+tLob jFge0HXFgoq1oGuhI21prb59XJ2n+AfDnC3G+FFxVykXZsMwktkURqUmRtRSRRQeD7yAdV Rc1pINHZJB02dNy8Dtj9idptBTTZtOaDP/avwkVbVQglwHUvByAHBq4hjtIITJFSipsNWx oPLXwGKWh2rns7ZN21LqmiW3blDWq6IjTXUl0fuZ497w9/yWmrYqI6TsdsVcqJ/yxE3ogc ihhB+B4+JETOohml9jRxIvtYknMHu/oTbYtpYTqvTeytvUK7eq7ATqHo9GccdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c43c6efaee52465c1076de3f2ba2d3aef56c5bb7 commit c43c6efaee52465c1076de3f2ba2d3aef56c5bb7 Author: Fernando ApesteguĂ­a AuthorDate: 2022-03-08 14:19:53 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:50 +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 (cherry picked from commit 0f2041a5b03259a8a7b20ffc98e34884cc5590b3) --- 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 97ae357a229e..e1cc3289ce99 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);