Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Aug 2020 18:54:02 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364209 - stable/12/sys/compat/linprocfs
Message-ID:  <202008131854.07DIs2mk099921@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Thu Aug 13 18:54:01 2020
New Revision: 364209
URL: https://svnweb.freebsd.org/changeset/base/364209

Log:
  MFC r362806:
  
  Make linprocfs(5) create the /proc/<PID>/task/ directores.
  This is to silence down some Chromium assertions.
  
  PR:		kern/240991
  Analyzed by:	Alex S <iwtcex@gmail.com>
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/12/sys/compat/linprocfs/linprocfs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- stable/12/sys/compat/linprocfs/linprocfs.c	Thu Aug 13 18:51:57 2020	(r364208)
+++ stable/12/sys/compat/linprocfs/linprocfs.c	Thu Aug 13 18:54:01 2020	(r364209)
@@ -1634,6 +1634,28 @@ out:
 }
 
 /*
+ * The point of the following two functions is to work around
+ * an assertion in Chromium; see kern/240991 for details.
+ */
+static int
+linprocfs_dotaskattr(PFS_ATTR_ARGS)
+{
+
+	vap->va_nlink = 3;
+	return (0);
+}
+
+/*
+ * Filler function for proc/<pid>/task/.dummy
+ */
+static int
+linprocfs_dotaskdummy(PFS_FILL_ARGS)
+{
+
+	return (0);
+}
+
+/*
  * Filler function for proc/sys/kernel/random/uuid
  */
 static int
@@ -1772,6 +1794,11 @@ linprocfs_init(PFS_INIT_ARGS)
 	pfs_create_file(dir, "auxv", &linprocfs_doauxv,
 	    NULL, &procfs_candebug, NULL, PFS_RD|PFS_RAWRD);
 	pfs_create_file(dir, "limits", &linprocfs_doproclimits,
+	    NULL, NULL, NULL, PFS_RD);
+
+	/* /proc/<pid>/task/... */
+	dir = pfs_create_dir(dir, "task", linprocfs_dotaskattr, NULL, NULL, 0);
+	pfs_create_file(dir, ".dummy", &linprocfs_dotaskdummy,
 	    NULL, NULL, NULL, PFS_RD);
 
 	/* /proc/scsi/... */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008131854.07DIs2mk099921>