From nobody Wed Sep 11 11:18:26 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 4X3dNf6nvPz5WRcF; Wed, 11 Sep 2024 11:18:26 +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 4X3dNf599pz4Xl1; Wed, 11 Sep 2024 11:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726053506; 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=cZxif6VuDBgQqxruPL0u5HTUDNLnGd9k1muaF6iLIMU=; b=uVty1NGtN/cSLlty0JEoi5FZRhgSKuNkP3pMsAK1RjDSC1LnCdKfMPLM9wf1BuvtyjzEFz 2HpKO+dnvVN1pt+AAWl67h3qbZFfu2lTqxzliEjfw1uAWFWsR4eJsv9puE9dDDueoGznqW k9W/FIDdM/Bn1YaDlKxyloeS1986KqnGMV56b4Pb5ExA5fQfWVy9Zy3TKdOQ2+2Ep3pd5K /iZhodFPAzGVMO/n2N9iItYBFP5Jq5Vs9uYj+yhjq6Us0ToVJw4DTVVi0ypQlozLcbMCX7 bew5suRFsFUSR67z8r3CSJ9gKNJzIqOGcI5jKBUx/dG6vYMAgrwTQlo09Q/bfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726053506; a=rsa-sha256; cv=none; b=YvehT5jh/KAqzlASmdVBE4fsuQ8xBhbQh9ZBBcvl+hH7FCP73JSyR33N2z8FGzJ2DFWGSn TIP5Q2o/ZMlveGBgjxosPVaBOMIfAoP2sWEun1j3f3a3/Jsj3Ua43sWWb2icNQ94p/6V/r goGVMoxFdDIILfKvJT5BGHaY30+mh0nDcAsBjZEi+r1O216wb1BSVhAi3dxGvkXqNPRd2+ A+FCnWtosnW61zqhM8b4ZZDXR3TsxwJCVc/H/NQVgOmhmkb9Jynqos4sOyLMxh7ovTYEdl xcoooS7xzQvpmsdjcHadse4pfIocOigDMNQasF4w4WlLRDBFcG2NvLSaVoCQ6Q== 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=1726053506; 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=cZxif6VuDBgQqxruPL0u5HTUDNLnGd9k1muaF6iLIMU=; b=HlKTThZ2k035Vovkk087kmjaNMUL01ttkeHoTsNvvoPQtizfXCHd8Ysob/QjyopWl2jNuh 6oc4DYTfJNbAB1U3bkldB5cfrLoe/517KoHk895j22aUABa2HMrNe6mANmEAe5pEZQdXUx bUYM4G96lbQSQ/eBJ29KPvTZVaG+ht7cw37wJ/GSlaBaKjuedtPsitaKPcS1kg0nRhIH6j uajTxOkU08gbsZgB7bokWqh6a/nFYT2t+Pr1JWv639sSda5d9PWcjNsSJEFCy3PPOGfEaR d3/x+maZ/uAmMIlRxP4j504cnGEp6OXa/G+S+ULsN32iFGtRTZc2P6H1eh822g== 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 4X3dNf4mspzSZr; Wed, 11 Sep 2024 11:18:26 +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 48BBIQ3V065092; Wed, 11 Sep 2024 11:18:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48BBIQ2h065089; Wed, 11 Sep 2024 11:18:26 GMT (envelope-from git) Date: Wed, 11 Sep 2024 11:18:26 GMT Message-Id: <202409111118.48BBIQ2h065089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f08247fd888e - main - Assert that mbufs are writable if we write to them 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f08247fd888e6f7db0ecf2aaa39377144ac40b4c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f08247fd888e6f7db0ecf2aaa39377144ac40b4c commit f08247fd888e6f7db0ecf2aaa39377144ac40b4c Author: Kristof Provost AuthorDate: 2024-09-10 20:15:31 +0000 Commit: Kristof Provost CommitDate: 2024-09-11 11:17:48 +0000 Assert that mbufs are writable if we write to them m_copyback() modifies the mbuf, so it must be a writable mbuf. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46627 --- sys/kern/uipc_mbuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index f6ce9b5cc74b..3232af880925 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1280,6 +1280,8 @@ m_copyback(struct mbuf *m0, int off, int len, c_caddr_t cp) if (m0 == NULL) return; + + MPASS(M_WRITABLE(m0)); while (off > (mlen = m->m_len)) { off -= mlen; totlen += mlen;