From nobody Thu Sep 12 11:41:09 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 4X4FrS2ybBz5WHv3; Thu, 12 Sep 2024 11:41:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X4FrS2W2Pz51py; Thu, 12 Sep 2024 11:41:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726141272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yLBl1hn3aKupCMuuiqTj+dnD2aLaWMnZpcixT7HJrwE=; b=wkRAX/Jdw4Tf561GSTNP0jDCkbY6tLPeS7NodvqrCYMOE8Emj5FPYEHmp3IT6Ek/DaauYP /fi2BVWhPAFYWaTXLygqvKxJu9NRl69x/GMfrX5W7pzc5Kz+yOFm9+MvP4wCxbE7Qr+//1 TiURIJXpBVdYOpIAqNEGDHef38pRI2WtLOed6Hlr++xHK90Wgu2dDw82zlMu7Q+WZ9RuWc XBlEtHm77E7BtG5PTY25/QFO8F0hnamALcc7E/AVwUEr9/0TJSP/9h6QQJunS4HMjsC2Uf S489sBvWRYomDu6SB2OSL8Tya9H6TNYzQt3n+Vv0vB7trhnU37+iZluLXi9Xkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726141272; a=rsa-sha256; cv=none; b=MD1/bgYifO6DicC7JjGUGrqiF7CZRSy1uHniH9HdWdwJo48VhjWD8yCAp5G1F2/Y99Spgc EyR3IlB9+UrZ8Dos10OF7S5PVWgE+EkqrlrDpeKvQHcfecC+ZhHmkcg/6iq3dEFlcvyREg qEAd06OcdZCW6NZ8kNlFlPmREfeUMI8xsdjBge2n1bbPPGnFIQ4+FvOEB7gfjdVqIhV/rp FVsLPCjmoTwnIMcYQukFQGOvJZHzPrqC2QTYDFPtU4R+uKUxHHtJBOrvifQPd0cFxgbG2N gbYIvENUfTpxFhTf5wUNknF3hBQl0IOzT+1e8Pb8C+BcLRoRif5gERSvQXQSng== 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=1726141272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yLBl1hn3aKupCMuuiqTj+dnD2aLaWMnZpcixT7HJrwE=; b=QwdrTv+vHVJ+tp6GMp5DcMvwAsTnh9PSmU/XoI0cDsYPSkVxVT39u9KXzoMyiJ95WuBiQ/ jnzBwpuVk7H47ZLYSKvHqUzQRXWEehNxW7uU2ORz1AGZ61pwkDQE0opnfYEh7eO7bGd9bt +JbH1uyGoqc+uSSVfA8rpJ9EA7gO7JSBwUwssAOr8RsnGgW7JGqC0DDw0s7fabzfAYLGaH 4F+xoXKDuWIU+gf9P8qmv2xRFN2oJCFT9v1B5NeIYuGUQIMyJOzaeVHW5f/PKTi9I/aMkQ z35xMNCO/SglUECQOPOwxXxpeGF4W6wM6RxV4I8zeG9vut6+5qQBxpI1rQvOiQ== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R11" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X4FrS1Vw7zNr1; Thu, 12 Sep 2024 11:41:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id AE06251018; Thu, 12 Sep 2024 13:41:10 +0200 (CEST) From: Kristof Provost To: John Baldwin Cc: Drew Gallatin , Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f08247fd888e - main - Assert that mbufs are writable if we write to them Date: Thu, 12 Sep 2024 13:41:09 +0200 X-Mailer: MailMate (1.14r5937) Message-ID: <61045FAC-D1C5-42AE-BE1B-757AC2222554@FreeBSD.org> In-Reply-To: <1f61b6de-0fe2-4343-b4ad-f0866785a4bc@FreeBSD.org> References: <202409111118.48BBIQ2h065089@gitrepo.freebsd.org> <2b1955e2-fbf1-41cb-b256-a9a257b16a83@FreeBSD.org> <1f61b6de-0fe2-4343-b4ad-f0866785a4bc@FreeBSD.org> 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: quoted-printable On 12 Sep 2024, at 11:40, John Baldwin wrote: > On 9/12/24 05:03, John Baldwin wrote: >> I think part of the motivation for marking M_EXTPG as read-only is tha= t you can't "write" >> to m_data via mtod() or the like. That said, M_EXTPG aren't really re= ad-only. It >> depends on the backing store. M_EXTPG were first merged into FreeBSD = prior to KTLS to >> support sendfile, and in that case, they should be M_RDONLY because th= ey alias pages >> from the file's VM object. However, M_EXTPG mbufs allocated via funct= ions like >> m_uiotombuf_nomap should not be M_RDONLY. I think this originated in = the original >> import of KTLS which doesn't push setting M_RDONLY out to the callers = of mb_alloc_extpgs, >> and a few other places that hardcode M_RDONLY with M_EXTPG (_mb_unmapp= ed_to_ext should >> preserve M_RDONLY from the original mbuf instead of forcing M_RDONLY).= >> >> I can take a stab at a patch but won't have time to really test it unt= il after Euro. > > Patch available below. Compile tested but not run-tested: > > https://github.com/freebsd/freebsd-src/compare/main...bsdjhb:freebsd:m_= extpg_rdonly > I=E2=80=99m still seeing a panic (with the extra assertions from https://= reviews.freebsd.org/D46572 in opencrypto) in ktls_test:ktls_receive_aes12= 8_cbc_1_1_sha1_long. It=E2=80=99s unhappy because there=E2=80=99s an mbuf with m_flags =3D 0x2= 001 (so M_EXT | M_PROTO1) that has an ext_cnt of 2. It=E2=80=99s not urgent, I=E2=80=99m mostly interested in these assertion= s to catch bugs like 280036 sooner. I=E2=80=99ll also be at euro, I can g= ive you access to a box that trivially produces this panic then. Best regards, Kristof