From cf997a4829051254ebcbe913dbcf057e727f4daf Mon Sep 17 00:00:00 2001 From: bluhm Date: Mon, 20 Dec 2021 22:28:48 +0000 Subject: [PATCH] Remove useless suser assert from dt(4). The ioctl(2) path checks the user anyway and close(2) may crash after setuid(2). Reported-by: syzbot+90e094f33d329fb2c3ab@syzkaller.appspotmail.com OK deraadt@ --- sys/dev/dt/dt_dev.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/dev/dt/dt_dev.c b/sys/dev/dt/dt_dev.c index fac53552f8f..439d21fe093 100644 --- a/sys/dev/dt/dt_dev.c +++ b/sys/dev/dt/dt_dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dt_dev.c,v 1.16 2021/10/25 19:51:12 millert Exp $ */ +/* $OpenBSD: dt_dev.c,v 1.17 2021/12/20 22:28:48 bluhm Exp $ */ /* * Copyright (c) 2019 Martin Pieuchot @@ -428,8 +428,6 @@ dt_ioctl_record_stop(struct dt_softc *sc) { struct dt_pcb *dp; - KASSERT(suser(curproc) == 0); - if (!sc->ds_recording) return; @@ -459,8 +457,6 @@ dt_ioctl_probe_enable(struct dt_softc *sc, struct dtioc_req *dtrq) struct dt_probe *dtp; int error; - KASSERT(suser(curproc) == 0); - if (!dtioc_req_isvalid(dtrq)) return EINVAL; @@ -491,7 +487,6 @@ dt_ioctl_probe_disable(struct dt_softc *sc, struct dtioc_req *dtrq) struct dt_probe *dtp; int error; - KASSERT(suser(curproc) == 0); if (!dtioc_req_isvalid(dtrq)) return EINVAL; -- 2.20.1