From nobody Wed Sep 11 14:45:44 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 4X3jzy4nYrz5Tcrj; Wed, 11 Sep 2024 14:45:50 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X3jzx5rCJz3y0F; Wed, 11 Sep 2024 14:45:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3e03f8ecef8so1999103b6e.1; Wed, 11 Sep 2024 07:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726065948; x=1726670748; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=7IT51rZH7mZyY0Jx46CtlP3QQxz1F3Q2Jp7zD8BiOxE=; b=loSLTtp5JsDuPlb9ahh7rnRJmtnC6WUnmVYoxokr8J+Vm+e82v2QJsxo/lEg1vU2t+ Zm4abwUf5y94Td3Zxvnw5AA6TJyZ2WJ63BqjVi0uaMzaJEaKgstSatr4q/lBSbGzbzYo Vd8GXJw3m64Q1deiKRzSTuwwCBQekSODnIOHpUodX5uQjD2LSLRjWmk6aO0vJxgqsT6D b3cPq7b+I2AgcbCDb3kU8rF75DYuJl3RuiuYN+L1+KzBniBbX7l8AlYxfjBWo7jIp3Ux gjXMTE4bApJ3u8/E8OAWGQD5Zb4V3o2wOf8Y9u1j++x7Cmjo7KPk3aTuvv6zUvjQDtqU NedQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726065948; x=1726670748; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7IT51rZH7mZyY0Jx46CtlP3QQxz1F3Q2Jp7zD8BiOxE=; b=KnLm1DQq8/6bvMH2qagG6jl9m56Y20FTWoSkRTMPoASw+b4FQQlXeOTnOS+QdZ6LTX zMNUKEWe2y86O7uTvYjndK7RWNTfUqT62e9atO4rfcD9jQaop2lQUs5kkUGbNUSN4RoM b7MKnyjMlvQfW7BjKNofiN+4y2CeVlTl7jnQ0ium5AJipg2xKYm16PWFP2e8WMlJSPNn hVxX/Gjl14/NlSRruBtBCII7Uo00zypuTcrAtZCu91CrzInSeino5Wh4R11nh+GI39aQ 6Ix1AVUcPUkkfTtPpvYXzs8yUQNcWqWjTcDNRYRTcH1LxJ/bx7RJ23NUvEBKqQrghhMD sNVg== X-Forwarded-Encrypted: i=1; AJvYcCVkMFjRZqgP3elbRd5EpxmI8+w1jlv3F6Ie+X6NcEzQLzgC5XG9hKbhK/pGXz1Yzz+7Sv71WrqtW8dqfLwTeAtjZPTF83A=@freebsd.org, AJvYcCWDE7qYXv0qQUTT2vZteqlrnZ+YTh+tiFl9abS64MolJlICqn1Gh5DOZ7p/Jjyn0vqjX0xLhbf1yweKN0QYZWb/qOay@freebsd.org X-Gm-Message-State: AOJu0YyTdAMs+gVqz/6Wzqy9imFhDfczfZbc1EpSy8UpFyE4LbYC8a1T vdrWElllo5NTM60scd6CzBiOaqgGsP6f/j3tLpSRd6l+D5nMcQbWQxl7wg== X-Google-Smtp-Source: AGHT+IGFfZNkTmASUtUCxFKSCkHcerGXtmMcAGHCedj5Lw4JslN8jnXPNMmYCIHrt1GTrw1P1ky5BA== X-Received: by 2002:a05:6808:1a21:b0:3e0:3981:194e with SMTP id 5614622812f47-3e039811e00mr11021296b6e.20.1726065947562; Wed, 11 Sep 2024 07:45:47 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822f957easm41744401cf.86.2024.09.11.07.45.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:45:46 -0700 (PDT) Date: Wed, 11 Sep 2024 10:45:44 -0400 From: Mark Johnston To: Kristof Provost Cc: 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 Message-ID: References: <202409111118.48BBIQ2h065089@gitrepo.freebsd.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <202409111118.48BBIQ2h065089@gitrepo.freebsd.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4X3jzx5rCJz3y0F On Wed, Sep 11, 2024 at 11:18:26AM +0000, Kristof Provost wrote: > 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. This change still triggers a panic for me when running KTLS tests. I note that EXTPG mbufs always have M_RDONLY set, but I'm not quite sure why. I suspect such mbufs need special handling with respect to the new assertion. syzbot also triggered this panic: https://syzkaller.appspot.com/bug?extid=58c918369f9dc323409d > 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;