Subject: bin/32360: recent changes breaks systrace fswrite
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <jeff@delnoch.net>
List: netbsd-bugs
Date: 12/22/2005 16:50:01
>Number:         32360
>Category:       bin
>Synopsis:       recent changes breaks systrace fswrite
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 22 16:50:00 +0000 2005
>Originator:     Jeff Ito
>Release:        NetBSD 3.99.14
>Organization:
>Environment:
NetBSD 3.99.14 (LAB) #0: Tue Dec 20 09:41:28 EST 2005
>Description:
Recent changes, (somewhere from May onward, more likely ~August onward but i dont have the binary timestamp to prove it) have caused systrace to generate errors.

where:

netbsd-fswrite: filename eq "/var/db/ntp.drift.TEMP" then permit

used to work, I am now getting:

systrace: deny user: ntpd, prog: /usr/sbin/ntpd, pid: 442(0)[791], policy: /usr/sbin/ntpd, filters: 98, syscall: netbsd-fswrite(5), fi
lename: /<non-existent filename>: /var/db/ntp.drift.TEMP

A simple test is

old behavior:
> systrace -A touch bah
>

new behavior:
> systrace -A touch bah
touch: bah: Permission denied

A look at ktrace indicates it may be related to __stat13 vs __stat30

old:
 11053 touch    CALL  __stat13(0xbfbfe9fe,0xbfbfe844)
 11053 touch    NAMI  "/home/jeff/bah"
 11053 touch    RET   __stat13 -1 errno 2 No such file or directory
 11053 touch    CALL  open(0xbfbfe9fe,0x201,0x1b6)
 11053 touch    NAMI  "/home/jeff/bah"
 11053 touch    RET   open 3
 11053 touch    CALL  __fstat13(3,0xbfbfe844)
 11053 touch    RET   __fstat13 0


new:
  9742      1 touch    CALL  __stat30(0xbfbfe976,0xbfbfe7a4)
  9742      1 touch    NAMI  "bah"
  9742      1 touch    RET   __stat30 -1 errno 2 No such file or directory
  9742      1 touch    CALL  open(0xbfbfe976,0x201,0x1b6)
  9742      1 touch    NAMI  "/<non-existent filename>: bah"
  9742      1 touch    RET   open -1 errno 13 Permission denied




>How-To-Repeat:

> systrace -A touch bah
>Fix:
unknown