Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp869641lqp; Thu, 23 May 2024 02:28:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUj+tQjLiikiZArJx0ikEyKrH9tbcRewLciujPNiThURlc27kzmwdDudHN/iTWJmO815blgtLznOgQfs9p1dsRHL4VCnPIMgKM3Fdkslg== X-Google-Smtp-Source: AGHT+IG8+Z6TATTr9Pk/1g2Guc3B161vj3kE+JBOykW+7WFb6v3IIGHhRXXFMeobBDznEwrF+3yI X-Received: by 2002:a05:6a00:1382:b0:6f4:46ea:2f26 with SMTP id d2e1a72fcca58-6f6d60cad33mr4489316b3a.15.1716456524084; Thu, 23 May 2024 02:28:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716456524; cv=pass; d=google.com; s=arc-20160816; b=QN5NXO78KutUvKld+YOoXPcjAmpdjuNDQ7gKps9XbmF6FWpFf/v2huM+39esV4Y/1g a09pa1NDU+4FWsfMeMPyAU5HvQtcqxXXzNn/IRNRJSXCINKheZH9KXx0a7FLyQuxetAe FNolRJ3CcU/au5toyAowhEvJ1r8c8PUNyJ6fgEBKTh8hOjsKRnk2SxAw0K68KDjdAH4A z9rR++ILcwx1PGRtfGBur1OMH1JkB01MQ58D+hwe6A9k0Ua4luMHRXu+hj+pYyJOdKUr MB0AVAckHQvWE2+RJ5XkDequ8PjSeOg/7veoBsLhYgEdjLUoCIEf3ZLcqm7GaxZpz9sW V2tA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:in-reply-to:date:mime-version :list-unsubscribe:list-subscribe:list-id:precedence; bh=s/1v5n2ho6exAPz3FqoiG3p4pmvbzpXZz0rxeJDjWAU=; fh=V9AeBafJgTW96HdC48wsxGAfd7Fe9P2uAL8tLCjpUN4=; b=HU1XWck6Oz6JYVHsiXji8tf2yHv2N5KkM5pSVYshTEO9QcSo7gDZbrBig+BczHb7+5 DdcDfHD5OAQUKEB9OFqIgJ040OO8hsBEXq0f5DbVO7LbH2XMZHHHp/EqzfcDmqwtD4o1 greKF75fUJCef4QmQcJOR6U9B2Sroqvq+Qb82e9dfj/ZYj4v2Hh8t1E0fkHKWycGt12Z CHT9iQOB4tpsvELivEqOpkBIO53iFYv89wFEV2sp7k3w6fei4Bx0zX7Lh62z2jUR9fi/ Lad0aXBnzGOp6LrPK6kacyhLvdPCaPiyp1nT9c6MJM5LgWel/awqVz64iAlAndUrozBN 4W5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-kernel+bounces-187260-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187260-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2aeeea1si27520648b3a.223.2024.05.23.02.28.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 02:28:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187260-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-kernel+bounces-187260-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187260-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CB55D2835E0 for ; Thu, 23 May 2024 09:25:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C7C4142652; Thu, 23 May 2024 09:24:00 +0000 (UTC) Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06B4A7E0F1 for ; Thu, 23 May 2024 09:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716456239; cv=none; b=VvV3rcB50c36t7pE35jjNF/HhWusodJ2/4S1B/SsSt5Q9oqWfJS8YTsrczqjpmYTYkUtXF8VQxNBVNRW5/8OQlQBPflsWnSMrKQfX2XlIqGowZcxyr8yZyaAiHPmDRCdfoLOMTqPADcym4zLYEdUpPmNm/IgDZcZXvH0R/0mgkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716456239; c=relaxed/simple; bh=i/kAXeaeveQl/LhDEZFxa/tIpqb06WoJDHtVFQ3cVDw=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=GhkhtsHo0/2k5ADQrp7KQRUfkIBhxqjagn5qpPYtIVoHRMWnNyQUNWMAhZhjlYa/Em9bzXpDeAObs72MzQ3qMymawoZVli70MU2EPVG9JXI7SQkkG5fLgOzWUU4gAH/7QrY4VivIRb+KkWmapeT/kl2z28PbFIrxPzQHhuvOCGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-7e1d122f75cso134421439f.3 for ; Thu, 23 May 2024 02:23:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716456237; x=1717061037; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s/1v5n2ho6exAPz3FqoiG3p4pmvbzpXZz0rxeJDjWAU=; b=N0b6jVlWodWRihmSPtU6T9VBxzEC9SuIzER4CaRPpkWz/41anukiO9rTzPZFBMTS78 LYrB5/o4nCKB0HQuYlpy/SOgYagpKalOCQC5aM2NBdLiW2gzq8NT0hT0Yw8aB/4iKGcr B+LiZmGQvvvrUz5UmRW2iVzfpTHQCeJM7mS2de0VrkPF6CgnsRzbu5DKtPUPHqKxkhzl O+CYCgK8pgTh63AoLZCyUNVPQxzAnarqSSobQ11nzv+wq7/KlaFv81cx4uBt/pJep+PZ Q69P9qgldG5yx7GZpHTDiCMbReye1MrSKlD1fDGLZB0FzuZe1T3tuBmtr5gZQOjyzL0Y 1lDg== X-Gm-Message-State: AOJu0Ywm/IiGCyD6jYOwzfTJlEinCTVeOoTAOus/F4Iyf1os4sQ2AAva g5pY5qXYmqPjgJKKsRPD9k+ETjYNhxAGD4cWSqRbxDtAkTS1FpjJO075rvMq+IXsBXcMjklLrCm UDWghp4jdxlp3v9MxgQvTsbPPIfb+UNZflV8rNwoBf3LsFUcIbi0M8cs= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6638:8619:b0:488:59cc:eb41 with SMTP id 8926c6da1cb9f-4afe3b2cac9mr173780173.3.1716456237240; Thu, 23 May 2024 02:23:57 -0700 (PDT) Date: Thu, 23 May 2024 02:23:57 -0700 In-Reply-To: <0000000000002fd2de0618de2e65@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <0000000000004b237106191b9c7a@google.com> Subject: Re: [syzbot] [syzbot] [fs?] general protection fault in iter_file_splice_write From: syzbot To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: [syzbot] [fs?] general protection fault in iter_file_splice_write Author: lizhi.xu@windriver.com #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 33e02dc69afb diff --git a/fs/splice.c b/fs/splice.c index 60aed8de21f8..35a99fdabe9c 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -751,8 +751,18 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out, /* dismiss the fully eaten buffers, adjust the partial one */ tail = pipe->tail; - while (ret) { + while (ret > 0) { struct pipe_buffer *buf = &pipe->bufs[tail & mask]; + printk("ret: %d, nbufs: %d, buf len: %u, m: %u, t: %u,ring size: %u, bufs len: %d, %s\n", ret, nbufs, buf->len, mask, tail, pipe->ring_size, ARRAY_SIZE(pipe->bufs), __func__); + if (ARRAY_SIZE(pipe->bufs) <= mask) { + ret = -EPIPE; + printk("oooh, %s\n", __func__); + break; + } + if (!buf->len) { + tail++; + continue; + } if (ret >= buf->len) { ret -= buf->len; buf->len = 0;