ucc: ignore get encoding requests

2021-10-19 Thread Anton Lindqvist
Hi, landry@ reported that he ended up with the wrong encoding in X11 while having a ucc keyboard attached and /etc/kbdtype being present. The advertised encoding of a wsmux is a bit fragile as the last attached device will dictate it. If this happens to be a ucc keyboard, KB_US will always be the

uhid(4): manual tweaks

2021-09-14 Thread Anton Lindqvist
Hi, Improvements to the uhid(4) manual: * Include the relevant header in the synopsis * Document all supported ioctl commands * Emphasis that a pointer is required to all ioctl commands * Make the write(2) semantics a bit clearer * Add files section * Document errors Comments? OK? Index: uhid.4

uhid(4): unknown ioctl command

2021-09-14 Thread Anton Lindqvist
Hi, Change the errno to ENOTTY when encountering an unknown ioctl command as opposed of using EINVAL which is ambiguous in this context. Comments? OK? Index: dev/usb/uhid.c === RCS file: /cvs/src/sys/dev/usb/uhid.c,v retrieving

Re: FIDO/U2F not working with latest snapshot

2021-09-12 Thread Anton Lindqvist
On Sun, Sep 12, 2021 at 12:53:30PM -0400, Mitchell Riedstra wrote: > > > I have reverted the commit by now. Could you please send me the dmesg > > and ssh-agent FIDO_DEBUG=1 output with and without this commit > > applied. > > > > Sure! See attached. Thanks, the diff below should hopefully

ucc: ignore set encoding requests

2021-09-12 Thread Anton Lindqvist
Hi, landry@ reported that kbd spits out the following error while booting with a ucc keyboard attached and /etc/kbdtype being present: kbd: unsupported encoding uk on /dev/wskbd2 Changing the encoding of a ucc keyboard doesn't make sense as only one encoding is supported. Instead,

Re: FIDO/U2F not working with latest snapshot

2021-09-12 Thread Anton Lindqvist
On Sat, Sep 11, 2021 at 07:56:47PM -0400, Mitchell Riedstra wrote: > I see the same issue, it seems to be impacting everything with libfido, > ( ed25519-sk and ecdsa-sk SSH keys as well ) Reverting that commit also > fixes the issue for me. > > I don't see anything obvious in dmesg, running

uhidev: report sizes

2021-09-08 Thread Anton Lindqvist
Hi, Instead of letting uhidev drivers get the report sizes, do it once in uhidev and pass the same sizes as part of the attach arguments. Makes the uhidev drivers a bit less repetitive. Note that each call to uhidev_get_report_size() requires one malloc() and a full traversal of the HID report.

Re: ucc(4): slice interrupt report

2021-08-26 Thread Anton Lindqvist
On Fri, Aug 27, 2021 at 07:05:06AM +0200, Anton Lindqvist wrote: > Hi, > An interrupt report contains the state of all items (Input, Output and > Feature) from the corresponding descriptor report for a given report ID. > The ordering of the items is identical in both the descriptor and

ucc(4): slice interrupt report

2021-08-26 Thread Anton Lindqvist
Hi, An interrupt report contains the state of all items (Input, Output and Feature) from the corresponding descriptor report for a given report ID. The ordering of the items is identical in both the descriptor and interrupt report. As the interrupt report can cover more than Consumer Control

ucc(4): enumerate all usages

2021-08-25 Thread Anton Lindqvist
Hi, As the Consumer Control usages are well defined by the HID Usage Tables specification ucc might as well enumerate all of them. Finding an appropriate scan code recognized by X11 for each usage is more tricky. I've added a few more but the majority are still unmapped. Linux has defined a couple

Re: ucc(4): consumer control keyboard device driver

2021-08-24 Thread Anton Lindqvist
Hi, On Fri, Aug 20, 2021 at 10:48:28PM -0700, David Rinehart wrote: > I use usbhidaction, a little differently: > > - OBSD media server in office, connected to speakers > > - Custom microservice on media server, to control volume > > - When I am docked at startup (detected in .xsession),

Re: ucc(4): consumer control keyboard device driver

2021-08-19 Thread Anton Lindqvist
On Wed, Aug 18, 2021 at 12:01:53PM -0500, joshua stein wrote: > On Wed, 18 Aug 2021 at 18:48:45 +0200, Martin Pieuchot wrote: > > Regarding the introduction of a separate wskbd(4) this can be seen as an > > intermediate step. Having this logic in ukbd(4) implies revisiting the > > way reportID

Re: ucc(4): consumer control keyboard device driver

2021-08-17 Thread Anton Lindqvist
On Tue, Aug 17, 2021 at 10:08:35PM +0200, Paul de Weerd wrote: > Hi Anton, > > Thanks - I've applied your diff and built a kernel with it. Full > dmesg (both before and after) at the end of this mail, diff is: > > -uhid2 at uhidev3 reportid 3: input=3, output=0, feature=0 > +ucc0 at uhidev3

ucc(4): consumer control keyboard device driver

2021-08-17 Thread Anton Lindqvist
4 uhidpp.4 \ uipaq.4 ujoy.4 uk.4 ukbd.4 \ diff --git share/man/man4/ucc.4 share/man/man4/ucc.4 new file mode 100644 index 000..413c88aa6af --- /dev/null +++ share/man/man4/ucc.4 @@ -0,0 +1,45 @@ +.\"$OpenBSD$ +.\" +.\" Copyright (c) 2021 Anton Lindqvist +.\" +.\&qu

Re: usbhidctl: add -R flag to dump raw report descriptor bytes

2021-05-30 Thread Anton Lindqvist
On Fri, May 28, 2021 at 09:52:57PM -0500, joshua stein wrote: > On Wed, 26 May 2021 at 08:13:52 +0200, Anton Lindqvist wrote: > > On Tue, May 25, 2021 at 08:31:14AM +0200, Anton Lindqvist wrote: > > > On Mon, May 24, 2021 at 09:17:26AM -0500, joshua stein wrote: > > > &

Re: panic(9): set panicstr atomically

2021-05-13 Thread Anton Lindqvist
On Wed, May 12, 2021 at 07:08:39PM -0500, Scott Cheloha wrote: > Hi, > > In a separate mail thread, bluhm@ mentioned that panic(9) does not > cleanly handle multiple CPUs entering it simultaneously: > > https://marc.info/?l=openbsd-tech=161908805925325=2 > > I'm unsure which part of panic(9) is

unlock lseek(2)

2021-05-01 Thread Anton Lindqvist
Hi, In August 2019 I tried to unlock lseek(2) which failed since the vnode lock could not be acquired without holding the kernel lock back then, found the hard way. claudio@ recently[1] make it possible to acquire a vnode lock without holding the kernel lock. I therefore would like to give this

Re: uhidev: allow devices to match specific multiple reports

2021-03-06 Thread Anton Lindqvist
On Fri, Mar 05, 2021 at 08:58:44AM -0600, joshua stein wrote: > uhidev allows a child device to claim all reports by calling *_match > functions with the report id set to UHIDEV_CLAIM_ALLREPORTID. > > umt needs this because it has to access 3 reports which has worked > okay up until now because

Re: uhidpp(4): logitech hid++ device driver

2021-02-14 Thread Anton Lindqvist
On Fri, Feb 12, 2021 at 03:48:51AM -0800, Anindya Mukherjee wrote: > Hi, > > Sorry for the delay. I am running the latest snapshot: > kern.version=OpenBSD 6.9-beta (GENERIC.MP) #331: Thu Feb 11 20:28:45 MST 2021 > dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP > which

Re: interface group name validation

2021-02-09 Thread Anton Lindqvist
On Tue, Feb 09, 2021 at 11:08:09PM +0100, Alexander Bluhm wrote: > Hi, > > Next try to fix syzkaller crash > https://syzkaller.appspot.com/bug?id=54e16dc5bce6929e14b42e2f1379f1c18f62be43 > > Interface group names must fit into IFNAMSIZ and be unique. But > the kernel makes the unique check

Re: uhidpp(4): logitech hid++ device driver

2021-02-08 Thread Anton Lindqvist
Hi, On Mon, Feb 08, 2021 at 02:50:39PM -0800, Anindya Mukherjee wrote: > Hi, I have a Logitech M570 which seems to be handled by this new driver. > However I don't see any battery level information. > > dmesg: > uhidpp0 at uhidev4 device 1 mouse "M570" serial ef-81-ff-80 > > sysctl

Re: uhidpp(4): logitech hid++ device driver

2021-02-05 Thread Anton Lindqvist
On Fri, Feb 05, 2021 at 10:36:34AM +0100, Landry Breuil wrote: > On Fri, Jan 22, 2021 at 08:18:51AM +0100, Anton Lindqvist wrote: > > Hi, > > Here's a new driver for Logitech HID++ devices, currently limited to > > exposing battery sensors. Here's an example using

Re: uhidpp(4): logitech hid++ device driver

2021-02-02 Thread Anton Lindqvist
On Tue, Feb 02, 2021 at 01:00:48PM +0100, Marcus Glocker wrote: > On Tue, Feb 02, 2021 at 08:23:29AM +0100, Anton Lindqvist wrote: > > > On Sat, Jan 30, 2021 at 01:18:07PM +0200, Ville Valkonen wrote: > > > On Sat, 2021-01-30 at 08:36 +0100, Anton Lindqvist wrote: > &g

Re: uhidpp(4): logitech hid++ device driver

2021-02-01 Thread Anton Lindqvist
On Sat, Jan 30, 2021 at 01:18:07PM +0200, Ville Valkonen wrote: > On Sat, 2021-01-30 at 08:36 +0100, Anton Lindqvist wrote: > > On Fri, Jan 29, 2021 at 10:15:05PM +0200, Ville Valkonen wrote: > > > Hi, > > > > > > I have a bit oldish Logitech M705 mouse, boug

Re: uhidpp(4): logitech hid++ device driver

2021-01-29 Thread Anton Lindqvist
On Fri, Jan 29, 2021 at 10:15:05PM +0200, Ville Valkonen wrote: > Hi, > > I have a bit oldish Logitech M705 mouse, bought around 2010-2011. > Regarding the dmesg (on below) I can see it gets attached correctly to > uhiddp0 but doesn't report battery levels. Here's the line from dmesg: > uhidpp0

Re: uhidpp(4): logitech hid++ device driver

2021-01-29 Thread Anton Lindqvist
t uhidev?" +.Sh DESCRIPTION +The +.Nm +driver provides support for Logitech HID++ devices. +It exposes a collection of battery sensor values which are made available +through the +.Xr sysctl 8 +interface. +.Sh SEE ALSO +.Xr intro 4 , +.Xr uhidev 4 , +.Xr usb 4 , +.Xr sensorsd 8 , +.Xr sysctl 8

Re: uhidpp(4): logitech hid++ device driver

2021-01-28 Thread Anton Lindqvist
Ping On Fri, Jan 22, 2021 at 08:18:51AM +0100, Anton Lindqvist wrote: > Hi, > Here's a new driver for Logitech HID++ devices, currently limited to > exposing battery sensors. Here's an example using a Logitech M330 mouse: > > $ dmesg | grep uhidpp > uhidpp0 at uhid

usbhidctl: efault

2021-01-28 Thread Anton Lindqvist
Hi, While running usbhidctl on my USB mouse it occasionally fails as follows: # usbhidctl -f /dev/wsmouse2 usbhidctl: USB_GET_REPORT (probably not supported by device): Bad address The EFAULT happens during copyin(9) in sys_ioctl() while copying the supplied usb_ctl_report

uhidpp(4): logitech hid++ device driver

2021-01-22 Thread Anton Lindqvist
TION +The +.Nm +driver provides support for Logitech HID++ devices. +It exposes a collection of battery sensor values which are made available +through the +.Xr sysctl 8 +interface. +.Sh SEE ALSO +.Xr intro 4 , +.Xr uhidev 4 , +.Xr usb 4 , +.Xr sensorsd 8 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver

usb_init_task(9): correct type

2021-01-15 Thread Anton Lindqvist
Hi, The usb_init_task(9) macro accepts a `struct usb_task'. Comments? OK? Index: share/man/man9/usb_add_task.9 === RCS file: /cvs/src/share/man/man9/usb_add_task.9,v retrieving revision 1.2 diff -u -p -r1.2 usb_add_task.9 ---

Re: unbound: missing null check

2021-01-06 Thread Anton Lindqvist
On Wed, Jan 06, 2021 at 10:24:47AM +0100, Florian Obser wrote: > On Wed, Jan 06, 2021 at 10:11:01AM +0100, Anton Lindqvist wrote: > > Hi, > > I have a unbound forward zone configured on my router for my $DAYJOB. > > The address associated with the zone is only acces

unbound: missing null check

2021-01-06 Thread Anton Lindqvist
Hi, I have a unbound forward zone configured on my router for my $DAYJOB. The address associated with the zone is only accessible when the router is connected to a VPN. If the VPN connection is absent, trying to resolve any domain that must be handled by the zone crashes unbound. Turns out there's

Re: Use SMR_TAILQ for `ps_threads'

2020-12-02 Thread Anton Lindqvist
On Wed, Dec 02, 2020 at 11:41:04AM -0300, Martin Pieuchot wrote: > On 02/12/20(Wed) 17:27, Jonathan Matthew wrote: > > On Tue, Dec 01, 2020 at 02:35:18PM -0300, Martin Pieuchot wrote: > > > On 01/12/20(Tue) 15:30, Claudio Jeker wrote: > > > > [...] > > > > Did you run a make build with that

Re: ksh tab completion bug

2020-11-10 Thread Anton Lindqvist
On Tue, Nov 10, 2020 at 06:49:28PM +0100, Sven M. Hallberg wrote: > Apologies for jumping in as a bystander, but if I may comment: > > Anton Lindqvist on Tue, Nov 10 2020: > > Been brought up before[1] and rejected[2][3]. > > Anton Lindqvist on Sun, Jul 02, 2017: > >

Re: ksh tab completion bug

2020-11-09 Thread Anton Lindqvist
On Mon, Nov 09, 2020 at 11:15:36PM -0800, Michael Forney wrote: > I noticed some strange behavior of ksh in emacs mode when completing > file names that contain spaces (or other characters that need > escaping). > > To illustrate the problem, consider two files 'a b c test1' and > 'a b c test2'.

Re: process: annotate locking for setitimer(2) state

2020-08-11 Thread Anton Lindqvist
On Sun, Aug 09, 2020 at 05:33:58PM +0200, Mark Kettenis wrote: > > Date: Sun, 9 Aug 2020 10:02:38 -0500 > > From: Scott Cheloha > > > > On Sun, Aug 09, 2020 at 04:43:24PM +0200, Mark Kettenis wrote: > > > > Date: Sat, 8 Aug 2020 19:46:14 -0500 > > > > From: Scott Cheloha > > > > > > > > Hi, >

harmonize locking annotations

2020-06-29 Thread Anton Lindqvist
Hi, I think we all agree that global locks should be represented using uppercase letters in locking annotations. This is an attempt to harmonize the existing annotations. Comments? OK? Index: dev/dt/dt_dev.c === RCS file:

Re: pipe: reduce number of allocations

2020-06-23 Thread Anton Lindqvist
On Tue, Jun 16, 2020 at 09:10:54PM +0200, Anton Lindqvist wrote: > Hi, > Instead of performing three distinct allocations per created pipe, > reduce it to a single one. Not only should this be more performant, it > also solves a kqueue related issue found by visa@ who also requested &

pipe: reduce number of allocations

2020-06-16 Thread Anton Lindqvist
Hi, Instead of performing three distinct allocations per created pipe, reduce it to a single one. Not only should this be more performant, it also solves a kqueue related issue found by visa@ who also requested this change: > If you attach an EVFILT_WRITE filter to a pipe fd, the knote gets added

Re: Call FRELE() without fdplock in dup*(2)

2020-06-10 Thread Anton Lindqvist
On Wed, Jun 10, 2020 at 02:34:00PM +, Visa Hankala wrote: > A while ago, finishdup() was changed to release fdplock before calling > closef() to avoid potential lock order problems in the file close path. > However, the dup* code can still invoke that path with fdplock held > through FRELE().

ddb(4): missing tags

2020-05-17 Thread Anton Lindqvist
Hi, The ddb(4) manual documents a couple of commands which can be abbreviated. The diff below adds explicit tags for such commands which in turn makes it possible to jump to for instance `examine' from within your $PAGER. Comments? OK? Index: ddb.4

flock unlock

2020-03-13 Thread Anton Lindqvist
Hi, After reading the flock(2) code I cannot spot anything preventing it from being unlocked. This is all made possible by the recent MP-safe effort including atomic file flags and posix file locks. I've been running with this for a week by now. However, testing is much appreciated. Remember to

atomic f_iflags

2020-03-10 Thread Anton Lindqvist
Hi, In order to unlock flock(2), make writes to the f_iflags field of struct file atomic; similar to recent changes to both struct file and process. This also gets rid of the last kernel lock protected field in the scope of struct file. Comments? OK? Index: kern/kern_descrip.c

fcntl unlock

2020-03-05 Thread Anton Lindqvist
Hi, After reading the fcntl(2) code I cannot spot anything obvious preventing it from being unlocked[1]. This is all made possible by the recent MP-safe effort including resource limits, atomic file flags, ioctl unlock and posix file locks. I've been running with this for a week by now. However,

rwlock(9): xr rwsleep(9)

2019-11-04 Thread Anton Lindqvist
ok? Index: rwlock.9 === RCS file: /cvs/src/share/man/man9/rwlock.9,v retrieving revision 1.24 diff -u -p -r1.24 rwlock.9 --- rwlock.925 Feb 2019 22:03:56 - 1.24 +++ rwlock.94 Nov 2019 14:25:19 - @@ -238,6 +238,7

Re: vmctl: invalid parent template error

2019-08-12 Thread Anton Lindqvist
On Mon, Aug 12, 2019 at 02:52:46PM +0200, Klemens Nanni wrote: > On Mon, Aug 12, 2019 at 02:14:42PM +0200, Anton Lindqvist wrote: > > Hi, > > I recently fat fingered the vm template passed to vmctl and was greeted > > with the following error: > > > > vmctl: s

vmctl: invalid parent template error

2019-08-12 Thread Anton Lindqvist
Hi, I recently fat fingered the vm template passed to vmctl and was greeted with the following error: vmctl: start vm command failed: Operation not permitted I think we can be more specific in order to improve usability: vmctl: could not find specified parent template Comments? OK? Index:

Re: vm.conf: boot-device

2019-05-12 Thread Anton Lindqvist
On Wed, May 08, 2019 at 01:02:10PM -0700, Mike Larkin wrote: > On Wed, May 08, 2019 at 09:41:42PM +0200, Anton Lindqvist wrote: > > On Wed, May 08, 2019 at 07:19:45PM +0200, Reyk Floeter wrote: > > > On Wed, May 08, 2019 at 06:47:53PM +0200, Anton Lindqvist wrote: > > >

Re: vm.conf: boot-device

2019-05-08 Thread Anton Lindqvist
On Wed, May 08, 2019 at 07:19:45PM +0200, Reyk Floeter wrote: > On Wed, May 08, 2019 at 06:47:53PM +0200, Anton Lindqvist wrote: > > Hi, > > A first stab at adding support for option `-B device' to vm.conf(5). > > With the diff below, I'm able to add a dedicated VM to be used

vm.conf: boot-device

2019-05-08 Thread Anton Lindqvist
Hi, A first stab at adding support for option `-B device' to vm.conf(5). With the diff below, I'm able to add a dedicated VM to be used with autoinstall(5): vm "amd64-install" { disable boot $snapshots "bsd.rd" disk $home "amd64.qcow2" boot-device net

chflagsat(2): fix function argument

2019-03-25 Thread Anton Lindqvist
Hi, My guess is that flag actually refers to atflags. Comments? OK? Index: chflags.2 === RCS file: /cvs/src/lib/libc/sys/chflags.2,v retrieving revision 1.27 diff -u -p -r1.27 chflags.2 --- chflags.2 19 Jan 2015 15:54:11 -

lockf: initialization order

2019-02-21 Thread Anton Lindqvist
Hi, Initialize the fields of `struct lockf' in the same order as the struct definition, with the ambition of making easier to inspect that all fields are properly initialized. Similar work has already been done in lf_split(). Comments? OK? Index: kern/vfs_lockf.c

wscons: struct wssrcops initializers

2019-02-18 Thread Anton Lindqvist
Hi, Favor C99 initializers for struct wssrcops; improves grepability. Comments? OK? Index: dev/wscons/wskbd.c === RCS file: /cvs/src/sys/dev/wscons/wskbd.c,v retrieving revision 1.95 diff -u -p -r1.95 wskbd.c --- dev/wscons/wskbd.c

wscons: free size

2019-01-31 Thread Anton Lindqvist
Comments? OK? Index: dev/wscons/wsevent.c === RCS file: /cvs/src/sys/dev/wscons/wsevent.c,v retrieving revision 1.18 diff -u -p -r1.18 wsevent.c --- dev/wscons/wsevent.c19 Nov 2018 19:19:24 - 1.18 +++

cd9660: unused field in iso_node

2019-01-19 Thread Anton Lindqvist
Hi, The i_lockf field in `struct iso_node' looks unused since the initial import. Also, vop_advlock is mapped to eopnotsupp() in cd9660_vops. Comments? OK? Index: isofs/cd9660/cd9660_node.h === RCS file:

Re: kcov: trace cmp

2019-01-18 Thread Anton Lindqvist
On Fri, Jan 18, 2019 at 04:58:16PM +0100, Alexander Bluhm wrote: > On Fri, Jan 18, 2019 at 04:38:55PM +0100, Anton Lindqvist wrote: > > > - You allocate nmemb * sizeof(uintptr_t) bytes. > > > - kd_buf[nmemb - 1] is the largest valid index. > > > - kd_nmemb is nmemb -

Re: kcov: trace cmp

2019-01-18 Thread Anton Lindqvist
On Wed, Jan 16, 2019 at 10:36:29PM +0100, Alexander Bluhm wrote: > On Wed, Jan 16, 2019 at 09:17:33PM +0100, Anton Lindqvist wrote: > > + idx = kd->kd_buf[0]; > > + if (idx * 4 + 4 + 1 >= kd->kd_nmemb) > > + return; > > + > > + kd->kd_bu

kcov: trace cmp

2019-01-16 Thread Anton Lindqvist
Hi, This diff add supports for an additional trace mode to kcov where comparison instructions and switch statements can be traced. The actual comparison operands ends up in the coverage buffer, with some additional data. See the manual bits for further info. This mode will generate even more

kcov: deny mmap() while enabled

2019-01-16 Thread Anton Lindqvist
Hi, When a kcov fd is in an enabled state, disallow mmap() calls using the same fd. Sometimes, syzkaller manages to create a device node using mknod() with major=22 and minor=X where X maps to an already open kcov fd in the current process; it then mmap() the kcov coverage buffer which is used as

kcov: enable retguard

2019-01-07 Thread Anton Lindqvist
Hi, The problems caused by enabling both kcov and retguard was due to the increased kernel size. Now that NKL2_KIMG_ENTRIES has been bumped on amd64, it's no longer a problem. Comments? OK? Index: arch/amd64/conf/Makefile.amd64 ===

kcov: prepare for trace cmp [2/N]

2018-12-27 Thread Anton Lindqvist
Hi, As a next step, let KIOENABLE accept the desired tracing mode. The API matches the kcov implementation found both in Linux and FreeBSD. As far as I know, syzkaller is the only kcov consumer in the wild and I will make sure to adapt the new API there. Comments? OK? Index:

kcov: prepare for trace cmp

2018-12-26 Thread Anton Lindqvist
Hi, The end goal here is teach kcov to support tracing of comparison instructions and switch statements in order to improve coverage during fuzzing. It's achieved by compiling the kernel with the ` -fsanitize-coverage=trace-cmp' option. But first, some refactoring: the diff below separates the

Re: vmd: set dhcp hostname option during netboot

2018-12-10 Thread Anton Lindqvist
On Mon, Dec 10, 2018 at 09:40:41PM -0800, Mike Larkin wrote: > On Mon, Dec 10, 2018 at 07:27:40PM -0800, Carlos Cardenas wrote: > > On Sat, Dec 08, 2018 at 10:13:47AM +0100, Anton Lindqvist wrote: > > > Hi, > > > I've been trying out the new fake netboot feature in

Re: make build as root fails when SUDO=doas

2018-12-10 Thread Anton Lindqvist
On Mon, Dec 10, 2018 at 01:33:49PM +0100, Solene Rapenne wrote: > hi > > I have SUDO=doas in /etc/mk.conf for ports, this is preventing a `make build` > in /usr/src as root if /etc/doas.conf doesn't have a line "permit nopass root > as root". This fails when using "doas" in regress/usr/bin/ssh/ >

Re: option kcov + GENERIC.MP -> silent crash

2018-12-09 Thread Anton Lindqvist
On Wed, Dec 05, 2018 at 10:03:38PM +0100, Anton Lindqvist wrote: > On Sat, Dec 01, 2018 at 04:34:57PM +0100, Anton Lindqvist wrote: > > On Tue, Nov 27, 2018 at 05:52:15PM -0800, Greg Steuck wrote: > > > I booted the patched kernel and it seems to have gone farther an

vmd: set dhcp hostname option during netboot

2018-12-08 Thread Anton Lindqvist
Hi, I've been trying out the new fake netboot feature in vmd. Overall, a great addition that removed the need for me to run dhcpd/rebound locally to achieve auto install. It would be convenient if the DHCP lease included a hostname inferred from the VM name in order to use dedicated response files

Re: option kcov + GENERIC.MP -> silent crash

2018-12-05 Thread Anton Lindqvist
On Sat, Dec 01, 2018 at 04:34:57PM +0100, Anton Lindqvist wrote: > On Tue, Nov 27, 2018 at 05:52:15PM -0800, Greg Steuck wrote: > > I booted the patched kernel and it seems to have gone farther and I believe > > reached init before crashing. > > By performing a semi-automa

Re: option kcov + GENERIC.MP -> silent crash

2018-12-01 Thread Anton Lindqvist
On Tue, Nov 27, 2018 at 05:52:15PM -0800, Greg Steuck wrote: > I booted the patched kernel and it seems to have gone farther and I believe > reached init before crashing. By performing a semi-automated bisect I was able to identify the source files that are incompatible with tracing. Common for

Re: option kcov + GENERIC.MP -> silent crash

2018-11-26 Thread Anton Lindqvist
'd rather try coming up with a proper fix before adding any #error directives. > > On Sun, Nov 25, 2018 at 11:21 PM Anton Lindqvist wrote: > > > Hi Greg, > > > > On Sun, Nov 25, 2018 at 10:13:52AM -0800, Greg Steuck wrote: > > > Hi Anton, > > > > &

Re: option kcov + GENERIC.MP -> silent crash

2018-11-25 Thread Anton Lindqvist
Hi Greg, On Sun, Nov 25, 2018 at 10:13:52AM -0800, Greg Steuck wrote: > Hi Anton, > > I tried to boot a kernel with kcov based on GENERIC.MP and the machine > reboots without a peep immediately after > > vmm0 at mainbus0: VMX (using slow L1TF mitigation) > > Switching off either of kcov or MP

wscons: FIOGETOWN

2018-11-19 Thread Anton Lindqvist
Hi, Now that wscons is using sigio, adding support for FIOSETOWN/TIOCGPGRP is trivial. Also, visa@ pointed out that FIOSETOWN gets translated into TIOCSPGRP by sys_ioctl(), handling of FIOSETOWN is therefore redundant. Comments? OK? Index: wskbd.c

lockf: consistent use of new debug macro

2018-11-10 Thread Anton Lindqvist
Hi, Make use of the new LFPRINT() debug macro. Comments? OK? Index: kern/vfs_lockf.c === RCS file: /cvs/src/sys/kern/vfs_lockf.c,v retrieving revision 1.30 diff -u -p -r1.30 vfs_lockf.c --- kern/vfs_lockf.c10 Nov 2018 11:54:03

ktrace: struct flock

2018-11-04 Thread Anton Lindqvist
Hi, Start tracing struct flock. I've been using this diff during lockf development. Comments? OK? Index: sys/kern/kern_descrip.c === RCS file: /cvs/src/sys/kern/kern_descrip.c,v retrieving revision 1.182 diff -u -p -r1.182

Re: ksh: fc -s and SIGINT

2018-10-29 Thread Anton Lindqvist
On Mon, Oct 29, 2018 at 09:55:38AM +0100, Martijn van Duren wrote: > On 10/28/18 8:13 PM, Anton Lindqvist wrote: > > Hi, > > Bug reported by miod@, how to reproduce: > > > > $ command -v r > > alias r='fc -s' > > $ sleep 5 > > $ r sleep >

ksh: fc -s and SIGINT

2018-10-28 Thread Anton Lindqvist
Hi, Bug reported by miod@, how to reproduce: $ command -v r alias r='fc -s' $ sleep 5 $ r sleep ^C # abort sleep before finishing $ r sleep ksh: fc: history function called recursively The c_fc() function has some internal state used to prevent recursive invocations that gets out

Re: Regression in "Add support to create and convert disk images from existing images"

2018-10-27 Thread Anton Lindqvist
On Wed, Oct 24, 2018 at 05:51:08PM +0200, Anton Lindqvist wrote: > On Mon, Oct 22, 2018 at 11:05:13AM -0700, Greg Steuck wrote: > > Hi Reyk & Anton, > > > > I upgraded the syzkaller machine from Oct 11 to Oct 21 snapshot and started > > seeing: > > Oct 22 10:

Re: Regression in "Add support to create and convert disk images from existing images"

2018-10-24 Thread Anton Lindqvist
On Mon, Oct 22, 2018 at 11:05:13AM -0700, Greg Steuck wrote: > Hi Reyk & Anton, > > I upgraded the syzkaller machine from Oct 11 to Oct 21 snapshot and started > seeing: > Oct 22 10:00:21 ci-openbsd vmd[15707]: qc2_open: missing base image > /syzkaller/managers/main/current/image > Oct 22

Re: Add bufferevent_setwatermark(3) to manual

2018-09-23 Thread Anton Lindqvist
On Sat, Sep 22, 2018 at 11:41:05AM -0700, Geoff Hill wrote: > New patch included. > > On Sat, Sep 22, 2018 at 07:09:44AM +0100, Jason McIntyre wrote: > > does the "ok" request mean you have commit access? (sorry, find it hard > > to keep track) > > Nope, no commit access, just a user sending up

Re: Add bufferevent_setwatermark(3) to manual

2018-09-22 Thread Anton Lindqvist
On Fri, Sep 21, 2018 at 06:36:54PM -0700, Geoff Hill wrote: > Hello tech, > > I noticed the event(3) manual pages don't mention the > bufferevent_setwatermark(3) function and glosses over the details of > watermarks, even though there's a few programs in userland that set both > read and write

Re: [patch] rebound: add NULL pointer checks

2018-09-08 Thread Anton Lindqvist
On Sat, Sep 08, 2018 at 11:48:35AM +0200, Clemens Goessnitzer wrote: > > > On 08/09/18 11:40, Theo Buehler wrote: > > On Sat, Sep 08, 2018 at 11:07:30AM +0200, Anton Lindqvist wrote: > > > On Fri, Sep 07, 2018 at 09:22:33PM +0200, Theo Buehler wrote: > > > >

Re: [patch] rebound: add NULL pointer checks

2018-09-08 Thread Anton Lindqvist
On Fri, Sep 07, 2018 at 09:22:33PM +0200, Theo Buehler wrote: > On Fri, Sep 07, 2018 at 09:15:30PM +0200, Clemens Goessnitzer wrote: > > This patch adds 2 missing NULL pointer checks to rebound.c after malloc(). > > The same function also contains an unchecked calloc. Since it's a daemon I guess

kdump: recognize kcov ioctl commands

2018-08-29 Thread Anton Lindqvist
Hi, Note that you must be running a fairly recent snapshot including the sys/kcov.h header in order to compile. Comments? OK? diff --git Makefile Makefile index e1918ae6a70..9c1416f12ef 100644 --- Makefile +++ Makefile @@ -39,6 +39,7 @@ ioctl.c: ${.CURDIR}/Makefile ${.CURDIR}/mkioctls

kcov: rename struct kd -> kcov_dev

2018-08-26 Thread Anton Lindqvist
Hi, The terse named struct kd was initially fine since it wasn't used outside of dev/kcov.c. Since struct proc now includes a pointer to such struct it definitely deserves a more descriptive name, as reminded by visa@. Comments? OK? Index: dev/kcov.c

Re: kcov: trace threads

2018-08-24 Thread Anton Lindqvist
On Thu, Aug 23, 2018 at 08:16:06AM +0200, Anton Lindqvist wrote: > Hi. > Currently kcov is enabled on a per process (pid) basis. A process with > multiple threads therefore share the same coverage buffer which leads to > non-deterministic results. Instead, kcov should be enabled on a

kcov: trace threads

2018-08-23 Thread Anton Lindqvist
Hi. Currently kcov is enabled on a per process (pid) basis. A process with multiple threads therefore share the same coverage buffer which leads to non-deterministic results. Instead, kcov should be enabled on a per thread basis; just like how kcov behaves on Linux and FreeBSD. The decision to

ffs_write: include vnode type in panic message

2018-07-21 Thread Anton Lindqvist
Hi, A minor correction, include the vnode type just like ffs_read() does when it encounters an unsupported type and panics. Comments? OK? Index: ffs_vnops.c === RCS file: /cvs/src/sys/ufs/ffs/ffs_vnops.c,v retrieving revision 1.91

vmctl: improve error message

2018-07-03 Thread Anton Lindqvist
Hi, Stopping a VM owned by root as a non-root user fails with the following error message: $ vmctl stop test vmctl: terminate vm command failed: Invalid argument I think favoring warnc() with the appropriate errno number passed along improves things. This of course is under the assumption

Re: kqueue: move members from filedesc to kqueue

2018-06-15 Thread Anton Lindqvist
On Fri, Jun 15, 2018 at 10:22:42AM +0200, Mark Kettenis wrote: > > Date: Fri, 15 Jun 2018 09:59:47 +0200 > > From: Anton Lindqvist > > > > On Tue, Jun 12, 2018 at 09:00:14PM +0200, Anton Lindqvist wrote: > > > Hi, > > > This diff moves the k

Re: kqueue: move members from filedesc to kqueue

2018-06-15 Thread Anton Lindqvist
On Tue, Jun 12, 2018 at 09:00:14PM +0200, Anton Lindqvist wrote: > Hi, > This diff moves the kqueue related members from struct filedesc to > struct kqueue with the prime motivation of fixing a panic in > knote_processexit() that can occur when the filedesc is gone. > Since filede

kqueue: move members from filedesc to kqueue

2018-06-12 Thread Anton Lindqvist
Hi, This diff moves the kqueue related members from struct filedesc to struct kqueue with the prime motivation of fixing a panic in knote_processexit() that can occur when the filedesc is gone. Since filedesc is no longer shared between kqueues belong to the same process, I added a list of the

Re: hashinit(): power of 2 fast path

2018-04-29 Thread Anton Lindqvist
On Sun, Apr 29, 2018 at 10:52:27AM +0200, Mathieu - wrote: > Disregard that, brainfart on my side. > > Mathieu - wrote: > > Anton Lindqvist wrote: > > > Hi, > > > If the elements argument passed to hashinit() is a power of 2 there's no > > > need to fi

hashinit(): power of 2 fast path

2018-04-28 Thread Anton Lindqvist
Hi, If the elements argument passed to hashinit() is a power of 2 there's no need to find the closest power of 2 that can fit all elements since elements == hashsize will always be true. During boot of a stock amd64 kernel running inside vmd 80% of the calls to hashinit() includes a power of 2

patch(1): remove unused header

2018-04-07 Thread Anton Lindqvist
Hi, Since patch(1) no longer invokes ed(1), pathnames.h can be removed. _PATH_TMP is still used inside patch.c but including paths.h is sufficient. Comments? OK? diff --git usr.bin/patch/patch.c usr.bin/patch/patch.c index fef7df6466e..af142599340 100644 --- usr.bin/patch/patch.c +++

Re: What does the struct xen_softc represent?

2018-03-25 Thread Anton Lindqvist
On Mon, Mar 26, 2018 at 12:17:22AM +0530, Pratyush Yadav wrote: > Hi everyone, > > I was looking at the Xen drivers in sys/dev/pv/xen.c and I noticed a struct > very frequently used, the xen_softc struct. I am new to Xen and kernel > programming in general and couldn't understand the use of this

Re: ksh: __func__ in warnings

2018-03-15 Thread Anton Lindqvist
On Thu, Mar 15, 2018 at 08:37:06AM +0100, Anton Lindqvist wrote: > On Tue, Mar 13, 2018 at 04:39:16PM +0800, Michael W. Bombardieri wrote: > > Hello, > > > > Some errors and warnings printed by ksh have the function name > > prefixed. __func__ could be used

Re: ksh: __func__ in warnings

2018-03-15 Thread Anton Lindqvist
On Tue, Mar 13, 2018 at 04:39:16PM +0800, Michael W. Bombardieri wrote: > Hello, > > Some errors and warnings printed by ksh have the function name > prefixed. __func__ could be used here instead of hard-coding > the name. The names are wrong for tty_init(), j_set_async(), > j_change(),

Re: ksh: bug with quoted parameter expansion

2018-01-25 Thread Anton Lindqvist
On Wed, Jan 24, 2018 at 04:15:24PM +0100, m...@josuah.net wrote: > I found a bug in ksh's parameter expansion on an edge case: > > true $(true "${USER#'"'}") > > /home/sh[4]: no closing quote > > The problem seems to occurs when all of these conditions are present: > > 1. On

Re: disabled code in ksh tree.c

2018-01-20 Thread Anton Lindqvist
On Tue, Jan 16, 2018 at 04:29:59PM +0100, Jeremie Courreges-Anglas wrote: > On Mon, Jan 15 2018, "Michael W. Bombardieri" <m...@ii.net> wrote: > > On Sun, Jan 14, 2018 at 05:47:43PM +0100, Jeremie Courreges-Anglas wrote: > >> On Sun, Jan 14 2018, Anton L

Re: disabled code in ksh tree.c

2018-01-14 Thread Anton Lindqvist
On Thu, Jan 11, 2018 at 03:25:15PM +0800, Michael W. Bombardieri wrote: > Hello, > > Revision 1.9 of tree.c (from 1999) added the disabled code and it > is still disabled. Would it be better to remove it? Fine with me. Anyone else willing OK? > - Michael > > > Index: tree.c >

ksh: ulimit optstring

2018-01-14 Thread Anton Lindqvist
Hi, Stop constructing the optstring passed to ksh_getopt() for ulimit at runtime. While here remove ifdef RLIMIT_VMEM block since it's not defined. Comments? OK? Index: c_ulimit.c === RCS file: /cvs/src/bin/ksh/c_ulimit.c,v

  1   2   3   >