CVS: cvs.openbsd.org: src

2024-07-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/22 03:44:37

Modified files:
bin/ps : ps.1 

Log message:
Sync with proc.h: s/PS_STOPPED/PS_STOPPING/
OK kettenis@



CVS: cvs.openbsd.org: src

2024-07-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/22 03:43:48

Modified files:
sys/kern   : kern_sig.c 
sys/sys: proc.h 

Log message:
Rename PS_STOPPED to PS_STOPPING. I want to use PS_STOPPED to indicate
that a process has been stopped so make room for that.
OK kettenis@



CVS: cvs.openbsd.org: src

2024-07-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/22 02:18:53

Modified files:
sys/kern   : kern_exit.c 

Log message:
Switch proc_finish_wait() to use the process as argument instead of its
ps_mainproc. dowait6() needs to stop using ps_mainproc and this is the
first step.
OK guenther@



CVS: cvs.openbsd.org: src

2024-07-17 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/17 07:29:05

Modified files:
lib/libc/sys   : getrusage.2 

Log message:
Be clear that RUSAGE_CHILDREN only works for terminated children that have
been waited for. If you SIG_IGN SIGCHLD or don't call any of the wait
functions then RUSAGE_CHILDREN wont report anything.
OK deraadt@ millert@



CVS: cvs.openbsd.org: src

2024-07-17 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/17 03:54:15

Modified files:
sys/sys: proc.h 

Log message:
Sync struct proc P_BITS with reality.

Remove "\027XX" (old systrace flag) and "\035SOFTDEP".
OK jsg@



CVS: cvs.openbsd.org: src

2024-07-12 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/12 03:27:32

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

Log message:
Improve duplicate detection and repo_move_valid

Only trigger a duplicate error if a valid filepath is revisted. It is
possible that a bad CA references somebody else's files and if that
happens first it would block the valid access.

To make this work, pass the ok flag to filepath_add() and only set the
talmask bit if the file was ok. Since we need to do the duplicate check
before processing the entity introduce filepath_valid() which checks
if the path is in the tree and has its talmask bit set.

In repo_move_valid() handle conflicts more gracefully. When both a valid
and temporary file are present assume that one of the files was never ok
(talmask == 0) and silently remove that file from the filepath tree.

OK tb@



CVS: cvs.openbsd.org: src

2024-07-12 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/12 02:54:48

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

Log message:
Rename the variable c to ok. It returns if the file failed to parse or not.
We need to pass this to filepath_add so lets use a better name.
OK tb@



CVS: cvs.openbsd.org: src

2024-07-10 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/10 06:28:46

Modified files:
sys/kern   : kern_sig.c 

Log message:
Kill the runfast and run label and inline those bits. No functional change.
OK mpi@



CVS: cvs.openbsd.org: src

2024-07-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/09 09:20:15

Modified files:
sys/kern   : kern_resource.c 

Log message:
Remove splassert() for now since IPL_STATCLOCK is MD and not all archs have it.
Noticed by bluhm@ on octeon



CVS: cvs.openbsd.org: src

2024-07-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/09 03:22:50

Modified files:
sys/kern   : kern_sig.c 

Log message:
Reshuffle the switch cases in ptsignal and single_thread_set to be
in the order needed for future changes. No functional change.
OK mpi@



CVS: cvs.openbsd.org: src

2024-07-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/09 02:44:36

Modified files:
sys/kern   : kern_sched.c 

Log message:
In sched_toidle() only call the TRACEPOINT if curproc is set.
sched_toidle() is called by cpu_hatch() to start APs and then curproc
may be NULL.
OK mpi@



CVS: cvs.openbsd.org: src

2024-07-08 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/08 07:18:26

Modified files:
lib/libkvm : kvm_proc2.c 

Log message:
Adjust code since FILL_KPROC() got another argument since struct tusage
accounting was modified.
OK dlg@ jca@



CVS: cvs.openbsd.org: src

2024-07-08 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/08 07:17:12

Modified files:
sys/kern   : kern_acct.c kern_clock.c kern_exec.c 
 kern_exit.c kern_proc.c kern_resource.c 
 kern_sched.c kern_sysctl.c kern_time.c 
 sched_bsd.c tty.c 
sys/sys: proc.h resourcevar.h sysctl.h 

Log message:
Rework per proc and per process time usage accounting

For procs (threads) the accounting happens now lockless by curproc using
a generation counter. Callers need to use tu_enter() and tu_leave() for this.
To read the proc p_tu struct tuagg_get_proc() should be used. It ensures
that the values read is consistent.

For processes only the time of exited threads is accumulated in ps_tu and
to get the proper process time usage tuagg_get_process() needs to be called.
tuagg_get_process() will sum up all procs p_tu plus the ps_tu.

This removes another SCHED_LOCK() dependency. Adjust the code in
exit1() and exit2() to correctly account for the full run time.
For this adjust sched_exit() to do the runtime accounting like it is done
in mi_switch().

OK jca@ dlg@



CVS: cvs.openbsd.org: src

2024-07-08 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/07/08 03:15:05

Modified files:
sys/kern   : kern_exit.c 

Log message:
Fix comment for exit2() this code is called by sched_idle() not cpu_exit().
The note can be removed but add a comment that since this is called from
the idle process exit2() is not allowed to sleep.
OK jca@



CVS: cvs.openbsd.org: www

2024-06-26 Thread Claudio Jeker
CVSROOT:/cvs
Module name:www
Changes by: clau...@cvs.openbsd.org 2024/06/26 13:13:36

Modified files:
build  : Makefile 
build/mirrors  : openbgpd-ftp.html.head 
openbgpd   : ftp.html 

Log message:
OpenBGPD 8.5 release



CVS: cvs.openbsd.org: src

2024-06-26 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/26 02:28:45

Modified files:
usr.sbin/bgpd  : version.h 

Log message:
Bump version



CVS: cvs.openbsd.org: src

2024-06-25 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/25 07:21:18

Modified files:
usr.sbin/bgpd  : rde_prefix.c 

Log message:
When filling prefixes with pt_writebuf() keep 2 bytes reserved in the
withdraw case. Those bytes are needed for the attribute length field.
Without this withdraw messages can become overfull and are dropped
without notice.

Problem found and fix tested by denis@
OK denis@ tb@



CVS: cvs.openbsd.org: src

2024-06-19 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/19 07:13:25

Modified files:
usr.sbin/acme-client: main.c util.c 

Log message:
Kill the SIGPIPE signal handler which is installed around write opertations.
Instead just SIG_IGN SIGPIPE in main.c for all of acme-client.
More work to be done here but at least this distraction is gone.
OK florian@ deraadt@ op@



CVS: cvs.openbsd.org: src

2024-06-14 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/14 04:17:05

Modified files:
sys/dev: rnd.c 

Log message:
Make arc4random() depend on less subsystems by decoupling extract_entropy()
from the enqueue_randomness() logic.

Add add_event_data() which just enqueues some data into the event buffer
which can be used by extract_entropy(). On top of this remove the
timeout_del() call in dequeue_randomness() it does serve any meaningful
reason.
OK kettenis@ deraadt@ mpi@



CVS: cvs.openbsd.org: src

2024-06-13 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/13 00:47:13

Modified files:
sys/arch/sparc64/include: cpu.h 

Log message:
Enable uvm percpu caches on sparc64.
OK kettenis@ jca@ mpi@



CVS: cvs.openbsd.org: src

2024-06-10 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/10 06:51:25

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
In get_alternate_addr() consider sessions to IPv6 link-local addresses
as connected (they are so by definition).

Issue reported by Jason Tubnor ( Jason.Tubnor (at) lchs.com.au )
OK tb@



CVS: cvs.openbsd.org: src

2024-06-07 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/07 02:22:53

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

Log message:
Download new TA files into a temporary place (.ta/) so that the parser
can decide which of the two files to use.
With and OK tb@



CVS: cvs.openbsd.org: src

2024-06-04 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/04 02:26:11

Modified files:
sys/dev: rnd.c 

Log message:
In dequeue_randomness() use an atomic instruction to increase the
rnd_event_cons. This way even concurrent calls to dequeue_randomness()
will use some different events.
OK deraadt@ djm@



CVS: cvs.openbsd.org: src

2024-06-03 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/03 08:34:19

Modified files:
sys/kern   : subr_witness.c 

Log message:
Remove lock_class_sched_lock from lock_classes since the corresponding
entry in enum lock_class_index was removed in sys/_lock.h
You get fireworks if the lock_classes array and enum lock_class_index
get out of sync.



CVS: cvs.openbsd.org: src

2024-06-03 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/03 06:48:25

Modified files:
sys/dev/pci/drm: drm_linux.c 
sys/sys: sched.h 
sys/kern   : kern_exit.c kern_fork.c kern_resource.c 
 kern_sched.c kern_sig.c kern_synch.c 
 sched_bsd.c sys_process.c 

Log message:
Remove the now unsued s argument to SCHED_LOCK and SCHED_UNLOCK.

The SPL level is not tacked by the mutex and we no longer need to track
this in the callers.
OK miod@ mlarkin@ tb@ jca@



CVS: cvs.openbsd.org: src

2024-06-03 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/06/03 06:46:59

Modified files:
sys/sys: _lock.h 

Log message:
There is no more LO_CLASS_SCHED_LOCK lock class.
OK miod@ mlarkin@ tb@ jca@



CVS: cvs.openbsd.org: src

2024-05-30 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/30 06:33:15

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

Log message:
Properly setup the fts_state in the FTS_D case.

At fts_level 1 the state needs to be fully reset since we most probably
exited from a directory at level 1 and entered a new dir at level 1.
Without this empty directories remained since the fts_state.type
was wrong for those entries.
Noticed by job@, OK tb@



CVS: cvs.openbsd.org: src

2024-05-30 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/30 02:29:30

Modified files:
usr.sbin/bgpd  : rde_update.c 

Log message:
Fix copy-paste error in last commit. Fixes lladdr and l3vpn regress.
Noticed by anton@



CVS: cvs.openbsd.org: src

2024-05-29 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/29 12:55:45

Modified files:
sys/kern   : kern_fork.c kern_lock.c sched_bsd.c 
sys/sys: sched.h 

Log message:
Convert SCHED_LOCK from a recursive kernel lock to a mutex.

Over the last weeks the last SCHED_LOCK recursion was removed so this
is now possible and will allow to split up the SCHED_LOCK in a upcoming
step.

Instead of implementing an MP and SP version of SCHED_LOCK this just
always uses the mutex implementation.
While this makes the local s argument unused (the spl is now tracked by
the mutex itself) it is still there to keep this diff minimal.

Tested by many.
OK jca@ mpi@



CVS: cvs.openbsd.org: src

2024-05-29 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/29 04:41:12

Modified files:
usr.sbin/bgpd  : rde_update.c 

Log message:
Handle IPvX only interfaces with IPvY sessions more gracefully.

In up_get_nexthop() check that the local_vX_addr is actually valid
before using it. In the UPDATE generation functions check that the
nexthop is valid before adding it and fail hard if it does not exist.
You can't announce an IPv4 prefix/gateway over an IPv6 only link.
OK henning@ sthen@



CVS: cvs.openbsd.org: src

2024-05-29 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/29 04:38:24

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
Only fall back to the default IPv4 unicast mode if there was no MP
capability neither from our side not the remote end.

Also track unknown AFI/SAFI combos for the remote end in AID_UNSPEC
this way even unknown combos will prevent a fall back.
OK henning@ sthen@



CVS: cvs.openbsd.org: src

2024-05-29 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/29 04:36:32

Modified files:
usr.sbin/bgpd  : rde.h 

Log message:
Remove nexthop_compare() prototype.
OK henning@ sthen@



CVS: cvs.openbsd.org: src

2024-05-29 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/29 04:34:56

Modified files:
usr.sbin/bgpd  : rde_rib.c 

Log message:
Rename nexthop_compare to nexthop_cmp and make it static inline.
OK henning@ sthen@



CVS: cvs.openbsd.org: src

2024-05-29 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/29 04:34:07

Modified files:
usr.sbin/bgpd  : util.c 

Log message:
Introduce a ring buffer for log_sockaddr() this way log_addr() can be
used more then once in a log message (e.g. log_peer_warnx + log_addr.
OK henning@ sthen@



CVS: cvs.openbsd.org: src

2024-05-28 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/28 09:16:45

Modified files:
sys/arch/arm64/arm64: pmap.c 

Log message:
Rework the pmap ASID handling to not require the SCHED_LOCK

The ASID lookup code already uses its own mutex (pmap_asid_mtx)
and this mutex is enough to ensure that pmap_rollover_asid()
is safe. Now only the generation number check in pmap_setttb()
is done without the lock but the update of the pmap_asid_gen
is now atomic so using READ_ONCE there is enough.

OK kettenis@ mpi@



CVS: cvs.openbsd.org: src

2024-05-28 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/28 03:27:54

Modified files:
sys/arch/m88k/include: cpu.h 
sys/arch/m88k/m88k: m88k_machdep.c 

Log message:
cpu_emergency_disable() was only used by mvme88k and can be removed now.

This removes one of the SCHED_LOCK usages in arch.
OK miod@



CVS: cvs.openbsd.org: src

2024-05-28 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/28 03:19:04

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

Log message:
Remove the bcmmbox_write(BCMMBOX_CHANPM, ...) call in bcmmbox_attach().

This command locks up my RaspberryPi 4 while it seems to have no effect
for other devices. First of all u-boot will already enable power for us
plus it seems that more is needed than just this write to be really
effective. Why my rpi4 locks up is still unclear but this is now a
pure u-boot issue.

Tested by kettenis@ on his working rpi4 and rpi2
OK kettenis@



CVS: cvs.openbsd.org: src

2024-05-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/22 06:33:07

Modified files:
usr.sbin/fw_update: patterns.c 

Log message:
Add pattern for mwx(4) firmware.
OK phessler@ martijn@



CVS: cvs.openbsd.org: src

2024-05-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/22 03:24:11

Modified files:
sys/kern   : kern_synch.c 

Log message:
When clearing the wait channel also clear the wait message.

There is no reason to keep the wait message in place since it will
never show up even in ddb show proc output.
OK jca@



CVS: cvs.openbsd.org: src

2024-05-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/22 03:22:55

Modified files:
sys/kern   : kern_sig.c 

Log message:
In the big p_stat switch in ptsignal do not call return but instead
use one of the gotos. In this case goto out with mask and prop set to 0.

OK jca@



CVS: cvs.openbsd.org: src

2024-05-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/22 03:20:22

Modified files:
sys/kern   : kern_resource.c 

Log message:
Just grab the SCHED_LOCK() once in donice() before walking the ps_threads
list. setpriority() is trivial and probably faster than releasing and
relocking SCHED_LOCK().
OK jca@



CVS: cvs.openbsd.org: src

2024-05-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/22 02:42:34

Modified files:
usr.sbin/bgpctl: bgpctl.c output.c output_json.c 

Log message:
Adjust code since remote_bgpid, bgpid and clusterid changed to
host byte order.
OK tb@



CVS: cvs.openbsd.org: src

2024-05-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/22 02:41:14

Modified files:
usr.sbin/bgpd  : config.c mrt.c parse.y printconf.c rde.c rde.h 
 rde_peer.c session.c 

Log message:
Convert bgpid, remote_bgpid and clusterid to host byte order.

Before the RDE used host byte order for remote_bgpid but all the other
code used network byte order. The reason for that was that bgpid was
initially an IPv4 address but since RFC 6286 in 2011 this is much more
relaxed and so it makes more sense to just treat them as numbers and
so host byte order.

OK tb@



CVS: cvs.openbsd.org: src

2024-05-20 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/20 04:32:20

Modified files:
sys/kern   : kern_exit.c kern_fork.c kern_proc.c 
 kern_resource.c kern_sig.c kern_synch.c 
sys/sys: proc.h 

Log message:
Rework interaction between sleep API and exit1() and start unlocking ps_threads

This diff adjusts how single_thread_set() accounts the threads by using
ps_threadcnt as initial value and counting all threads out that are already
parked. In single_thread_check call exit1() before decreasing ps_singlecount
this is now done in exit1().

exit1() and thread_fork() ensure that ps_threadcnt is updated with the
pr->ps_mtx held and in exit1() also account for exiting threads since
exit1() can sleep.

OK mpi@



CVS: cvs.openbsd.org: src

2024-05-20 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/20 04:01:52

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
Convert more of the session engine parsers to the new ibuf API

This converts OPEN and it capability parser and RREFRESH and with that
all packet parser are kind of converted. There is still parse_header()
and the general packet handling that needs some work now so that all
the ugly ibuf_from_buffer() can be dropped.
OK tb@



CVS: cvs.openbsd.org: src

2024-05-20 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/20 04:00:00

Modified files:
usr.sbin/bgpd  : logmsg.c 

Log message:
Tabs on empty line



CVS: cvs.openbsd.org: src

2024-05-16 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/16 03:38:21

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
Simplify the code to clamp the TCP send and recv buffer to 64k.

We don't really care if it works or not and we don't want to clamp it
down further then 64k. So just call setsockopt() once and ignore the error.
OK tb@ sthen@



CVS: cvs.openbsd.org: src

2024-05-15 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/15 08:43:32

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

Log message:
Add missing space



CVS: cvs.openbsd.org: src

2024-05-10 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/10 03:21:41

Modified files:
sys/kern   : init_sysent.c syscalls.c 
sys/sys: syscall.h syscallargs.h 

Log message:
Regen



CVS: cvs.openbsd.org: src

2024-05-10 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/10 03:21:01

Modified files:
sys/kern   : syscalls.master 

Log message:
The ptsignal() race against p_sigmask changes by dosigsuspend() are fixed.
Unlock sigsuspend() and __thrsigdivert() again.



CVS: cvs.openbsd.org: src

2024-05-07 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/07 09:54:23

Modified files:
sys/kern   : uipc_socket2.c 

Log message:
rw_enter() with RW_NOSLEEP returns EBUSY and not the expected EWOULDBLOCK

This fixes random gmake failures during ports builds caused by:
gmake[2]: *** read jobs pipe: Device busy.  Stop.
Fix verified by tb@ on his bulk build box
OK mvs@ tb@



CVS: cvs.openbsd.org: src

2024-05-07 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/05/07 04:46:35

Modified files:
sys/kern   : kern_sig.c 

Log message:
In Rev 1.296 the update of the siglist was moved to the end of ptsignal().
One atomic_clearbits_int() hiding in SSTOP was missed when converting all
the exceptions that cleared the siglist again. Instead of clearing the bits
the mask needs to be set to 0 so that it is properly ignored.
OK mpi@



CVS: cvs.openbsd.org: src

2024-04-24 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/24 13:10:11

Modified files:
sys/kern   : init_sysent.c syscalls.c 
sys/sys: syscall.h syscallargs.h 

Log message:
Regen



CVS: cvs.openbsd.org: src

2024-04-24 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/24 13:09:14

Modified files:
sys/kern   : syscalls.master 

Log message:
Revert rev 1.261 and require sigsuspend and __thrsigdivert to take
KERNEL_LOCK. There is at least a race in sigsuspend which can be
triggered by dump(8). Should be enough to allow me to look for the
real cause.



CVS: cvs.openbsd.org: www

2024-04-24 Thread Claudio Jeker
CVSROOT:/cvs
Module name:www
Changes by: clau...@cvs.openbsd.org 2024/04/24 06:07:11

Modified files:
faq: current.html 

Log message:
Document the removal of announce capabilities [yes|no] in bgpd.conf
With input from tb@ and sthen@



CVS: cvs.openbsd.org: www

2024-04-24 Thread Claudio Jeker
CVSROOT:/cvs
Module name:www
Changes by: clau...@cvs.openbsd.org 2024/04/24 04:44:19

Modified files:
openbgpd   : ftp.html 

Log message:
Regen



CVS: cvs.openbsd.org: www

2024-04-24 Thread Claudio Jeker
CVSROOT:/cvs
Module name:www
Changes by: clau...@cvs.openbsd.org 2024/04/24 04:43:41

Modified files:
build  : Makefile 
build/mirrors  : openbgpd-ftp.html.head 

Log message:
OpenBGPD 8.4 was releases some time ago, finally update website.



CVS: cvs.openbsd.org: src

2024-04-24 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/24 04:42:09

Modified files:
usr.sbin/bgpctl: output_json.c 

Log message:
announce_capa is no more.
OK tb@



CVS: cvs.openbsd.org: src

2024-04-24 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/24 04:41:34

Modified files:
usr.sbin/bgpd  : bgpd.conf.5 bgpd.h parse.y printconf.c 
 session.c 

Log message:
Remove 'announce capabilities' as neighbor config stanza.

There is no need to have an easy knob to get outdated or crappy
implementations to limp along. Instead the various default on
capabilities just need to be disabled (e.g. announce as-4byte no).

OK tb@



CVS: cvs.openbsd.org: src

2024-04-24 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/24 03:30:30

Modified files:
sys/dev/sbus   : magma.c magmareg.h 

Log message:
Use static inline for cd1400_write_ccr() because clang 16 has issues with it.

Also remove some unused prototypes.
>From Koakuma, OK kn@



CVS: cvs.openbsd.org: src

2024-04-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/22 03:43:11

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
In state IDLE handle EVNT_STOP and stop the IdleHold timer. This way
a down of an idle connection will properly stop the session.

OK tb@ (as part of larger diff)



CVS: cvs.openbsd.org: src

2024-04-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/22 03:36:04

Modified files:
usr.sbin/bgpd  : control.c session.c session.h 

Log message:
Move setting of the shutdown reason to session_stop()

Also make sure that something is logged when a session is stopped.
Part of a bigger diff which was OK tb@



CVS: cvs.openbsd.org: src

2024-04-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/22 02:53:59

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
No longer fall back to no capabilities when there is an OPEN/optional
attribute error.

BGP more and more relies on capabilities, automatically clearing them
all no longer seems the right choice. Now operators need to adjust the
config explicitly to allow such connections.
>From a larger diff which is OK tb@



CVS: cvs.openbsd.org: src

2024-04-21 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/21 23:54:01

Modified files:
regress/usr.sbin/rpki-client: test-aspa.c test-cert.c test-gbr.c 
  test-geofeed.c test-ip.c 
  test-mft.c test-roa.c test-rrdp.c 
  test-rsc.c test-spl.c test-tak.c 
  test-tal.c 

Log message:
Sprinkle experimental into regress so they compile
Reported by anton@



CVS: cvs.openbsd.org: src

2024-04-21 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/21 13:27:44

Modified files:
usr.sbin/rpki-client: cert.c cms.c crl.c extern.h filemode.c 
  output-json.c parser.c repo.c 

Log message:
P-256 support is experimental so require -x to enable it.

Also clean up the externs a little bit by moving experimental and noop
to extern.h.
Reminded by and OK tb@



CVS: cvs.openbsd.org: src

2024-04-18 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/18 04:29:39

Modified files:
sys/sys: proc.h 

Log message:
proc_trampoline_mp() was replaced by proc_trampoline_mi() adjust prototype.
OK mpi@



CVS: cvs.openbsd.org: src

2024-04-18 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/18 03:06:42

Modified files:
sys/kern   : kern_sig.c 

Log message:
If a proc has P_WEXIT set do not stop it, let it exit since it is already
mostly dead.

This is more like belts and suspenders since a proc in exit1() will not
receive signals anymore and so proc_stop() should not be reachable. This
is even the case when sigexit() is called and a coredump() is happening.
OK mpi@



CVS: cvs.openbsd.org: src

2024-04-18 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/18 02:59:38

Modified files:
sys/kern   : kern_synch.c 

Log message:
Clear PCATCH for procs that have P_WEXIT set.

Exiting procs will not return to userland and can not deliver signals so
it is better to not even try.
OK mpi@



CVS: cvs.openbsd.org: src

2024-04-17 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/17 08:01:17

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

Log message:
Set Accept: */* HTTP header like it was done in ftp(1).
OK tb@ job@



CVS: cvs.openbsd.org: src

2024-04-17 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/17 03:41:44

Modified files:
sys/kern   : kern_resource.c 

Log message:
dogetrusage() must be called with the KERNEL_LOCK held for now.
OK mpi@



CVS: cvs.openbsd.org: src

2024-04-17 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/17 00:18:18

Modified files:
regress/usr.bin/snmp: Makefile 

Log message:
Only use the first egress interface in $IFIDX and $IFLLADDR. Systems
can have more then one interface.
This only works if ther first egress interface is a ethernet interface
(P2P interfaces have no LLADDR) but that was already buggy before this.
OK bluhm@ martijn@



CVS: cvs.openbsd.org: src

2024-04-16 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/16 04:06:37

Modified files:
sys/uvm: uvm_swap.c 

Log message:
Call bufq_destroy() in swap_off for the VREG case since swap_on() called
bufq_init(). Similar issue as the use-after-free in mfs.
Missing call noticed by jsg@
OK deraadt@ mpi@



CVS: cvs.openbsd.org: src

2024-04-16 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/16 04:04:41

Modified files:
sys/ufs/mfs: mfs_vnops.c 

Log message:
Call bufq_destroy() in mfs_reclaim() before freeing the mfsnode.
This fixes a use-after-free bug in bufq_quiesce() once a mfs partition
was unmounted.
OK mpi@ deraadt@



CVS: cvs.openbsd.org: src

2024-04-15 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/15 09:09:26

Modified files:
sys/kern   : init_sysent.c syscalls.c 
sys/sys: syscall.h syscallargs.h 

Log message:
Regen after sigsuspend and __thrsigdivert unlock



CVS: cvs.openbsd.org: src

2024-04-15 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/15 09:08:21

Modified files:
sys/kern   : syscalls.master 

Log message:
sigsuspend and __thrsigdivert no longer require the KERNEL_LOCK since
dosigsuspend() no longer needs it.
OK mvs@ mpi@



CVS: cvs.openbsd.org: src

2024-04-11 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/11 02:33:15

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
Use != NULL for pointer check. No binary change.



CVS: cvs.openbsd.org: src

2024-04-10 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/10 04:05:26

Modified files:
sys/kern   : kern_sig.c sys_generic.c 
sys/sys: proc.h 

Log message:
Unlock dosigsuspend() and with that some aspects of ppoll and pselect

Change p_sigmask from atomic back to non-atomic updates. All changes to
p_sigmask are only allowed by curproc (the owner). There is no need for
atomic instructions here.

p_sigmask is mostly accessed by curproc with the exception of ptsignal().
In ptsignal() p_sigmask is now only read once unless a SSLEEP proc gets
the signal. In that case recheck the p_sigmask before wakeup to ensure
that no unnecessary wakeup happens.

Add some KASSERT(p == curproc) to ensure this precondition.
sigabort() is special since it is also called by ddb but apart from that
only works for curproc.

With and OK mvs@ OK mpi@



CVS: cvs.openbsd.org: src

2024-04-10 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/10 03:05:32

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
Rework the logic to not send double notifications in session_notification().

last_sent_errcode is now cleared late (when state changes to ESTABLISHED)
and so notifications sent in the OPEN phase would be dropped after the
first incident. Using the session state to know if sending a message is
possible seems more robust and is what session_stop() uses as well.
For now log the notification which are not sent as 'dropping' to see how
often this happens.

OK tb@



CVS: cvs.openbsd.org: src

2024-04-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/09 06:53:08

Modified files:
sys/net: if_wg.c rtable.c rtable.h 

Log message:
Don't include net/art.h in net/rtable.h instead let the two users
include the file themselves.
OK bluhm@ mpi@



CVS: cvs.openbsd.org: src

2024-04-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/09 06:40:01

Modified files:
usr.sbin/bgpd  : parse.y 

Log message:
Limit the number of provider ASnumbers to MAX_ASPA_SPAS_COUNT (10'000)
in the parser as well.

OK tb@



CVS: cvs.openbsd.org: src

2024-04-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/09 06:09:20

Modified files:
usr.sbin/bgpd  : bgpd.h rtr_proto.c 

Log message:
Increase RTR PDU limit to 48k and limit number of SPAS to 10'000.

PDU larger then 48k will result in a session reset while ASPA records
with more than 10'000 entries will be implicitly withdrawn.

Also truncate RTR error PDUs to only include 256 bytes of the faulty PDU.
It makes no sense to include more to identify the issue.
OK tb@



CVS: cvs.openbsd.org: src

2024-04-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/09 06:05:07

Modified files:
usr.sbin/bgpd  : rtr.c bgpd.c 

Log message:
Check that the ASPA tas array fits in an IMSG before sending the ASPA
record over to RTR or the RDE.

The long term goal is to increase the IMSG size considerably but that
requires some additional API changes to the imsg API.
OK tb@



CVS: cvs.openbsd.org: src

2024-04-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/09 03:35:57

Modified files:
regress/usr.sbin/bgpd/integrationtests: Makefile 
Added files:
regress/usr.sbin/bgpd/integrationtests: bgpd.capa.client.conf 
bgpd.capa.master.conf 
capa.sh 

Log message:
Add a capability enforcement integration test.

This should ensure that no / yes and enforce work the way we want.



CVS: cvs.openbsd.org: src

2024-04-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/09 03:33:46

Modified files:
regress/usr.sbin/bgpd/config: Makefile bgpd.conf.12.ok 
  bgpd.conf.13.ok bgpd.conf.15.ok 
  bgpd.conf.3.ok bgpd.conf.4.ok 
Added files:
regress/usr.sbin/bgpd/config: bgpd.conf.16.in bgpd.conf.16.ok 

Log message:
Add capability announce enforcement test and fixup some other result files
since the role capability is now shown in more cases.



CVS: cvs.openbsd.org: src

2024-04-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/09 03:03:18

Modified files:
usr.sbin/bgpd  : bgpd.conf.5 bgpd.h parse.y printconf.c 
 session.c 

Log message:
Allow operators to enforce the presence of certain capabilities on sessions.

For simple capabilities this just adds enforce to the yes/no option of the
announce statement. For multi-protocol capabilities and add-path there is
an extra keyword. On top of this for add-path the enforcement requires the
neighbor to send a matching capability, e.g
'announce add-path recv enforce' requires the other side to send any
'announce add-path send XYZ' capability.

This is mainly to enforce as-4byte and extra multi-protocol capabilities.

OK denis@ tb@



CVS: cvs.openbsd.org: src

2024-04-03 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/03 02:58:55

Modified files:
regress/usr.sbin/bgpd/integrationtests: bgpd.md5.rdomain2.conf 

Log message:
Switch one of the tcpmd5 passwords over to use the hex key instead.
This way both modes are tested.



CVS: cvs.openbsd.org: src

2024-04-03 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/03 02:57:26

Modified files:
usr.sbin/bgpd  : parse.y 

Log message:
Rewrite str2key() to not use strtoul() to convert 2 hexdigits into one
char. Instead use a simple function to do the conversion per nibble.
OK deraadt@ tb@



CVS: cvs.openbsd.org: src

2024-04-02 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/02 08:23:16

Modified files:
lib/libc/sys   : getsockopt.2 
sys/kern   : uipc_socket.c 

Log message:
Implement SO_ACCEPTCONN in getsockopt(2)
Requested by robert@
OK mvs@ millert@ deraadt@



CVS: cvs.openbsd.org: src

2024-04-02 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/02 04:04:28

Removed files:
regress/usr.sbin/bgpd/config: bgpd.conf.example.ok 

Log message:
Remove unused file



CVS: cvs.openbsd.org: src

2024-04-02 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/04/02 03:48:24

Modified files:
usr.bin/ssh: ssh-pkcs11.c 

Log message:
Remove unused ptr[3] char array in pkcs11_decode_hex.
OK deraadt@



CVS: cvs.openbsd.org: src

2024-03-26 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/26 08:46:49

Modified files:
sys/arch/sparc64/stand/ofwboot: boot.c vers.c 

Log message:
Implement the chmod a-x bsd.upgrade trick in the sparc64 ofwboot bootloader.
OK deraadt@ florian@ kn@



CVS: cvs.openbsd.org: src

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

Modified files:
usr.sbin/bgpd  : session.c 

Log message:
Move the SendHoldTimer code into start_timer_sendholdtime() and ensure
the timer is stopped if HoldTime is 0.
OK tb@



CVS: cvs.openbsd.org: src

2024-03-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/22 09:41:34

Modified files:
usr.sbin/bgpd  : bgpd.h logmsg.c rtr_proto.c session.c util.c 

Log message:
Rework the cease shutdown reason to work in both directions by looking
at the ibuf payload passed to log_notification().
Because of this move ibuf_get_string() and the log_notification() call
in parse_notification().
OK tb@



CVS: cvs.openbsd.org: src

2024-03-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/22 01:19:28

Modified files:
usr.sbin/bgpd  : bgpd.h logmsg.c session.c session.h util.c 

Log message:
Rework parse_notification() to use the ibuf API for everything.

While there fix the RFC5492 handling of ERR_OPEN_CAPA (the current code
has the logic inversed). ERR_OPEN_CAPA is there to signal that a needed
capability is missing in our OPEN message. Just add the handling of
ERR_OPEN_CAPA to log_notification().

Also rework the handling of the shutdown reason and move the printing
into log_notification().

OK tb@



CVS: cvs.openbsd.org: src

2024-03-22 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/22 01:15:04

Modified files:
sys/nfs: nfs_socket.c nfs_syscalls.c 

Log message:
Limit NFS connections to originate from a reserved port.

For TCP connections do the check when adding the socket via nfssvc(2).
For UDP do the check early after soreceive().
On top of this limit the sockets added via nfssvc(2) to IPv4 TCP and UDP
sockets.
OK millert@ deraadt@



CVS: cvs.openbsd.org: src

2024-03-21 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/21 04:58:15

Modified files:
sbin/nfsd  : nfsd.c 

Log message:
Do not exit the master process if a client TCP connection fails to be
added.
OK millert@



CVS: cvs.openbsd.org: src

2024-03-20 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/20 03:35:46

Modified files:
usr.sbin/bgpd  : parse.y printconf.c rde.c rde_peer.c session.c 
 util.c 

Log message:
Cleanup AID handling.

- Loops over all valid AID should start with AID_MIN and go up to AID_MAX - 1
e.g. for (i = AID_MIN; i < AID_MAX; i++)
If for some reason AID_UNSPEC must be handled make that explicit in the
for loop.

- aid2afi() now returns an error for AID_UNSPEC since there is no valid
AFI SAFI combo for AID_UNSPEC.

- Add additional checks for AID_MIN where currently only AID_MAX was checked.
This affects imsg for route refresh and graceful restart.

- Simplify add-path capability handling. Only the negotiated add_path capa
sets the flag for AID_UNSPEC to help code to quickly check if any add-path
is active.

OK tb@



CVS: cvs.openbsd.org: src

2024-03-20 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/20 03:26:42

Modified files:
usr.bin/rsync  : sender.c 

Log message:
Remove some else statements in if () else if () chains that don't need
to be written this way. Makes the code more readable.
OK tb@



CVS: cvs.openbsd.org: src

2024-03-18 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/18 08:54:53

Modified files:
usr.sbin/bgpd  : parse.y 

Log message:
Typecast char argument to isxdigit() to unsigned char since isxdigit()
only works that way correctly.
OK deraadt@



CVS: cvs.openbsd.org: src

2024-03-18 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/03/18 04:49:24

Modified files:
usr.sbin/bgpd  : bgpd.h 

Log message:
Double PEER_DESCR_LEN to 64 characters since 32 is a bit on the short side.
OK sthen@, deraadt@, dlg@, tb@



  1   2   3   4   5   6   7   8   9   10   >