From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) (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 543D412B93; Fri, 7 Jun 2024 17:11:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717780317; cv=none; b=VRS9rbS25ZaON4SYgI9U7lWY8YYaEhGIJPc+5odPhEnfbkDKyDCsp+RHP88ASeRtInEPmycoxwxZvZyOpdriUgi0iOS0GNBsDqwU3cuXRTlXISOo4Ig9ewGFqtwEJfqtCEw+IWR3IAozeTiVwCsdHs572lMMtgmjKFvwQFigo+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717780317; c=relaxed/simple; bh=sZA/nGHjzHF5fR7FdNfjiNXQ9rhvbwi515U0+BEmtG4=; h=MIME-Version:From:Date:Message-ID:Subject:To:Content-Type; b=bQbI+2fmlwF8tSrsHH6Rljn6cjIRNJk3hfx8KjuhHC9dOSrioszQRsYO3jEmGOUyfikxOn6Li3aA7R2/WImPaTjtBDTTfBGrStSdoLb8JI2g4Q89+36UsXOgKKWw6ayQ5Q1crS4vLoPBibAcPmtzok0s7IiUyHBopBZuo62GAfo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EaFTFz9I; arc=none smtp.client-ip=209.85.128.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EaFTFz9I" Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-62c6317d15cso24199537b3.2; Fri, 07 Jun 2024 10:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717780315; x=1718385115; darn=vger.kernel.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=xBzO44q2Xa0w6y86yZl4MXNQRVWa2cRMf88S1RXzUb0=; b=EaFTFz9IE/qeTwfrPFXhmDMaCKDMJ5E+K7Pg1eGWdoD1FxfigfVNUOdci4UYrLxtHJ pbIBNh9Pk3WhtdYLg59J8LJEWPiXUlbtvYqQHLrDwoWvwdQHyQdhYKSWgfUqd2VqL2v6 Cf1Tft+VHA+Xzpu42bLhLev0kNsZWMsdFM6BkNm70bnGaua/93Uk5Das02xpnj1oMOGc AdXyMGeIhD2f+fpbMteG+tpLchuOTpW6zoACET9ToqM4Z2An4rhiSBC+T60ON8zihv+w EqiyDpQOniT+ukzfe/OSDQM19jKRJPWYH9xuNeS2rLVt3ziBTRUAll01YpvBV6m5UTp4 fQdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717780315; x=1718385115; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xBzO44q2Xa0w6y86yZl4MXNQRVWa2cRMf88S1RXzUb0=; b=gS34pnSFHYG0pDiXQWN9zEEL1DJfOmAbq2ZWTfJCPVVsqbl/6d+yWax2PkF+OupQT1 rOCwPbgemNugl5hsUe/lHSosWdUTzhYAaWiQLMAKYj8Z81Naf37umYqEAp1ZU4N32/d1 pde3ZQaHTPifftaw3CG2mvZ34b8OEAVZYInBiIxL3IQQUbS3YMjb7PS2za5ophA0/aGd apd0IVZMJL9ELbm/epmaKqr0gJ9jKkroCze5rxGq7a7QJwtb74WF0/Lw2ZL+5V81hptR zTg4cPkPHJpE4Dq5QceFIcw4R2C0vbG4RNm6+zLl5S7G9MEC3OGDaRXnwVN2vadlhuXd eu1w== X-Forwarded-Encrypted: i=1; AJvYcCWEZopMI2lxs00kwv7eH5Bbvw2jzdoB3ISjio8y6CvTvygPDYlQ10oKTzUjVWC4vL4IDTHXBk5OWIEUlLWM42JgwQmjiCUUQ2Q1xrz7zGhL3ghvW5n64HJIIXSV4dNOpa7qFXe1tGY= X-Gm-Message-State: AOJu0YwHrIQJwgJlz8BOhySSqDRCBNB+91obBSCSlMryijvRMEq3SKnR Ykib0BJFD4Wgyb+9Ge4yDqkzxT7G4ojPdVBg6tTlqr6j6Z6ZZPYAXi3zViF5zkzzTFRHxiygeC/ 4jAkgIJK8IKzRgP/T96w/0nuMazZknOW8wU0= X-Google-Smtp-Source: AGHT+IG/HXg60CBhYlWRQQusXY1YK5eGmxusSplMmC1/pkjBF7dXppB+H5ToqGuOaElF7tMbc+qB3LlIm/JU+XHIdCA= X-Received: by 2002:a25:b01:0:b0:dfa:52bc:4981 with SMTP id 3f1490d57ef6-dfaf65b1979mr2990643276.8.1717780315238; Fri, 07 Jun 2024 10:11:55 -0700 (PDT) Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: chase xd Date: Fri, 7 Jun 2024 19:11:44 +0200 Message-ID: Subject: [io-uring] WARNING in io_rsrc_ref_quiesce To: axboe@kernel.dk, asml.silence@gmail.com, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary="0000000000007e0948061a4fe5cc" --0000000000007e0948061a4fe5cc Content-Type: text/plain; charset="UTF-8" Dear Linux kernel maintainers, Syzkaller reports this previously unknown bug on Linux 6.8.0-rc3-00043-ga69d20885494-dirty #4. Seems like the bug was silently or unintendedly fixed in the latest version. ``` ------------[ cut here ]------------ do not call blocking ops when !TASK_RUNNING; state=1 set at [] prepare_to_wait+0xa4/0x380 kernel/sched/wait.c:237 WARNING: CPU: 2 PID: 397056 at kernel/sched/core.c:10099 __might_sleep+0x114/0x160 kernel/sched/core.c:10099 Modules linked in: CPU: 2 PID: 397056 Comm: syz-executor.2 Not tainted 6.8.0-rc3-00043-ga69d20885494-dirty #50 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:__might_sleep+0x114/0x160 kernel/sched/core.c:10099 Code: 03 00 48 8d bb 50 17 00 00 48 89 fa 48 c1 ea 03 80 3c 02 00 75 37 48 8b 93 50 17 00 00 48 c7 c7 a0 55 0b 8a e8 9d d4 f4 ff 90 <0f> 0b 90 90 e9 71 ff ff ff e8 4e 28 78 00 e9 22 ff ff ff 89 34 24 RSP: 0018:ffffc9000bf5fb40 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff888053524880 RCX: 0000000000000000 RDX: 0000000000000002 RSI: 0000000000000004 RDI: 0000000000000001 RBP: ffffffff8a0bc600 R08: 0000000000000001 R09: ffffed1017315171 R10: ffff8880b98a8b8b R11: 0000000000000000 R12: 0000000000000249 R13: 0000000000000000 R14: dffffc0000000000 R15: ffffc9000bf5fd20 FS: 00007fe4ffdcc640(0000) GS:ffff8880b9880000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fa501ba3098 CR3: 0000000022b8c000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0xb4/0x940 kernel/locking/mutex.c:752 io_rsrc_ref_quiesce+0x590/0x940 io_uring/rsrc.c:253 io_sqe_buffers_unregister+0xa2/0x340 io_uring/rsrc.c:799 __io_uring_register io_uring/register.c:424 [inline] __do_sys_io_uring_register+0x5b9/0x2400 io_uring/register.c:613 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd8/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7fe4ff0902ed Code: c3 e8 97 2b 00 00 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe4ffdcc028 EFLAGS: 00000246 ORIG_RAX: 00000000000001ab RAX: ffffffffffffffda RBX: 00007fe4ff1cbf80 RCX: 00007fe4ff0902ed RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003 RBP: 00007fe4ff0f150e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe4ff1cbf80 R15: 00007fe4ffdac000 ``` crepro is in the attachment. Best Regards Xdchase --0000000000007e0948061a4fe5cc Content-Type: application/octet-stream; name="repro.c" Content-Disposition: attachment; filename="repro.c" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lx4y0a630 Ly8gYXV0b2dlbmVyYXRlZCBieSBzeXprYWxsZXIgKGh0dHBzOi8vZ2l0aHViLmNvbS9nb29nbGUv c3l6a2FsbGVyKQoKI2RlZmluZSBfR05VX1NPVVJDRQoKI2luY2x1ZGUgPGRpcmVudC5oPgojaW5j bHVkZSA8ZW5kaWFuLmg+CiNpbmNsdWRlIDxlcnJuby5oPgojaW5jbHVkZSA8ZmNudGwuaD4KI2lu Y2x1ZGUgPHNpZ25hbC5oPgojaW5jbHVkZSA8c3RkYXJnLmg+CiNpbmNsdWRlIDxzdGRib29sLmg+ CiNpbmNsdWRlIDxzdGRpbnQuaD4KI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIu aD4KI2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8c3lzL21tYW4uaD4KI2luY2x1ZGUgPHN5 cy9wcmN0bC5oPgojaW5jbHVkZSA8c3lzL3N0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IHBpZCkKICAgICAgICBicmVhazsKICAgICAgc2xlZXBfbXMoMSk7CiAg ICAgIGlmIChjdXJyZW50X3RpbWVfbXMoKSAtIHN0YXJ0IDwgNTAwMCkKICAgICAgICBjb250aW51 ZTsKICAgICAga2lsbF9hbmRfd2FpdChwaWQsICZzdGF0dXMpOwogICAgICBicmVhazsKICAgIH0K ICB9Cn0KCnVpbnQ2NF90IHJbNV0gPSB7MHgwLCAweDAsIDB4MCwgMHhmZmZmZmZmZmZmZmZmZmZm LCAweDB9OwoKdm9pZCBleGVjdXRlX29uZSh2b2lkKQp7CiAgaW50cHRyX3QgcmVzID0gMDsKICAq KHVpbnQzMl90KikweDIwMDAwMDA0ID0gMHgxZWQyOwogICoodWludDMyX3QqKTB4MjAwMDAwMDgg PSAwOwogICoodWludDMyX3QqKTB4MjAwMDAwMGMgPSAxOwogICoodWludDMyX3QqKTB4MjAwMDAw MTAgPSAweDM2NzsKICAqKHVpbnQzMl90KikweDIwMDAwMDE4ID0gMDsKICBtZW1zZXQoKHZvaWQq KTB4MjAwMDAwMWMsIDAsIDEyKTsKICByZXMgPSAtMTsKICByZXMgPSBzeXpfaW9fdXJpbmdfc2V0 dXAoLyplbnRyaWVzPSovMHgyOWYzLCAvKnBhcmFtcz0qLzB4MjAwMDAwMDAsCiAgICAgICAgICAg ICAgICAgICAgICAgICAgIC8qcmluZ19wdHI9Ki8weDIwMDAwMDgwLCAvKnNxZXNfcHRyPSovMHgy MDAwMDBjMCk7CiAgaWYgKHJlcyAhPSAtMSkgewogICAgclswXSA9IHJlczsKICAgIHJbMV0gPSAq KHVpbnQ2NF90KikweDIwMDAwMDgwOwogICAgclsyXSA9ICoodWludDY0X3QqKTB4MjAwMDAwYzA7 CiAgfQogIHJlcyA9IHN5c2NhbGwoX19OUl9vcGVuLCAvKmZpbGU9Ki8wdWwsIC8qZmxhZ3M9T19T WU5DfE9fUkRXUiovIDB4MTAxMDAydWwsCiAgICAgICAgICAgICAgICAvKm1vZGU9U19JUk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2V0dGltZSwgLyppZD0qLzB1bCwgLyp0cD0qLzB1bCk7CiAgKih1aW50OF90 KikweDIwMDAwMzgwID0gMHgyMTsKICAqKHVpbnQ4X3QqKTB4MjAwMDAzODEgPSAweDFjOwogICoo dWludDE2X3QqKTB4MjAwMDAzODIgPSAwOwogICoodWludDMyX3QqKTB4MjAwMDAzODQgPSByWzNd OwogICoodWludDY0X3QqKTB4MjAwMDAzODggPSAwOwogICoodWludDY0X3QqKTB4MjAwMDAzOTAg PSAwOwogICoodWludDMyX3QqKTB4MjAwMDAzOTggPSAzOwogICoodWludDMyX3QqKTB4MjAwMDAz OWMgPSA4OwogICoodWludDY0X3QqKTB4MjAwMDAzYTAgPSAwOwogICoodWludDE2X3QqKTB4MjAw MDAzYTggPSAwOwogICoodWludDE2X3QqKTB4MjAwMDAzYWEgPSAwOwogICoodWludDMyX3QqKTB4 MjAwMDAzYWMgPSByWzNdOwogIG1lbXNldCgodm9pZCopMHgyMDAwMDNiMCwgMCwgMTYpOwogIHN5 el9pb191cmluZ19zdWJtaXQoLypyaW5nX3B0cj0qL3JbMV0sIC8qc3Flc19wdHI9Ki9yWzJdLCAv KnNxZT0qLzB4MjAwMDAzODApOwogICoodWludDhfdCopMHgyMDAwMDQ0MCA9IDB4YjsKICAqKHVp bnQ4X3QqKTB4MjAwMDA0NDEgPSAweDEwOwogICoodWludDE2X3QqKTB4MjAwMDA0NDIgPSAwOwog ICoodWludDMyX3QqKTB4MjAwMDA0NDQgPSAwOwogICoodWludDY0X3QqKTB4MjAwMDA0NDggPSA0 OwogICoodWludDY0X3QqKTB4MjAwMDA0NTAgPSAweDIwMDAwNDAwOwogICoodWludDY0X3QqKTB4 MjAwMDA0MDAgPSAwOwogICoodWludDY0X3QqKTB4MjAwMDA0MDggPSAwOwogICoodWludDMyX3Qq KTB4MjAwMDA0NTggPSAxOwogICoodWludDMyX3QqKTB4MjAwMDA0NWMgPSAxOwogICoodWludDY0 X3QqKTB4MjAwMDA0NjAgPSAxOw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