From nobody Mon Aug 05 16:46:28 2024 X-Original-To: dev-commits-src-all@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 4Wd2QD4llkz5SL92; Mon, 05 Aug 2024 16:46:28 +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 4Wd2QD2vPKz4dVs; Mon, 5 Aug 2024 16:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722876388; 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=NjPhvVaJqTFkWyIVNGg8p8WckB1D2dTXZTbPkzkWYqI=; b=pdm02SHb9tYRJLDRGrCqPW1PyUs/dHzPqqsvx8kRZT/gQvTiQiKDzhaGwp5GBfYlxul7ie 60Epocp6CA1lkMyTQf6snMhwreT63RVlZTjCYhroRpxnfyPrQ3ZnzC4w8JgIa9OcPspt7h tmlOKL/COlfkzJM9qfrnUWZ1CWkawEcEBRbkM/7qXU8sEimuRqQ8d4Lu7jL8Q6XMtz7IdZ X1rZu5bORv49w+MpN6yY65QeMdSK7kYK2hXZ+ion21jtnvEO/PA+nwxSxLzKA9osQfHsa/ jpmK4kMR5Zl+hK+7IlWxepJFVlvHzY3m3JjusXB5zsSTN8MHoHa8DnayxSQBDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722876388; a=rsa-sha256; cv=none; b=IoMnm0li27/SAko74UV8blhLNmqMqJpu8X3KXUJKSbN2JL9Eg2cnWiJmuKS7OTLDcIC7QL E5wNkehvJqGl8jSDCXhgfJIAh92sVdz5cZR0oT2o16sRHmbYu9wxf0OAmyT7fvfeXe4xaO pSkRo6fX1CEjwkIfs8JTBvXvZ7Syo2g8vqWvV7VsTU/DxIib6re5vTYrrXTkwMvXvyUUt4 3WPM7Pb7RpgdNtuJtPEejeHZv9oli9DGGRQQF0cp/F/GoJItnAGLlShPocfC+GG9bSdBCo T+GdYWGpu1t0oxp58UfMwsE8E7TpbaUCY/PddEHtEOjCBCZp8+D9bQtwsSj5pw== 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=1722876388; 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=NjPhvVaJqTFkWyIVNGg8p8WckB1D2dTXZTbPkzkWYqI=; b=JdHwS7VYfAg8swcBYvFH5X+nwSILT0UC2XsNrq3Vos/lEhL0PHeFzpruMVgV6nAKGBhCuP 1EMLm9Dz0GilUqib3g2G7PhJNhP7Sn4p7EaU6ONO+hEuF7BaMO+L5IcLwjciMBuo4cnbWD F65QWc2CFgV4qlvecovMzQjPnULL17K99338XLV0vr6coI6F+1yL0unkV7GtQSCmm/7pWp 0Mqo/q5p64OXT+gLbaT70Z43BThA2oAxqayPw6oYi5/KgFf3gHs1sSBIXlRddxJN8tLptg eD0lrkfRs/3IIVz9pp/V1icJs0pKPO8/zLf1gerItGyz/3OiNnBaMfA5kVlxRA== 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 4Wd2QD2VxNzXHM; Mon, 5 Aug 2024 16:46:28 +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 475GkSZd050461; Mon, 5 Aug 2024 16:46:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 475GkSFO050458; Mon, 5 Aug 2024 16:46:28 GMT (envelope-from git) Date: Mon, 5 Aug 2024 16:46:28 GMT Message-Id: <202408051646.475GkSFO050458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 06134ea2f38c - main - malloc(9): Check for M_NEVERFREED List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06134ea2f38ca214b53a1613e110e8332b2804e4 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=06134ea2f38ca214b53a1613e110e8332b2804e4 commit 06134ea2f38ca214b53a1613e110e8332b2804e4 Author: Bojan Novković AuthorDate: 2024-07-31 17:43:31 +0000 Commit: Bojan Novković CommitDate: 2024-08-05 16:44:10 +0000 malloc(9): Check for M_NEVERFREED The recently introduced M_NEVERFREED flag is not meant to be used for regular malloc requests. Enforce this by checking for M_NEVERFREED in malloc_dbg. Reviewed by: alc, kib, markj Differential Revision: https://reviews.freebsd.org/D46199 --- sys/kern/kern_malloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 3c4cb63003c4..9d7e0464e0f7 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -542,6 +542,8 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_type *mtp, once++; } } + KASSERT((flags & M_NEVERFREED) == 0, + ("malloc: M_NEVERFREED is for internal use only")); #endif #ifdef MALLOC_MAKE_FAILURES if ((flags & M_NOWAIT) && (malloc_failure_rate != 0)) {