From owner-dev-commits-src-all@freebsd.org Sun Sep 12 16:35:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C00A6694C8; Sun, 12 Sep 2021 16:35:21 +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 4H6wFh5gdRz3nY7; Sun, 12 Sep 2021 16:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 9052F1728D; Sun, 12 Sep 2021 16:35:20 +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 18CGZKu4073988; Sun, 12 Sep 2021 16:35:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18CGZKks073987; Sun, 12 Sep 2021 16:35:20 GMT (envelope-from git) Date: Sun, 12 Sep 2021 16:35:20 GMT Message-Id: <202109121635.18CGZKks073987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 351acbedde16 - stable/13 - devctl: don't publish the mount options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 351acbedde1691eb64d34a94b3fcbddbf3662491 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2021 16:35:21 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=351acbedde1691eb64d34a94b3fcbddbf3662491 commit 351acbedde1691eb64d34a94b3fcbddbf3662491 Author: Warner Losh AuthorDate: 2021-07-24 15:03:53 +0000 Commit: Warner Losh CommitDate: 2021-09-12 15:56:14 +0000 devctl: don't publish the mount options Mount options aren't solely ASCII strings. In addition, experience to date suggests that the mount options are much less useful than was originally supposed and the mount flags suffice to make decisions. Drop the reporting of options for the mount/remount/unmount events. Reviewed by: markj Reported by: KASAN Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31287 (cherry picked from commit 6475667f7b72f5eb8fcd045967c251e45e38e2a2) --- sys/kern/vfs_mount.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 7dc6b795eefd..09c9a59d1bed 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -2516,27 +2516,6 @@ static struct mntoptnames optnames[] = { MNTOPT_NAMES }; -static void -mount_devctl_event_mntopt(struct sbuf *sb, const char *what, struct vfsoptlist *opts) -{ - struct vfsopt *opt; - - if (opts == NULL || TAILQ_EMPTY(opts)) - return; - sbuf_printf(sb, " %s=\"", what); - TAILQ_FOREACH(opt, opts, link) { - if (opt->name[0] == '\0' || (opt->len > 0 && *(char *)opt->value == '\0')) - continue; - devctl_safe_quote_sb(sb, opt->name); - if (opt->len > 0) { - sbuf_putc(sb, '='); - devctl_safe_quote_sb(sb, opt->value); - } - sbuf_putc(sb, ';'); - } - sbuf_putc(sb, '"'); -} - #define DEVCTL_LEN 1024 static void mount_devctl_event(const char *type, struct mount *mp, bool donew) @@ -2569,11 +2548,15 @@ mount_devctl_event(const char *type, struct mount *mp, bool donew) } } sbuf_putc(&sb, '"'); - mount_devctl_event_mntopt(&sb, "opt", mp->mnt_opt); - if (donew) - mount_devctl_event_mntopt(&sb, "optnew", mp->mnt_optnew); sbuf_finish(&sb); + /* + * Options are not published because the form of the options depends on + * the file system and may include binary data. In addition, they don't + * necessarily provide enough useful information to be actionable when + * devd processes them. + */ + if (sbuf_error(&sb) == 0) devctl_notify("VFS", "FS", type, sbuf_data(&sb)); sbuf_delete(&sb);