Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp153588rdb; Mon, 18 Sep 2023 10:45:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIw1++TurC6hWXqfZUVR5ms8A/HC+83jwB8mhpmUOl4Eel/b9613NmKMQEfXBCSwuuJWDF X-Received: by 2002:a05:6a20:5b1a:b0:155:2359:21a2 with SMTP id kl26-20020a056a205b1a00b00155235921a2mr7190856pzb.41.1695059147699; Mon, 18 Sep 2023 10:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695059147; cv=none; d=google.com; s=arc-20160816; b=mof4MMs2mNygunWWF4zMBLYwr5oC/XkpU4RIRTU8YUgAme5EWgUf5FfJu+jOV1d6mU MNcB/hoUQ0T+C9H1vQ66w0WgLAJC8ZLRxOk9kcUtAIMwTHBtWlnq9b1L24HYvhkDHt9M R3Q6s9Fdwo0LUZwLCllgKqFfTZYCAldINoBcXs4UfFK2yO9CE9g2CHr4LfQA4hk5eTQq FFTokOxv6FHDDlCKaoLtC7z2i+Wq/sT1WB+pQKUNM9iszHKqf0uVjRn2Z0C4HW8qbq83 K7ecry08q3aBGDfpWi/TmmaraugpFrqToLONYZoWGUcAiQLCv0GwmNcCBf0jztwXifxP tMnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=TBj38+uZQNDDW4zck8GIvLmvlPHljO+yQXzrJXiozp0=; fh=twXhkBRg6TPTLSAfZh9+zLsEMnuwatYu4eYLA9f4Ki4=; b=JZKJX/hnjmUNW4coeLRUEBs+genJHvwYyJyzBqe82JT6SWHc5WV1OUH8r5YeXUPle3 rDo+QZZpuA939yeS++PhdCkx6njxpS/j5tx0YOrS07bLjUwkXHTI5NTJE1la++51fT33 D2Llsxt01i/v/Oam0qaltHJCr5xUeXX+m9jXEPeuAZ2a71uZK/+1BWzsm5rCzUJBMD+V U6lQ1y1qYHfrum03VMC1zgAvYMFkkiq/F+gLqU680sIIdfYwFCmxZQy5pg4JF3luOGwk kjfN2v3J6Sol8ISR1BaeusSznaYn2B94FksZoMpZBuXduriIV5+qZWkdx6NWxRL5s0Le Jr8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cBkgOD9d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u191-20020a6385c8000000b00547a1922957si8269103pgd.407.2023.09.18.10.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 10:45:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cBkgOD9d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3E4B1807D411; Mon, 18 Sep 2023 03:12:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233330AbjIRKME (ORCPT + 99 others); Mon, 18 Sep 2023 06:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240944AbjIRKLy (ORCPT ); Mon, 18 Sep 2023 06:11:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27011AA for ; Mon, 18 Sep 2023 03:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695031867; 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=TBj38+uZQNDDW4zck8GIvLmvlPHljO+yQXzrJXiozp0=; b=cBkgOD9dJWGaMf4NOE6G1sz1/fvv8qh+DBgln2n1BR9djdyoi3mjA3d2OGhP57Av4RxZsw p2nf5Blflpy/pZ3IfsT5/QQ/EM/GnL3N8x/xCCIYIszrLaDfUhVrPS9nIpthcBGj9DxTKM a0yHJx145A9MX7LAoJuTtTLme4c2ZbU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-q5s-R_rSPeWchfPIfhZ8Kw-1; Mon, 18 Sep 2023 06:11:04 -0400 X-MC-Unique: q5s-R_rSPeWchfPIfhZ8Kw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7F28885A5A8; Mon, 18 Sep 2023 10:11:03 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 479F3492C37; Mon, 18 Sep 2023 10:11:02 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <0000000000001c12b30605378ce8@google.com> To: syzbot+62cbf263225ae13ff153@syzkaller.appspotmail.com Cc: dhowells@redhat.com, Eric Dumazet , bpf@vger.kernel.org, davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [net?] WARNING in __ip6_append_data MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3905312.1695031861.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Mon, 18 Sep 2023 11:11:01 +0100 Message-ID: <3905313.1695031861@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 18 Sep 2023 03:12:38 -0700 (PDT) #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t 65d6e954e378 diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 0665e8b09968..7978335c1fc4 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -1517,8 +1517,10 @@ static int __ip6_append_data(struct sock *sk, rt->rt6i_nfheader_len; = if (mtu <=3D fragheaderlen || - ((mtu - fragheaderlen) & ~7) + fragheaderlen <=3D sizeof(struct frag= _hdr)) + ((mtu - fragheaderlen) & ~7) + fragheaderlen <=3D sizeof(struct frag= _hdr)) { + printk("__%u__: EMSGSIZE\n", __LINE__); goto emsgsize; + } = maxfraglen =3D ((mtu - fragheaderlen) & ~7) + fragheaderlen - sizeof(struct frag_hdr); @@ -1526,8 +1528,10 @@ static int __ip6_append_data(struct sock *sk, /* as per RFC 7112 section 5, the entire IPv6 Header Chain must fit * the first fragment */ - if (headersize + transhdrlen > mtu) + if (headersize + transhdrlen > mtu) { + printk("__%u__: EMSGSIZE\n", __LINE__); goto emsgsize; + } = if (cork->length + length > mtu - headersize && ipc6->dontfrag && (sk->sk_protocol =3D=3D IPPROTO_UDP || @@ -1535,15 +1539,23 @@ static int __ip6_append_data(struct sock *sk, sk->sk_protocol =3D=3D IPPROTO_RAW)) { ipv6_local_rxpmtu(sk, fl6, mtu - headersize + sizeof(struct ipv6hdr)); + printk("__%u__: EMSGSIZE\n", __LINE__); goto emsgsize; } = - if (ip6_sk_ignore_df(sk)) + if (ip6_sk_ignore_df(sk)) { maxnonfragsize =3D sizeof(struct ipv6hdr) + IPV6_MAXPLEN; - else + printk("MAXPLEN\n"); + } else { maxnonfragsize =3D mtu; + printk("mtu\n"); + } = + printk("check %d %zd %d %d, %d %d\n", + cork->length, length, maxnonfragsize, headersize, + transhdrlen, mtu); if (cork->length + length > maxnonfragsize - headersize) { + printk("__%u__: EMSGSIZE\n", __LINE__); emsgsize: pmtu =3D max_t(int, mtu - headersize + sizeof(struct ipv6hdr), 0); ipv6_local_error(sk, EMSGSIZE, fl6, pmtu); @@ -1817,8 +1829,10 @@ static int __ip6_append_data(struct sock *sk, if (!skb_can_coalesce(skb, i, pfrag->page, pfrag->offset)) { err =3D -EMSGSIZE; - if (i =3D=3D MAX_SKB_FRAGS) + if (i =3D=3D MAX_SKB_FRAGS) { + printk("__%u__: EMSGSIZE\n", __LINE__); goto error; + } = __skb_fill_page_desc(skb, i, pfrag->page, pfrag->offset, 0); diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index ed8ebb6f5909..daaaf60dce01 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c @@ -502,6 +502,8 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct ms= ghdr *msg, size_t len) int ulen; int err; = + printk("%s()\n", __func__); + /* Rough check on arithmetic overflow, * better check is made in ip6_append_data(). */