CVS: cvs.openbsd.org: src

2021-03-26 Thread David Gwynne
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2021/03/26 19:12:01

Modified files:
sys/dev/usb: if_ure.c 

Log message:
trim the FCS off Ethernet packets before sending them up the stack.

Jurjen Oskam on tech@ found that ure in a veb caused these extra
fcs bytes to be transmitted by other veb members. the extra bytes
aren't a problem usually because our network stack ignores them if
they're present, eg, the ip stack reads an ip packet length and
trims bytes in an mbuf if there's more. bridge(4) masked this problem
because it always parses IP packets going over the bridge and trims
them like the IP stack before pushing them out another port.

veb(4) generally just moves packets around based on the Ethernet
header, by default it doesn't look too deeply into packets, which
is why this issue popped out.

it is more correct for ure to just not pass the fcs bytes up.

ok jmatthew@ kevlo@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2021/03/26 17:34:50

Modified files:
sys/arch/macppc/dev: apm.c 

Log message:
Return EOPNOTSUPP for unsupported ioctls

Match what apm(4/macppc) says and make apmd(8) log an approiate warning when
unsupported power actions are requested.

Merge identical cases while here.

This syncs with the apm ioctl handlers on loongson and arm64.



CVS: cvs.openbsd.org: src

2021-03-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2021/03/26 17:29:21

Modified files:
sys/arch/arm64/stand/efiboot: efiboot.c 

Log message:
Fix "mach dtb" return code to avoid bogus boot

Bootloader command functions must return zero in case of failure,
returning 1 tells the bootloader to boot the currently set kernel iamge.

"machine dtb" is is the wrong way around so using it triggers a boot.

Fix this and print a brief usage (like other commands such as "hexdump" do)
while here.

Feedback OK patrick



CVS: cvs.openbsd.org: src

2021-03-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2021/03/26 16:55:48

Modified files:
sys/arch/arm64/dev: apm.c 

Log message:
Fix errno, merge ioctl cases

The EBADF error is always overwritten for the standby, suspend and
hibernate ioctls, only the mode ioctl has it right.

Merge the now identical casese while here.

OK patrick



CVS: cvs.openbsd.org: src

2021-03-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2021/03/26 16:54:41

Modified files:
sys/dev/fdt: cwfg.c 

Log message:
Flag sensors as invalid on bogus reads

Follow-up to the previous commit:

This driver continues to report stale hw.sensors values when reading
them fails, which can easily be observed on a Pinebook Pro after
plugging in the AC cable, causing the hw.sensors.cwfg0.raw0 (battery
remaining minutes) value to jump considerably one or two times before
stalling and becoming incoherent with the rest.

Flag sensors invalid upfront in apm's fashion and mark them OK iff they
yield valid values;   this is what other drivers such as rktemp(4) do,
but the consequence/intention of SENSOR_FINVALID is sysctl(8) and systat(8)
skipping such sensors (until AC gets plugged off again).

OK patrick



CVS: cvs.openbsd.org: src

2021-03-26 Thread Vitaliy Makkoveev
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2021/03/26 16:41:06

Modified files:
share/man/man9 : rtable_add.9 
sys/net: if.c rtable.c 

Log message:
Push kernel lock within rtable_add(9) and rework it to return 0 in the
case when requested table is already exists.

Except initialization time, route_output() and if_createrdomain() are the
only paths where we call rtable_add(9). We check requested table existence
by rtable_exists(9) and it's not the error condition if the table exists.
Otherwise we are trying to create requested table by rtable_add(9). Those
paths are kernel locked so concurrent thread can't create requested table
just after rtable_exists(9) check. Also rtable_add(9) has internal
rtable_exists(9) check and in this case the table existence assumed as
EEXIST error. This error path is never reached.

We are going to unlock PF_ROUTE sockets. This means route_output() will
not be serialized with if_createrdomain() and concurrent thread could
create requested table. Table existence check and creation should be
serialized and it makes sense to do this within rtable_add(9). This time
kernel lock is used for this so it pushed down to rtable_add(9). The
internal rtable_exists(9) check was modified and table existence is not
error now.

Since the external rtable_exists(9) check is useless it was removed from
if_createrdomain(). It still exists in route_output() path because the
logic is more complicated here.

ok mpi@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Vitaliy Makkoveev
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2021/03/26 16:40:08

Modified files:
sys/net: rtsock.c 

Log message:
Push kernel lock down to rt_setsource() to make `ifa' dereference safe.
Netlock doesn't make sense here because ifa_ifwithaddr() holds kernel
lock while performs lists walkthrough.

This was made to decrease the future diff for PF_ROUTE sockets
unlocking. This time kernel lock is still held while we perform
rt_setsource().

ok mpi@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2021/03/26 16:35:17

Modified files:
regress/lib/libssl/tlsfuzzer: tlsfuzzer.py 

Log message:
Add test-sig-algs-renegotiation-resumption.py

This test currently fails but may soon be fixed.



CVS: cvs.openbsd.org: src

2021-03-26 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2021/03/26 15:17:10

Modified files:
sys/dev/dt : dt_dev.c 

Log message:
Initialize error variable in dtread().
OK mpi@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2021/03/26 13:00:21

Modified files:
sys/net: if_mpe.c if_mpw.c if_mpip.c 

Log message:
Only install route with label, fix route leak on destroy

ifconfig mp* mplslabel N" validates the label both in ifconfig(8) and each
driver's ioctl handler, but there is one case where all drivers install
a route without looking at the label at all.

SIOCSLIFPHYRTABLE in all three drivers just validates the rdomain and sets
the label to itself (0) such that the route is (re)installed accordingly.

None of the driver's helper functions dealing with labels and routes
validate labels themselves but instead expect the callees, e.g. the ioctl
handler to do so.

That means we can install routes for the explicit NULL label in non-default
routing tables but are never able to clean them up without reboot.

Fix this by adding the inverse of mp*_clone_destroy()'s label check to the
routines installing the MPLS route to avoid bogus ones in the first place.

OK claudio



CVS: cvs.openbsd.org: xenocara

2021-03-26 Thread Matthieu Herrb
CVSROOT:/cvs
Module name:xenocara
Changes by: matth...@cvs.openbsd.org2021/03/26 12:24:28

Modified files:
.  : MODULES 3RDPARTY 

Log message:
update



CVS: cvs.openbsd.org: xenocara

2021-03-26 Thread Matthieu Herrb
CVSROOT:/cvs
Module name:xenocara
Changes by: matth...@cvs.openbsd.org2021/03/26 12:23:04

Modified files:
driver/xf86-video-r128: ChangeLog Makefile.in aclocal.m4 
configure configure.ac 
driver/xf86-video-r128/man: Makefile.in r128.man 
driver/xf86-video-r128/src: Makefile.am Makefile.in compat-api.h 
r128.h r128_accel.c r128_cursor.c 
r128_dri.c r128_dripriv.h 
r128_driver.c r128_exa.c 
r128_exa_render.c r128_probe.c 
r128_probe.h r128_reg.h r128_video.c 
Added files:
driver/xf86-video-r128/src: r128_crtc.c r128_output.c r128_rop.h 
Removed files:
driver/xf86-video-r128/src: r128_dga.c 

Log message:
Update to xf86-video-r128 6.12.0



CVS: cvs.openbsd.org: src

2021-03-26 Thread Theo de Raadt
CVSROOT:/cvs
Module name:src
Changes by: dera...@cvs.openbsd.org 2021/03/26 11:40:03

Modified files:
usr.sbin/vmd   : virtio.c 

Log message:
inspect all the packets to see if they are dhcp, not just the first one
in a ring bundle.
ok florian



CVS: cvs.openbsd.org: src

2021-03-26 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2021/03/26 10:28:15

Modified files:
usr.sbin/vmctl : main.c 

Log message:
Simplify argument parsing of vmctl stop

The previous argument parsing logic had at least three bugs:
a copy-paste error led to an off-by-one and a printf "%s" NULL,
as reported by Preben Guldberg.  A previous commit led to a dead
else branch and a use of uninitialized.  This can all be avoided
by reworking the logic so as to be readable.

Prompted by a diff from Preben

ok dv



CVS: cvs.openbsd.org: src

2021-03-26 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2021/03/26 10:03:29

Modified files:
usr.sbin/rpki-client: main.c 

Log message:
Compare filepath with strcmp() and not strcasecmp(). The URI in RPKI are
case sensitive.
OK tb@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Mark Lumsden
CVSROOT:/cvs
Module name:src
Changes by: l...@cvs.openbsd.org2021/03/26 09:02:10

Modified files:
usr.bin/mg : buffer.c mg.1 

Log message:
Invert the 'R' indicator which seems rather unintuitive at the moment,
currently a '*' next to a file's name indicates it is writable. With
this diff it now means it is read-only. Also make the active buffer
indicator more visible:'.'->'>'.



CVS: cvs.openbsd.org: src

2021-03-26 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2021/03/26 07:46:25

Modified files:
usr.bin/openssl: x509.c 

Log message:
Sort header files and wrap long lines in x509.c



CVS: cvs.openbsd.org: src

2021-03-26 Thread Martin Pieuchot
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2021/03/26 07:40:05

Modified files:
sys/uvm: uvm_amap.c uvm_anon.c uvm_aobj.c uvm_fault.c 
 uvm_glue.c uvm_km.c uvm_map.c uvm_mmap.c 
 uvm_page.c uvm_page.h uvm_pager.c uvm_swap.c 
 uvm_vnode.c 

Log message:
Remove parenthesis around return value to reduce the diff with NetBSD.

No functional change.

ok mlarkin@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Mark Lumsden
CVSROOT:/cvs
Module name:src
Changes by: l...@cvs.openbsd.org2021/03/26 06:31:37

Modified files:
usr.bin/mg : interpreter.c 

Log message:
Add 'get-environment-variable', in a fashion:

(define curdir(get-environment-variable CURDIR))
(insert curdir)

Should now print the value of the environment variable CURDIR's value,
or error if it is not set.



CVS: cvs.openbsd.org: src

2021-03-26 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2021/03/26 04:18:55

Modified files:
sys/net80211   : ieee80211_input.c 

Log message:
Fix wrong sequence number wrap in ieee80211_recv_auth().
IEEE 802.11 sequence numbers wrap around at 0xfff, not 0x.
ok phessler@ kevlo@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2021/03/26 04:01:51

Modified files:
usr.sbin/rpki-client: main.c 

Log message:
Rewrite poll loop a bit. Put the various message queues into an array
with the same order as the pollfds. This way simple for loops can be
used to setup and handle all cases but POLLIN.
OK tb@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Mark Lumsden
CVSROOT:/cvs
Module name:src
Changes by: l...@cvs.openbsd.org2021/03/26 02:27:49

Modified files:
usr.bin/mg : interpreter.c 

Log message:
Change the regex for define names. Make more characters available.
Keep the same regex for mg function names. Though perhaps for
user-defined functions other characters could be ok



CVS: cvs.openbsd.org: src

2021-03-26 Thread Jan Klemkow
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2021/03/26 02:17:23

Modified files:
sys/dev/pci: pcidevs_data.h 

Log message:
regen



CVS: cvs.openbsd.org: src

2021-03-26 Thread Jan Klemkow
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2021/03/26 02:02:34

Modified files:
sys/dev/pci: if_ixl.c 

Log message:
Add PCI ID for Intel X710 10G SFP+ NIC

ok patrick@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Jan Klemkow
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2021/03/26 02:00:02

Modified files:
sys/dev/pci: pcidevs.h 

Log message:
regen



CVS: cvs.openbsd.org: src

2021-03-26 Thread Jan Klemkow
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2021/03/26 01:58:44

Modified files:
sys/dev/pci: pcidevs 

Log message:
Add missing PCI ID for Intel X710 SFP+ NIC

ok patrick@



CVS: cvs.openbsd.org: src

2021-03-26 Thread Mark Lumsden
CVSROOT:/cvs
Module name:src
Changes by: l...@cvs.openbsd.org2021/03/26 01:25:23

Modified files:
usr.bin/mg : interpreter.c 

Log message:
Change two more bool counters to pointer NULL checks.