gzip does not set uid and gid anymore (because of pledge)

2016-07-13 Thread Remi Locherer
Hi

After upgrading a firewall to 5.9 I noticed that the ownership of logfiles
is not as I specified in newsyslog.conf. After newsyslog compressed the files
the ownership is always root:wheel.

I figured out that this is because gzip can not chown anymore since it was
pledged. The below patch fixes this.

Remi


Index: main.c
===
RCS file: /cvs/src/usr.bin/compress/main.c,v
retrieving revision 1.90
diff -u -p -r1.90 main.c
--- main.c  17 Oct 2015 21:34:07 -  1.90
+++ main.c  14 Jul 2016 05:40:35 -
@@ -167,7 +167,7 @@ main(int argc, char *argv[])
char outfile[PATH_MAX], _infile[PATH_MAX], suffix[16];
int bits, ch, error, rc, cflag, oflag;
 
-   if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
+   if (pledge("stdio rpath wpath cpath fattr chown", NULL) == -1)
err(1, "pledge");
 
bits = cflag = oflag = 0;



Crash in softnet on SGI

2016-07-13 Thread Jesse Darrone
Hello All,

Synopsis: spurious crash in softnet
Category: kernel sgi
Environment:

  System: OpenBSD 6.0
  Details: OpenBSD 6.0-beta (GENERIC-IP22) #664: Sun Jul 10 00:31:39 MDT 2016
  Architecture: SGI (MIPS64)
  Machine: Challenge S R5000

Description:

Machine seems to hang at (seemingly) random intervals.  This has
occurred on several recent snapshots including 10-Jul. I have
reproduced the issue on multiple systems, so it doesn't seem to be a
hardware issue.  It may not be relevant but the machines are running
an MTU of 1454 on sq1.

How-To-Repeat:

Seems to repeat itself given enough time, but I've not been able to tie it
to any specific sequence of events.  I will say that the machine typically does
not run longer than a day (though it has on occasion).

Fix: Unknown


sq1: receive FIFO overflow

Trap cause = 4 Frame 0x91f439b0
Trap PC 0x888b2be0 RA 0x888b2dbc fault 0xd97d3b7057b9cf7b
pool_put+0xa8 
(1becdf323dc0c775,c30a2800,c30f87e0,888d2358)
 ra 0x888d18f0 sp 0x91f43b08,0
m_extfree+0x110
(1becdf323dc0c775,c30a2800,c30f87e0,888d2358)
ra 0x888d1fa0 sp 0x91f43ba2
m_free+0x138 
(1becdf323dc0c775,c30a2800,c30f87e0,888d2358)
 ra 0x888d20b0 sp 0x91f43bc8, 8
m_freem+0x28 
(1becdf323dc0c775,c30a2800,c30f87e0,888d2358)
 ra 0x88961b88 sp 0x91f43bf8, 2
in_arpinput+0x88
(1becdf323dc0c775,c30a2800,c30f87e0,888d2358)
ra 0x8892169c sp 0x91f43c4
ether_input+0x334
(1becdf323dc0c775,c30a2800,c30f87e0,888d2358)
ra 0x8891df38 sp 0x91f432
User-level: pid 34898
stopped on non ddb fault
Stopped at  pool_put+0xa8:  ld  v0,8(v1)

ddb> trace
pool_put+0xa8 (1becdf323dc0c775,c30a2800,c30f87e0,888d2
358)  ra 0x888d18f0 sp 0x91f43b08, sz 160
m_extfree+0x110 (1becdf323dc0c775,c30a2800,c30f87e0,888
d2358)  ra 0x888d1fa0 sp 0x91f43ba8, sz 32
m_free+0x138 (1becdf323dc0c775,c30a2800,c30f87e0,888d23
58)  ra 0x888d20b0 sp 0x91f43bc8, sz 48
m_freem+0x28 (1becdf323dc0c775,c30a2800,c30f87e0,888d23
58)  ra 0x88961b88 sp 0x91f43bf8, sz 32
in_arpinput+0x88 (1becdf323dc0c775,c30a2800,c30f87e0,88
8d2358)  ra 0x8892169c sp 0x91f43c18, sz 144
ether_input+0x334 (1becdf323dc0c775,c30a2800,c30f87e0,8
88d2358)  ra 0x8891df38 sp 0x91f43ca8, sz 112
if_input_process+0xf8 (1becdf323dc0c775,c30a2800,c30f87e0,f
fff888d2358)  ra 0x888a3968 sp 0x91f43d18, sz 80
taskq_thread+0xd0 (1becdf323dc0c775,c30a2800,c30f87e0,8
88d2358)  ra 0x88a797fc sp 0x91f43d68, sz 80
proc_trampoline+0x1c (1becdf323dc0c775,c30a2800,c30f87e0,ff
ff888d2358)  ra 0x0 sp 0x91f43db8, sz 0
User-level: pid 34898

ddb> ps
   TID   PPID   PGRPUID  S   FLAGS  WAIT  COMMAND
 74365  1  74365  0  30x100083  ttyin getty
  2436  1   2436  0  30x100098  poll  cron
 35314  58087  58087619  30x82  kqreadbandb
 40008  58087  58087619  30x82  kqreadssld
 55415  58087  58087619  30x82  kqreadresolver
 58087  1  58087619  30x90  kqreadircd
 82599  1  82599  0  30x80  selectsshd
 65889  67599  99686 83  30x100090  poll  ntpd
 67599  99686  99686 83  30x100090  poll  ntpd
 99686  1  99686  0  30x80  poll  ntpd
 97827  46866  46866 74  30x100090  bpf   pflogd
 46866  1  46866  0  30x80  netio pflogd
 94958  52247  52247 73  20x100090syslogd
 52247  1  52247  0  30x100080  netio syslogd
  8668  0  0  0  3 0x14200  pgzerozerothread
 60775  0  0  0  3 0x14200  aiodoned  aiodoned
 87475  0  0  0  3 0x14200  syncerupdate
 81321  0  0  0  3 0x14200  cleaner   cleaner
 75445  0  0  0  3 0x14200  reaperreaper
 67147  0  0  0  3 0x14200  pgdaemon  pagedaemon
 26226  0  0  0  3 0x14200  bored crynlk
 85686  0  0  0  3 0x14200  bored crypto
 71123  0  0  0  3 0x14200  pftm  pfpurge
*34898  0  0  0  7 0x14210softnet
 93986  0  0  0  3 0x14200  bored systqmp
 52845  0  0  0  3 0x14200  bored systq
 16345  0  0  0  3  0x40014200idle0
 69755  0  0  0  3 0x14200  kmalloc   kmthread
 1