NetBSD Problem Report #35276

From ggm@garlique.algebras.org  Tue Dec 19 04:56:27 2006
Return-Path: <ggm@garlique.algebras.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 8655463BA6D
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 19 Dec 2006 04:56:27 +0000 (UTC)
Message-Id: <20061219045625.1E0EE2B2A@garlique.algebras.org>
Date: Tue, 19 Dec 2006 14:56:25 +1000 (EST)
From: ggm@apnic.net
Reply-To: ggm@apnic.net
To: gnats-bugs@NetBSD.org
Subject: linux compatible /proc cannot readlink(): breaks java
X-Send-Pr-Version: 3.95

>Number:         35276
>Category:       kern
>Synopsis:       linux compatible /proc cannot readlink(): breaks java
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          analyzed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 19 05:00:00 +0000 2006
>Closed-Date:    
>Last-Modified:  Sun Jan 28 18:35:13 +0000 2007
>Originator:     George Michaelson
>Release:        NetBSD 4.99.6
>Organization:
George Michaelson                      email:           ggm@apnic.net
Senior Technical Officer, APNIC          sip:      ggm@voip.apnic.net
http://www.apnic.net                   phone:         +61 7 3858 3100
>Environment:


System: NetBSD garlique.algebras.org 4.99.6 NetBSD 4.99.6 (GGM_ACPI) #1: Tue Dec 19 13:18:58 EST 2006 ggm@garlique.algebras.org:/data/Build/obj/usr/src/sys/arch/i386/compile/GGM_ACPI i386
Architecture: i386
Machine: i386
>Description:
	java is crapping out with:

Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.

ktrace reveals it dies in:

  2232      1 java     CALL  readlink(0x80555e1,0xbfbfb730,0xfff)
  2232      1 java     NAMI  "/emul/linux/proc/self/exe"
  2232      1 java     NAMI  "/emul/linux"
  2232      1 java     NAMI  "/emul/linux/proc/self/exe"
  2232      1 java     RET   readlink 1
  2232      1 java     CALL  write(2,0x80558c0,0x21)
  2232      1 java     GIO   fd 2 wrote 33 bytes
       "Error: could not find libjava.so"

This is possibly because of recent (security?) changes to procfs.


>How-To-Repeat:
	run pkgsrc/lang/sun-jre15 java on current


>Fix:
	mm. good question. I'm not even sure it IS the procfs stuff, although
	it looks very suspicious if you back-check the dates of recent changes
	-sometime around November/December this happened, and there was a
	long overdue change applied apart from the security stuff.



>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: elad@netbsd.org
State-Changed-When: Tue, 19 Dec 2006 05:38:07 +0000
State-Changed-Why:
dup of 35226


From: George Michaelson <ggm@apnic.net>
To: gnats-bugs@NetBSD.org
Cc: elad@NetBSD.org, kern-bug-people@NetBSD.org,
	netbsd-bugs@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: kern/35276 (linux compatible /proc cannot readlink(): breaks
 java)
Date: Tue, 19 Dec 2006 16:15:48 +1000

 On Tue, 19 Dec 2006 05:38:08 +0000 (UTC)
 elad@NetBSD.org wrote:

 > Synopsis: linux compatible /proc cannot readlink(): breaks java
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: elad@netbsd.org
 > State-Changed-When: Tue, 19 Dec 2006 05:38:07 +0000
 > State-Changed-Why:
 > dup of 35226
 > 
 > 
 > 

 Thanks for the redirect to the originals. Sorry for a dup submit Elad.

 The bug in question says you have a fix, but some concerns.

 35226 refers to /cpuinfo. My instance was /proc/self/exe -thats the
 only call in java I can see. -I'd argue that pending a more complete
 fix, a reference under /proc to .../self/... should be permitted under
 any kauth/security checks: its the self-referential PID reference.


 -G

State-Changed-From-To: closed->open
State-Changed-By: elad@netbsd.org
State-Changed-When: Tue, 19 Dec 2006 10:36:27 +0000
State-Changed-Why:
I believe the analysis of the bug in this pr is wrong. 

the kauth(9) calls in procfs_vnops.c are either for PFSmem (irrelevant) or CANSEE calls (irrelevant unless curtain=1). since the call in procfs_ctl.c is also irrelevant, this leaves the single call in procfs_subr.c -- which I doubt is the reason for this problem. 


From: George Michaelson <ggm@apnic.net>
To: gnats-bugs@NetBSD.org
Cc: elad@NetBSD.org, kern-bug-people@NetBSD.org,
	netbsd-bugs@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: kern/35276 (linux compatible /proc cannot readlink(): breaks
 java)
Date: Mon, 8 Jan 2007 15:20:10 +1000

 Current as of 2007/01/08 I am able to run Java again.

 $ uname -a
 NetBSD garlique.algebras.org 4.99.7 NetBSD 4.99.7 (GGM_ACPI) #0: Mon Jan  8 13:46:38 EST 2007  ggm@garlique.algebras.org:/data/Build/obj/usr/src/sys/arch/i386/compile/GGM_ACPI i386
 $

 you can close any gnats PR related to me, on this issue.

 cheers

 -George

State-Changed-From-To: open->closed
State-Changed-By: elad@netbsd.org
State-Changed-When: Mon, 08 Jan 2007 11:01:09 +0000
State-Changed-Why:
fixed


State-Changed-From-To: closed->analyzed
State-Changed-By: elad@netbsd.org
State-Changed-When: Mon, 08 Jan 2007 11:09:35 +0000
State-Changed-Why:
underlying problem is still there says yamt@


From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org,
	gnats-admin@netbsd.org, elad@netbsd.org, ggm@apnic.net
Subject: Re: kern/35276 (linux compatible /proc cannot readlink(): breaks
 java)
Date: Mon,  8 Jan 2007 20:07:03 +0900 (JST)

 > Synopsis: linux compatible /proc cannot readlink(): breaks java
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: elad@netbsd.org
 > State-Changed-When: Mon, 08 Jan 2007 11:01:09 +0000
 > State-Changed-Why:
 > fixed

 i think the underlying problem is still there.
 procfs assumes the corresponding name cache entry is resident,
 but no one guarantees it.

 YAMAMOTO Takashi

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.