diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2020-06-30 16:24:28 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2020-06-30 16:24:28 +0000 |
commit | c2da36fecdd1dcc8a598592a3f606b72376e5d68 (patch) | |
tree | 151263236106f5924ce88c5f79a936906ac079b5 /sys/compat/linprocfs/linprocfs.c | |
parent | 6d33315d2f7bd38c923f7a1db277348fad767a42 (diff) |
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>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25256
Notes
Notes:
svn path=/head/; revision=362806
Diffstat (limited to 'sys/compat/linprocfs/linprocfs.c')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index c441193a4991..3d6ebf9e5179 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1620,6 +1620,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 @@ -1760,6 +1782,11 @@ linprocfs_init(PFS_INIT_ARGS) 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/... */ dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0); pfs_create_file(dir, "device_info", &linprocfs_doscsidevinfo, |