NetBSD Problem Report #54914

From www@netbsd.org  Sat Feb  1 12:55:49 2020
Return-Path: <www@netbsd.org>
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 E71B77A18A
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  1 Feb 2020 12:55:49 +0000 (UTC)
Message-Id: <20200201125549.2EA6D7A1DD@mollari.NetBSD.org>
Date: Sat,  1 Feb 2020 12:55:49 +0000 (UTC)
From: n54@gmx.com
Reply-To: n54@gmx.com
To: gnats-bugs@NetBSD.org
Subject: fcntl(F_GETPATH) is broken in chroot
X-Send-Pr-Version: www-1.0

>Number:         54914
>Category:       kern
>Synopsis:       fcntl(F_GETPATH) is broken for files in null mounts (layerfs)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 01 13:00:01 +0000 2020
>Last-Modified:  Mon Aug 17 21:25:29 +0000 2020
>Originator:     Kamil Rytarowski
>Release:        NetBSD 9.99.44
>Organization:
TNF
>Environment:
NetBSD chieftec 9.99.44 NetBSD 9.99.44 (GENERIC) #0: Fri Jan 31 19:26:07 CET 2020  root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64

>Description:
kernel/t_fcntl (76/849): 1 test cases
    getpath: [0.001926s] Failed: /usr/src/tests/kernel/t_fcntl.c:76: Can't get path for `/dev/zero' (No such file or directory)
[0.002009s]


>How-To-Repeat:
Enter chroot.

Run ATF tests in kernel/t_fcntl.
>Fix:
N/A

>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: kern/54914: fcntl(F_GETPATH) is broken in chroot
Date: Sat, 1 Feb 2020 11:35:04 -0500

 --Apple-Mail=_84B4B089-C89E-4424-9282-18D837E09ADA
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii

 Did you make /dev/zero (and the other files the test needs) in the chroot?

 christos



 --Apple-Mail=_84B4B089-C89E-4424-9282-18D837E09ADA
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP

 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org

 iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCXjWouAAKCRBxESqxbLM7
 Oi6JAKCKaZ/mi8Nu0a/DulZG8GOP7kpFhwCgzbfkKfYxBFeDP82O3maBChsllDw=
 =tYlm
 -----END PGP SIGNATURE-----

 --Apple-Mail=_84B4B089-C89E-4424-9282-18D837E09ADA--

From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@netbsd.org, Santhosh Raju <fox@netbsd.org>
Cc: 
Subject: Re: kern/54914: fcntl(F_GETPATH) is broken in chroot
Date: Mon, 10 Feb 2020 08:54:04 +0100

 On 01.02.2020 17:40, Christos Zoulas wrote:
 > The following reply was made to PR kern/54914; it has been noted by GNAT=
 S.
 >
 > From: Christos Zoulas <christos@zoulas.com>
 > To: gnats-bugs@netbsd.org
 > Cc: kern-bug-people@netbsd.org,
 >  gnats-admin@netbsd.org,
 >  netbsd-bugs@netbsd.org
 > Subject: Re: kern/54914: fcntl(F_GETPATH) is broken in chroot
 > Date: Sat, 1 Feb 2020 11:35:04 -0500
 >
 >  --Apple-Mail=3D_84B4B089-C89E-4424-9282-18D837E09ADA
 >  Content-Transfer-Encoding: 7bit
 >  Content-Type: text/plain;
 >  	charset=3Dus-ascii
 >
 >  Did you make /dev/zero (and the other files the test needs) in the chro=
 ot?
 >
 >  christos
 >
 >

 Yes.

 Steps to reproduce:

 mount -t null /dev /path/to/destdir/dev
 mount -t null /dev/pts /path/to/destdir/dev/pts
 mount -t null /tmp /path/to/destdir/tmp
 chroot /path/to/destdir/
 cd /usr/tests
 atf-run

 Reproduced also by fox@:

 tc-end: 1581320984.989260, getpath, failed,

 /home/fox/projects/netbsd/src-wip/tests/kernel/t_fcntl.c:76: Can't get
 path for
                      `/dev/zero' (No such file or directory)

 "fox: I do see a /dev/zero in the chrooted environment"


This is not an issue with chroot. It works fine in the chroot if
you MAKEDEV all in /dev. The brokenneness is that the DNLC does
not understand layers, so passing it a layered vnode does not find
things.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.