amdgpio(4) : preserve pin configuration on resume

2022-04-19 Thread Mike Larkin
On at least the Asus ROG Zephyrus 14 (2020), the trackpad fails to generate any interrupts after resume. I tracked this down to amdgpio(4) not generating interrupts after resume, and started looking at missing soft state. This diff preserves the interrupt pin configurations and restores them after

Re: const openpty et al.

2022-04-19 Thread Matthew Martin
On Thu, Apr 07, 2022 at 06:11:45PM -0500, Matthew Martin wrote: > const the termp and winp arguments for openpty and related. This matches > the prototypes for openpty and forkpty in glibc and musl libc. ping; has an ok from tb@ [1] 1: https://marc.info/?l=openbsd-tech&m=164986161215132&w=2 diff

Re: rpki-client: drop some dead code

2022-04-19 Thread Claudio Jeker
On Tue, Apr 19, 2022 at 10:04:26PM +0200, Theo Buehler wrote: > I first wanted to change the %i to a %d, then I noticed that timeout < 1 > can't be true since timeout != 0 and 0 <= timeout <= 24*60*60. Makes sense. OK claudio@ > Index: main.c > ===

route timer queues

2022-04-19 Thread Alexander Bluhm
Hi, I had a look in route timer queues in netinet and netinet6 and found some inconsistencies. - Timeout was a mixture of int, u_int and long. Make timeout int with sysctl bounds checking and make absolute time time_t. - Some code assumes that ..._timeout_q can be NULL and at some places th

rpki-client: drop some dead code

2022-04-19 Thread Theo Buehler
I first wanted to change the %i to a %d, then I noticed that timeout < 1 can't be true since timeout != 0 and 0 <= timeout <= 24*60*60. Index: main.c === RCS file: /cvs/src/usr.sbin/rpki-client/main.c,v retrieving revision 1.196 diff

wall(1) - fix issues with line wrapping

2022-04-19 Thread Anton Borowka
Hi, the attached diff fixes 2 issues with line wrappings in wall(1). * The 79th character is skipped and not printed because of the line wrapping. => Go back one character in the buffer, if we were not printing a new line. * The line wrapping counter is reset after line wrapping and also a

Re: rpki-client: plug leak of crldp in mft_parse()

2022-04-19 Thread Claudio Jeker
On Tue, Apr 19, 2022 at 08:22:53PM +0200, Theo Buehler wrote: > If the checks involving crlfile fail one way or the other, we'll leak > crldp. Here's one way to fix it. We could also drop the free(crldp) in > the body or add a free to the relevant conditional. I think it would be better to only h

Re: rpki-client remove hidden global

2022-04-19 Thread Claudio Jeker
On Tue, Apr 19, 2022 at 07:35:35PM +0200, Theo Buehler wrote: > On Tue, Apr 19, 2022 at 07:24:04PM +0200, Claudio Jeker wrote: > > I tripped over this and this optimisation hurts more then it helps. > > So lets just create a new EVP_ENCODE_CTX for every base64_decode() > > call and cleanup at the e

rpki-client: plug leak of crldp in mft_parse()

2022-04-19 Thread Theo Buehler
If the checks involving crlfile fail one way or the other, we'll leak crldp. Here's one way to fix it. We could also drop the free(crldp) in the body or add a free to the relevant conditional. Index: mft.c === RCS file: /cvs/src/usr.

Re: rpki-client remove hidden global

2022-04-19 Thread Theo Buehler
On Tue, Apr 19, 2022 at 07:24:04PM +0200, Claudio Jeker wrote: > I tripped over this and this optimisation hurts more then it helps. > So lets just create a new EVP_ENCODE_CTX for every base64_decode() > call and cleanup at the end of the call. Should malloc() failure and EVP_ENCODE_CTX_new() fail

rpki-client remove hidden global

2022-04-19 Thread Claudio Jeker
I tripped over this and this optimisation hurts more then it helps. So lets just create a new EVP_ENCODE_CTX for every base64_decode() call and cleanup at the end of the call. -- :wq Claudio Index: encoding.c === RCS file: /cvs/src/

Re: route timer pool

2022-04-19 Thread Claudio Jeker
On Tue, Apr 19, 2022 at 06:53:28PM +0200, Alexander Bluhm wrote: > On Tue, Apr 19, 2022 at 08:59:25AM +0200, Claudio Jeker wrote: > > On Tue, Apr 19, 2022 at 01:44:40AM +0200, Alexander Bluhm wrote: > > > Hi, > > > > > > Can we use a pool for rttimer_queue_pool? > > > > Another option would be to

Re: route timer pool

2022-04-19 Thread Alexander Bluhm
On Tue, Apr 19, 2022 at 08:59:25AM +0200, Claudio Jeker wrote: > On Tue, Apr 19, 2022 at 01:44:40AM +0200, Alexander Bluhm wrote: > > Hi, > > > > Can we use a pool for rttimer_queue_pool? > > Another option would be to use static rttimer_queues instead of allocating > them. Not that many timers a

Re: imsg: handle size integer overflows

2022-04-19 Thread Tobias Stoeckmann
On Tue, Apr 19, 2022 at 09:10:13AM -0600, Theo de Raadt wrote: > - if ((buf->buf = malloc(len)) == NULL) { > + if (len == 0) > + buf->buf = NULL; > + else if ((buf->buf = malloc(len)) == NULL) { > > This code intentionally permitted malloc(0), because with our mallo

Re: route timer init

2022-04-19 Thread Claudio Jeker
On Tue, Apr 19, 2022 at 04:57:27PM +0200, Alexander Bluhm wrote: > On Tue, Apr 19, 2022 at 08:46:06AM +0200, Claudio Jeker wrote: > > On Tue, Apr 19, 2022 at 12:07:49AM +0200, Alexander Bluhm wrote: > > > Hi, > > > > > > Instead of using a MP unsafe global variable, just call rt_timer_init() > > >

Re: imsg: handle size integer overflows

2022-04-19 Thread Theo de Raadt
- if ((buf->buf = malloc(len)) == NULL) { + if (len == 0) + buf->buf = NULL; + else if ((buf->buf = malloc(len)) == NULL) { This code intentionally permitted malloc(0), because with our malloc/free behaviour that will allocate a non-read/writeable object and a later

Re: route timer init

2022-04-19 Thread Alexander Bluhm
On Tue, Apr 19, 2022 at 08:46:06AM +0200, Claudio Jeker wrote: > On Tue, Apr 19, 2022 at 12:07:49AM +0200, Alexander Bluhm wrote: > > Hi, > > > > Instead of using a MP unsafe global variable, just call rt_timer_init() > > from route_init(). > > > > ok? > > Wouldn't it be better to move this into

Re: xmss_hash.c: remove superfluous includes

2022-04-19 Thread Todd C . Miller
On Tue, 19 Apr 2022 11:43:35 +0200, Martin Vahlensieck wrote: > Neither openssl/evp.h nor openssl/hmac.h are required. Right. - todd

Re: ssh-xmss.c: Add missing includes

2022-04-19 Thread Todd C . Miller
On Tue, 19 Apr 2022 11:42:52 +0200, Martin Vahlensieck wrote: > malloc(3) and friends require stdlib.h, SIZE_MAX requires stdint.h. You are correct. The other xmss files get these includes via xmss_commons.h, but ssh-xmss.c does not. - todd

Re: readconf.c: Avoid a xstrdup

2022-04-19 Thread Todd C . Miller
On Tue, 19 Apr 2022 11:41:10 +0200, Martin Vahlensieck wrote: > There is no need to duplicate options->send_env[i] only free it > in all cases. Just use options->send_env[i] directly. Good catch, match_pattern() takes const char * arguments so there is no danger there. - todd

imsg: handle size integer overflows

2022-04-19 Thread Tobias Stoeckmann
Hi, supplying large sizes to ibuf functions can lead to integer overflows which are not properly handled. I have added regression tests as well, which make it easier to see the effects and how to trigger these issues. The ibuf_open adjustment for malloc(0) has been taken from imsg.c as can be se

Re: rpki-client fail hard if repository is missing

2022-04-19 Thread Theo Buehler
On Tue, Apr 19, 2022 at 02:58:17PM +0200, Claudio Jeker wrote: > If parse_filepath() is unable to locate the repository then fail hard. > It makes no sense to limp along in this case because something bigger is > broken and it is better to know about that early. Makes sense. ok > > -- > :wq Cl

Re: rpki-client fix talsz type

2022-04-19 Thread Theo Buehler
On Tue, Apr 19, 2022 at 02:54:56PM +0200, Claudio Jeker wrote: > The code uses int for talid so there is no reason to use a size_t for the > talsz (which is the maximum talid). I also switched the type of i in > main.c to int which is used in for loops around talsz but also for NFDS. > Adjust the c

rpki-client fail hard if repository is missing

2022-04-19 Thread Claudio Jeker
If parse_filepath() is unable to locate the repository then fail hard. It makes no sense to limp along in this case because something bigger is broken and it is better to know about that early. -- :wq Claudio Index: parser.c === RCS

rpki-client fix talsz type

2022-04-19 Thread Claudio Jeker
The code uses int for talid so there is no reason to use a size_t for the talsz (which is the maximum talid). I also switched the type of i in main.c to int which is used in for loops around talsz but also for NFDS. Adjust the code in the output functions as well. -- :wq Claudio Index: extern.h

xmss_hash.c: remove superfluous includes

2022-04-19 Thread Martin Vahlensieck
Hi Neither openssl/evp.h nor openssl/hmac.h are required. Best, Martin Index: xmss_hash.c === RCS file: /cvs/src/usr.bin/ssh/xmss_hash.c,v retrieving revision 1.2 diff -u -p -r1.2 xmss_hash.c --- xmss_hash.c 26 Feb 2018 03:56:44 -0

ssh-xmss.c: Add missing includes

2022-04-19 Thread Martin Vahlensieck
Hi malloc(3) and friends require stdlib.h, SIZE_MAX requires stdint.h. Best, Martin Index: ssh-xmss.c === RCS file: /cvs/src/usr.bin/ssh/ssh-xmss.c,v retrieving revision 1.4 diff -u -p -r1.4 ssh-xmss.c --- ssh-xmss.c 19 Oct 2020 2

readconf.c: Avoid a xstrdup

2022-04-19 Thread Martin Vahlensieck
Hi There is no need to duplicate options->send_env[i] only free it in all cases. Just use options->send_env[i] directly. Best, Martin Index: readconf.c === RCS file: /cvs/src/usr.bin/ssh/readconf.c,v retrieving revision 1.366 diff