From nobody Sat Sep 14 01:34:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X5DHT4z6bz5WbWn; Sat, 14 Sep 2024 01:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X5DHT47MDz3xsM; Sat, 14 Sep 2024 01:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726277669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SARI+kOvQPy0a6zYLkPs1OSBKlGEPp6HYT1KImCQaCg=; b=S8Wps1U9yxE/8cVII7dyUAefLXEOngF6NCGl4iXoktEk/X85jNs1uTPUwqJDsx9sAs8/T6 NnxNSW/11pG/tU+slGr6XkskUU8vDQjh+JHtindIMS5N0XaQoMTFth1d/w9nUgSwQJEKRT NJFCSERummF0tP4OI7NCUJ5UgZQW5Bt9vgb8M9vy3PbSQs5nMqAYniaQ+jab530XQNX5NB qfJ866JiOjvnp++JESqKIkXZVND0uHGuVYeA51am/OrElh0VymsipoIEvvkGuFkli3xItc q8/gwD3fo90eJ8YYm97FVRguA7FXkkN1ddxrWRVQu6N3a5sKrGaZK582ivJD0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726277669; a=rsa-sha256; cv=none; b=h4daSoBxIFTbXPIvZTYrffOKEwmZxhHdBE1aByvgsxwYfdNgeKoo6qy7bkwr04y5bybFqJ l720IWl/bflgvYr7J0JgQYU9J+4L8Wik7ZSynGsh9T8m6HXH/qeNtqCG5QhmCZAXGKrQi8 /HhAwrvCgQoTPDIyat8okH+TSPSTwifpSXPnpqMKNBTuJ8CpD7nTd6tCpsqMIIm9pUv5sW fuVM3NKlDBeupvFTx30mZirZwR+dr9TUQqxBMeI5gFcJPuaXI4JLmbWW3EgBoLP2VmqKul LV52A+m/NkQQqj4NqJ2pi17KWNlza04GR9Rz728zB/p4w8FuiLiEFWHo4lcfXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726277669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SARI+kOvQPy0a6zYLkPs1OSBKlGEPp6HYT1KImCQaCg=; b=HUIDamOeGWhXt+4BMPNF+gcz4WoTZ7Qwv30GmGzfklFc9V7ryjXXcPmrOgThm4YW8+hbvO 2FQYQXmr5z3xENxAPoeJgwpgNMJWWwTGXxd7YUXl9HIStt0EHyE+KpzrI3V48Amn2E8Zq6 iGknROLcJ1GZb9ULa9ej0qnz71Bl9/vHbI9BruTS8lrX95WBBSpooWDdt9I3aODBM83bbp QZW1x61vigOKx7RTT+KhY92wgoASNHC1ki12Q4WCwg7XOfhtWIGNCHxfgdBtgIs4XtUgkk tWiE8nJw/4JFjrVH6jhwPugsO679YdgkwNYfO4ewpZeWiWgyTYqyoztNo1GCJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X5DHT3kmyz16gR; Sat, 14 Sep 2024 01:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48E1YTjP021038; Sat, 14 Sep 2024 01:34:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48E1YTlS021035; Sat, 14 Sep 2024 01:34:29 GMT (envelope-from git) Date: Sat, 14 Sep 2024 01:34:29 GMT Message-Id: <202409140134.48E1YTlS021035@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 47112d359b36 - main - kassert: Remove KASAN marking from DEBUG_POISON_POINTER List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47112d359b36899893a386f572bd1a4ab007e8a2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=47112d359b36899893a386f572bd1a4ab007e8a2 commit 47112d359b36899893a386f572bd1a4ab007e8a2 Author: Mark Johnston AuthorDate: 2024-09-14 01:32:06 +0000 Commit: Mark Johnston CommitDate: 2024-09-14 01:34:12 +0000 kassert: Remove KASAN marking from DEBUG_POISON_POINTER While this approach works for trapping reads of an uninitialized pointer, it means that any attempt to store to the variable triggers a KASAN report, which is not what we want. Simply remove the kasan_mark() call. KMSAN will catch these kinds of bugs automatically anyway. Reported by: syzbot+c5e279db5763b58e8d69@syzkaller.appspotmail.com MFC after: 1 week --- sys/sys/kassert.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/sys/kassert.h b/sys/sys/kassert.h index ab2313bcbd8b..8dcea8352fdf 100644 --- a/sys/sys/kassert.h +++ b/sys/sys/kassert.h @@ -38,8 +38,7 @@ extern const char *panicstr; /* panic message */ #define KERNEL_PANICKED() __predict_false(panicstr != NULL) /* - * Trap accesses going through a pointer. Moreover if kasan is available trap - * reading the pointer itself. + * Trap accesses going through a pointer. * * Sample usage: you have a struct with numerous fields and by API contract * only some of them get populated, even if the implementation temporary writes @@ -61,7 +60,6 @@ extern caddr_t poisoned_buf; #define DEBUG_POISON_POINTER(x) ({ \ x = (void *)(DEBUG_POISON_POINTER_VALUE); \ - kasan_mark(&x, 0, sizeof(x), KASAN_GENERIC_REDZONE); \ }) #else