NetBSD Problem Report #55407
From mlelstv@hoppa.1st.de Mon Jun 22 13:15:20 2020
Return-Path: <mlelstv@hoppa.1st.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 477211A9217
for <gnats-bugs@gnats.NetBSD.org>; Mon, 22 Jun 2020 13:15:20 +0000 (UTC)
Message-Id: <20200622131429.EF7A2B1@hoppa.1st.de>
Date: Mon, 22 Jun 2020 15:14:29 +0200 (CEST)
From: mlelstv@serpens.de
Reply-To: mlelstv@serpens.de
To: gnats-bugs@NetBSD.org
Subject: fstat cannot display descriptors of chrooted processes
X-Send-Pr-Version: 3.95
>Number: 55407
>Category: kern
>Synopsis: fstat cannot display descriptors of chrooted processes
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jun 22 13:20:00 +0000 2020
>Last-Modified: Wed Jun 24 10:10:01 +0000 2020
>Originator: Michael van Elst
>Release: NetBSD 9.0_STABLE
>Organization:
--
Michael van Elst
Internet: mlelstv@serpens.de
"A potential Snark may lurk in every tree."
>Environment:
System: NetBSD victory.netbsd.org 9.0_STABLE NetBSD 9.0_STABLE (GENERIC64) #0: Tue Mar 3 18:56:34 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm
Architecture: aarch64
Machine: evbarm
>Description:
fstat only prints errors for chrooted processes. E.g.
# fstat -p 25353
USER CMD PID FD MOUNT INUM MODE SZ|DV R/W
fstat: can't read filedesc at 0xffff009c4e849600 for pid 25353
The failure is present also when fstat is run within the same chroot.
procfs shows all descriptors.
This seems to be no problem on amd64, i386 or arm.
>How-To-Repeat:
Run fstat on a system using chrooted processes on aarch64.
>Fix:
>Audit-Trail:
From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/55407 CVS commit: src
Date: Wed, 24 Jun 2020 10:05:08 +0000
Module Name: src
Committed By: jruoho
Date: Wed Jun 24 10:05:08 UTC 2020
Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
Added Files:
src/tests/usr.bin/fstat: Makefile t_fstat.sh
Log Message:
Check that fstat(1) works (cf. PR kern/55407).
To generate a diff of this commit:
cvs rdiff -u -r1.847 -r1.848 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.165 -r1.166 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/fstat/Makefile \
src/tests/usr.bin/fstat/t_fstat.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.