Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2896069rwl; Mon, 27 Mar 2023 06:48:36 -0700 (PDT) X-Google-Smtp-Source: AKy350aftlAu9Vx7aS1g5iJBC1RaH6PnIorhTX9lRa1zbal1Ra1dvytz1X/Ho2AEKtI/D15d8nkE X-Received: by 2002:a17:906:b351:b0:931:d36f:8965 with SMTP id cd17-20020a170906b35100b00931d36f8965mr13961007ejb.13.1679924916660; Mon, 27 Mar 2023 06:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679924916; cv=none; d=google.com; s=arc-20160816; b=Uhd1gZ73Y/ztRESrwYGR4X9QASQg/ccLgdA16UIEoQilBbuz//0cOpNMOTcMzg2OcF 7WxvEN499d0WjhkueGcLMmS7Re3/8oL/xOKHJOQFwqSykjuRoe/oKko3UYs9ilR7FY2X KAXJaCyBrnPctCOAwNBGIzIu1MjYTIgvKvyp6pdNTARSE5Wez86wnohQKQ0K8NlJctqQ 9hJmoSO4SQRMX35zhs8l3cFimClVv0cvYmUsx8IBKrTAgrUD41gmelmDnHNFdK2+HD9P wnJ7LsYITL77iWd7HgMMfVjBDz2slo8V+Xk9lUQWTqquna+n3dx7wvhFypfnNc6ve6ly LQLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=qk8mEmXhmkij8TFHjllJ20n3reyRkxB51/J3Ax/p7n0=; b=d7YdUa+P1fIACjeKR4OmTNQQFyd1Gp+Nfwvx69DutHuaurE9tR1xfHRtkbUrlDoOxy sFRcd4lqParw4Q7AuR/PG/em7RkGWuK5WlbmhPTn2IoiRMqn1Gd1I/V9JOMnq3EKb2uy X2YPv27F2VnqNraKgNRCf17b7y32JfWDHquWDNI/5sgk/RMHtE/yB6ji7dLWLb5x3Rm6 VnCYKUgjh+7jT+Mvc88iNQROn4P4O8Wqz4Kfc02uUQ1nkzttMst8qCLhPxHwogczV6KM FndiM/rGQznfC0a9M1mFk5BUgkuknh78SP/YmQVAsWs+Eb1r6QXbK7RQKsYiYV9nF16w TufQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=2Gk3ezhj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk36-20020a1709077fa400b00931bb737922si28330046ejc.222.2023.03.27.06.48.12; Mon, 27 Mar 2023 06:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=2Gk3ezhj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230341AbjC0NgF (ORCPT + 99 others); Mon, 27 Mar 2023 09:36:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjC0NgD (ORCPT ); Mon, 27 Mar 2023 09:36:03 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9713420A for ; Mon, 27 Mar 2023 06:36:01 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id u20so5667760pfk.12 for ; Mon, 27 Mar 2023 06:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; t=1679924161; x=1682516161; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=qk8mEmXhmkij8TFHjllJ20n3reyRkxB51/J3Ax/p7n0=; b=2Gk3ezhjrVnvJZJD1N/OMSWUjmgh1iwcVRjCz3DVGcgZG92GdNw+CFM9I06aJL1Rbf 9NqFfADa9ykfd5bBOwhSyG0ym1BtUuN/beUzlVFRsLBOSJtawH2gL3PyCrmIF1Z/kzt4 JFDp6r4h0ugpkkN6cwOPAx41YYDfcJ35zyGj7VjIblrpEsNh3c536YpA5SEerN46g4JA /WswQ/cu0wfCyUv1eUNyjHrYQ0E0DSbfZDeQQwJ+nsbSjpbt+O8mGUgB/GaA13QRTXqr dTq5nUwrR/dOIIftlofcdDGRnR8Oy+6pSozGNuNx/5/OGTSeu64G9eE1Vym6qk52a8Td oUqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679924161; x=1682516161; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qk8mEmXhmkij8TFHjllJ20n3reyRkxB51/J3Ax/p7n0=; b=lpdJ6Gv4mj5eiRTkKgnEK//zutjv+20qUQQhse747iGfk7Vfhh1Cg7ouC5D5ePMTwI bQ20AK81UcZ4JlsqdV7JPsNDMbgpt/er7hPesI1PDgWXffKWMqd5BThc61amK2f99P6Y bIUxLOJ+Zx2foH6dlofIZ/IgAxxy1Mw8STd2nXO+cnbo3u8MC/EybBz+72QKFObxAXKK jXwEMbVrAteUEC76XIKygEY0/XJVGNSGJtYusO3lQDDqfmqo7dxMZoUj8T2Fj0PKCkBW 87Yk+udrmAQgwm4rTxwJA1H0HJqNN9/0hkSV/fZ6Y4jx/e0LCN7b7K/VS1PZe5+DkXh+ Ppvg== X-Gm-Message-State: AAQBX9f9YeaPJdaZTDyB3IeG//yayNGRoWvLChdQdnVTQfpwD0klq0aB jdzWcU1UBD/SyaBi/lvpX1Uu5A== X-Received: by 2002:aa7:8b1a:0:b0:628:630:a374 with SMTP id f26-20020aa78b1a000000b006280630a374mr10585278pfd.2.1679924160975; Mon, 27 Mar 2023 06:36:00 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id p26-20020aa7861a000000b006249928aba2sm19038827pfn.59.2023.03.27.06.36.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Mar 2023 06:36:00 -0700 (PDT) Message-ID: Date: Mon, 27 Mar 2023 07:35:59 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [Syzkaller & bisect] There is "io_poll_remove_entries" NULL pointer BUG in v6.3-rc4 kernel Content-Language: en-US To: Pengfei Xu Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, heng.su@intel.com, lkp@intel.com References: From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=3.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/27/23 12:08?AM, Pengfei Xu wrote: > Hi Jens Axboe and kernel experts, > > Platform: x86 platforms > There is "io_poll_remove_entries" NULL pointer BUG in v6.3-rc4 kernel. > > All detailed log: https://github.com/xupengfe/syzkaller_logs/tree/main/230327_041425_io_poll_remove_entries > Syzkaller reproduced code: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/repro.c > Syzkaller analysis report0: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/report0 > Syzkaller analysis status: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/repro.stats > v6.3-rc4 issue dmesg: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/v63rc4_reproduce_dmesg.log > Kconfig: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/kconfig_origin > Bisect info: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/bisect_info.log > > It could be reproduced in v6.3-rc3 and v6.3-rc4 kernel, and bisected between > v6.3-rc3 and v5.11 kernel, bad commit was: > " > c16bda37594f83147b167d381d54c010024efecf > io_uring/poll: allow some retries for poll triggering spuriously > " > After reverted above commit on top of v6.3-rc3 kernel, this issue was gone. This should probably fix it, though I do wonder why this can only trigger after that patch. Seems like it would've been possible before too. diff --git a/io_uring/poll.c b/io_uring/poll.c index 795facbd0e9f..90555a22a900 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -600,7 +600,8 @@ static int __io_arm_poll_handler(struct io_kiocb *req, mask = vfs_poll(req->file, &ipt->pt) & poll->events; if (unlikely(ipt->error || !ipt->nr_entries)) { - io_poll_remove_entries(req); + if (ipt->nr_entries) + io_poll_remove_entries(req); if (!io_poll_can_finish_inline(req, ipt)) { io_poll_mark_cancelled(req); -- Jens Axboe