NetBSD Problem Report #56993

From martin@duskware.de  Sat Sep  3 06:15:32 2022
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 985131A923B
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  3 Sep 2022 06:15:32 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: xauth(1) broken
X-Send-Pr-Version: 3.95

>Number:         56993
>Category:       xsrc
>Synopsis:       xauth(1) broken
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    xsrc-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 03 06:20:00 +0000 2022
>Closed-Date:    Sat Sep 03 06:27:19 +0000 2022
>Last-Modified:  Sat Sep 03 06:30:01 +0000 2022
>Originator:     Martin Husemann
>Release:        NetBSD 9.99.99
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD plug.duskware.de 9.99.99 NetBSD 9.99.99 (GENERIC64) #337: Fri Sep 2 11:30:06 CEST 2022 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/evbarm/compile/GENERIC64 evbarm
Architecture: aarch64
Machine: evbarm
>Description:

I updated this machine to -current yesterday and now xauth(1) misbehaves
and can't configure any authentication.

If I just invoke "xauth" it hangs indefinitely. Ktrace shows:

  1734   1734 xauth    CALL  __stat50(0xfffffff24650,0xfffffff245b8)
  1734   1734 xauth    NAMI  "/home/martin/.Xauthority-c"
  1734   1734 xauth    RET   __stat50 -1 errno 2 No such file or directory
  1734   1734 xauth    CALL  open(0xfffffff24650,0xa01,0x180)
  1734   1734 xauth    NAMI  "/home/martin/.Xauthority-c"
  1734   1734 xauth    RET   open -1 errno 13 Permission denied
  1734   1734 xauth    CALL  __nanosleep50(0xfffffff24550,0xfffffff24560)
  1734   1734 xauth    RET   __nanosleep50 0
  1734   1734 xauth    CALL  open(0xfffffff24650,0xa01,0x180)
  1734   1734 xauth    NAMI  "/home/martin/.Xauthority-c"
  1734   1734 xauth    RET   open -1 errno 13 Permission denied
  1734   1734 xauth    CALL  __nanosleep50(0xfffffff24550,0xfffffff24560)
  1734   1734 xauth    RET   __nanosleep50 0
  1734   1734 xauth    CALL  open(0xfffffff24650,0xa01,0x180)
  1734   1734 xauth    NAMI  "/home/martin/.Xauthority-c"
  1734   1734 xauth    RET   open -1 errno 13 Permission denied
  1734   1734 xauth    CALL  __nanosleep50(0xfffffff24550,0xfffffff24560)

<--- here I SIGINTed it

  1734   1734 xauth    RET   __nanosleep50 -1 errno 4 Interrupted system call
  1734   1734 xauth    PSIG  SIGINT caught handler=0xfc27760 mask=(): code=SI_NOINFO
  1734   1734 xauth    CALL  umask(0)
  1734   1734 xauth    RET   umask 2
  1734   1734 xauth    CALL  exit(0)

My homedir has the following .X* files:

-rw-rw-r--  1 martin  users    45 Oct  5  2003 .XSM-Default
-rw-------  1 martin  users   453 Sep  2 11:13 .Xauthority
-rw-r--r--  1 martin  users  1631 Feb 18  2000 .Xresources


>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sat, 03 Sep 2022 06:27:19 +0000
State-Changed-Why:
local dir permission issue


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/56993: xauth(1) broken
Date: Sat, 3 Sep 2022 08:26:33 +0200

 Gdb says:

 (gdb) bt -full
 #0  0x0000f89b75c2c328 in _sys___nanosleep50 () from /usr/lib/libc.so.12
 No symbol table info available.
 #1  0x0000f89b75c9bc2c in _sleep (seconds=seconds@entry=2) at /work/src/lib/libc/gen/sleep.c:53
         rqt = {tv_sec = 2, tv_nsec = 0}
         rmt = {tv_sec = 1, tv_nsec = 966034275}
 #2  0x0000f89b7628109c in XauLockAuth (file_name=file_name@entry=0xf89b76275000 "/home/martin/.Xauthority", retries=<optimized out>, retries@entry=10, 
     timeout=timeout@entry=2, dead=600) at /work/xsrc/external/mit/libXau/dist/AuLock.c:104
         creat_name = "/home/martin/.Xauthority-c\000u\233\370\000\000\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 15 times>, "\001", '\000' <repeats 23 times>...
         link_name = "/home/martin/.Xauthority-l\000v\233\370\000\000PZ\205\377\377\377\000\000\000\000\000\000\000\000\000\000K\231\300u\233\370\000\000 \\\205\377\377\377\000\000\001", '\000' <repeats 15 times>, "\240[\205\377\377\377\000\000\000\000\000\000\000\000\000\000\200w)v\233\370\000\000\250[\205\377\377\377\000\000\250[\205\377\377\377\000\000\304S\352\357\377\377\000\000\000\244)v\233\370\000\000\000\000\000\000\000\000\000\000O\rN\000\000\000\000\000\200\\\205\377\377\377\000\000\001", '\000' <repeats 16 times>, "\\\205\377\377\377\000\000\000\000\000\000\000\000\000\000`r)v\233\370\000\000"...
         statb = {st_dev = 0, st_mode = 1, st_ino = 0, st_nlink = 1, st_uid = 0, st_gid = 0, st_rdev = 1, st_atim = {tv_sec = 0, tv_nsec = 1}, st_mtim = {tv_sec = 0, 
             tv_nsec = 1}, st_ctim = {tv_sec = 0, tv_nsec = 1}, st_birthtim = {tv_sec = 0, tv_nsec = 1}, st_size = 0, st_blocks = 1, st_blksize = 0, st_flags = 0, st_gen = 1, 
           st_spare = {0, 0}}
         now = <optimized out>
         creat_fd = <optimized out>
 #3  0x00000000004e7150 in auth_initialize (authfilename=0xf89b76275000 "/home/martin/.Xauthority") at /work/xsrc/external/mit/xauth/dist/process.c:753
         n = <optimized out>
         head = 0x4fd2e0 <defcmds>
         tail = 0x4e96f0 <main+512>
         authfp = <optimized out>
         exists = <optimized out>
 #4  0x00000000004e9644 in main (argc=<optimized out>, argv=<optimized out>) at /work/xsrc/external/mit/xauth/dist/xauth.c:167
         i = <optimized out>
         sourcename = <optimized out>
         arglist = <optimized out>
         nargs = <optimized out>
         status = <optimized out>

 .... and the st_uid = 0 was the hint I needed.

 Ooops, operator mishap, nothing to see here...

 Martin

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