Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4730365rdb; Fri, 15 Sep 2023 10:27:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxDuxWefQ2Ee+OEJSbgfin2PqQhiVFidAiyg5ef8qZgaPNEO/dE35haVSTSeLX2TMbgkWs X-Received: by 2002:a17:90a:9bc6:b0:274:638d:409e with SMTP id b6-20020a17090a9bc600b00274638d409emr2021491pjw.22.1694798839501; Fri, 15 Sep 2023 10:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694798839; cv=none; d=google.com; s=arc-20160816; b=SECdnRUIrorCV6wgg02NLuzzKwO5MDpj8asctLtcbgO/yvIg9ffIuhvRbad6j0voF2 dy+4ZY2MmgzeV7MyuIquCs+7dRozZswONh36KCWlrem3fcq0HjKDklYIv9tVWfJmOrbR L+o9AaNz3ylDI57lYKl3cH4JkEsKp2aeoNao82U0zVIQwTZOE5K/eGOzRKDMVythlhCE EOEr4eZYzxO03uo46L4ghwSz6Da8IzRJ6TFg9UAoZnp/JXW7fa27Xczuuofp7NfgiHv5 f9vl1sybefQWUfNC9g6CGWhHQ8nBvTPReubqC0OT5bq4iFSZrkIfI3cgh7nAbfkX1W0V RXyQ== 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-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=328Jdrb2fZ5ZeD++O6N1acm+mpPXCsp0leB/sLzqYjY=; fh=ynSMyPFtcDCsrqY8ZT9n/XHAtieBbZi8AMcHpdQ+ZYQ=; b=IVs0YIP+DtGUbjgOTunfJ5tGDoflklOL5kmPZuq2sr95ffV6pLbBFKSWx55VrNgYkz OFq9Tcc+1n8UyAu5n+B/6sVRliIdMhwfVFSlZuiHqok8UBSveEmzVoxGvwUuxH33lfw4 Y+ey8u3lPPa3vi9N30+gi6wNVCaP03zLtW51OqaGofGvfLZ39BylO3RGEZzg7beda8v7 abZvz65wwVC7Hm01bsIg/EWLJy3+teBt5R+nAGy6mlIPZS4DNKF5644Q/6U08I+aZ0Fj tUwtQYAp1QPoSl8nA5dPDu45ufR23eSiZcl22zxs4tAKjm4TMBXDD/MKMSXAoXYG+tLn a2Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VcBRbq9k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s8-20020a17090a764800b00263f3d759cdsi3619424pjl.78.2023.09.15.10.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VcBRbq9k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id B279C80B02B8; Fri, 15 Sep 2023 09:26:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234752AbjIOQ0D (ORCPT + 99 others); Fri, 15 Sep 2023 12:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234904AbjIOQZt (ORCPT ); Fri, 15 Sep 2023 12:25:49 -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 ESMTP id 9FC66BB for ; Fri, 15 Sep 2023 09:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694795095; 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: in-reply-to:in-reply-to:references:references; bh=328Jdrb2fZ5ZeD++O6N1acm+mpPXCsp0leB/sLzqYjY=; b=VcBRbq9kH/6va+cf6Axea8Rt5GDnSqD5MpI1lrLS12lkk9TpukRl6J5Io3P+Wh0V6yYn5P mJ1P+nTgjDzEtpAfEgRlqEeNKO/Rtzb/hGr4k6KFBB9Or0GZzyBSUErEh494F0J4dF0FBN F2TkF6Hgjl37ts4D1XBd5Bto42C8Yz0= 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-631-c4PbsJe8Oy6116Keg8z8zg-1; Fri, 15 Sep 2023 12:24:42 -0400 X-MC-Unique: c4PbsJe8Oy6116Keg8z8zg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 53FAF811E86; Fri, 15 Sep 2023 16:24:41 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 137D840C2070; Fri, 15 Sep 2023 16:24:39 +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: Eric Dumazet Cc: dhowells@redhat.com, syzbot , 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: <3793722.1694795079.1@warthog.procyon.org.uk> Date: Fri, 15 Sep 2023 17:24:39 +0100 Message-ID: <3793723.1694795079@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 15 Sep 2023 09:26:38 -0700 (PDT) I think the attached is probably an equivalent cleaned up reproducer. Note that if the length given to sendfile() is less than 65536, it fails with EINVAL before it gets into __ip6_append_data(). David --- #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #define IPPROTO_L2TP 115 #define OSERROR(R, S) \ do { if ((long)(R) == -1L) { perror((S)); exit(1); } } while(0) static char buffer[16776960]; int main() { struct sockaddr_in6 sin6; int ffd, dfd, sfd; ffd = openat(AT_FDCWD, "cgroup.controllers", O_RDWR | O_CREAT | O_TRUNC, 0); OSERROR(ffd, "cgroup.controllers/f"); OSERROR(write(ffd, buffer, sizeof(buffer)), "write"); dfd = openat(AT_FDCWD, "cgroup.controllers", O_RDONLY | O_NONBLOCK | O_DIRECT); OSERROR(dfd, "cgroup.controllers/d"); sfd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_L2TP); OSERROR(dfd, "socket"); memset(&sin6, 0, sizeof(sin6)); sin6.sin6_family = AF_INET6; sin6.sin6_port = htons(0); sin6.sin6_addr.s6_addr32[0] = htonl(0); sin6.sin6_addr.s6_addr32[1] = htonl(0); sin6.sin6_addr.s6_addr32[2] = htonl(0); sin6.sin6_addr.s6_addr32[3] = htonl(1); OSERROR(bind(sfd, (struct sockaddr *)&sin6, 32), "bind"); memset(&sin6, 0, sizeof(sin6)); sin6.sin6_family = AF_INET6; sin6.sin6_port = htons(7); sin6.sin6_addr.s6_addr32[0] = htonl(0); sin6.sin6_addr.s6_addr32[1] = htonl(0); sin6.sin6_addr.s6_addr32[2] = htonl(0); sin6.sin6_addr.s6_addr32[3] = htonl(1); OSERROR(connect(sfd, (struct sockaddr *)&sin6, 32), "connect"); OSERROR(sendfile(sfd, dfd, NULL, 65536), "sendfile"); return 0; }