From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (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 88C14196DA5; Fri, 7 Jun 2024 17:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717780075; cv=none; b=FwfX95EVnhTJU9b8GNf39B9ltpju3X3GYoBPkzVZMGTO51iiydzqAJGFTiaLfZ8bfEP5o44qY10JPD4cHd3Dz3yRshaUvsLI8RmG5Z0mTUpySbn1BS6zbBAGS+WwfQoYgVCMSRIbx7ZwPxkUdTvwAVolkXynxj6EkhlFeTZIWX4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717780075; c=relaxed/simple; bh=XykYWhn78NsQ3xAVp2XxONIAEuMaWCH1cwFVA/pUdUg=; h=MIME-Version:From:Date:Message-ID:Subject:To:Content-Type; b=KqpLlEbRtbg8QtWC4d7p+Culnou90W1VmeXzu2YAiXG0BJm8eW0LL/nzX63KOL+MnKaqNUr732C/mxOAIabFPJMPMCaR66uN5NGmIGE/kxswgHMlY3sy92cxvYMIr+oqbMb7dMj8T3nXVuJvoYF2Z2NTo4aYR1WL8QFjBWvJ+ek= 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=M7cqbF/S; arc=none smtp.client-ip=209.85.219.176 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="M7cqbF/S" Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-dfa682a4025so2533244276.2; Fri, 07 Jun 2024 10:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717780072; x=1718384872; darn=vger.kernel.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=rU4fTUyC80zNogAZfVDgRhhMC+lE00nXX5KdknsyJPw=; b=M7cqbF/SSvi6J0PZ31oT+dT8Ql6GVU4NPrtb4OHGEjcKqLyYnH3nuYKj4uDlJhEx7y JOccYngfp4KPVvgKhFHM2FYnQPNtVr4XnJitoOertUvN4ovjIR2ZyXnJ/VJEps1Q56Wk X3QeWFEn7gQCL7vVMpQF/XWASmLqBDbjpXWD09u5CLwaHU8cnXzAnSSHwK8Br3IV7jUC d3lso+qr8213XeZ4SW/m2mb27YQ58TC48ppzl7vdnQOpTXG4T9WhUFDMDoxwRM4yOw0U QW1V5odSs72aJfMdXbPQHSVLKslW3e3tbAK89FW/Ga7WeygYpDd3HkuHEBF2h0ihbdAt lnqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717780072; x=1718384872; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rU4fTUyC80zNogAZfVDgRhhMC+lE00nXX5KdknsyJPw=; b=iLZoiFTd7ditebV1zyZZ5UVVZYMvBbRc6gd4XseZSeXwYkZZrPlKDarqXOn+ikIcWD 9+mFnPbA87F23cTi8Oy+6LGRGGPEqOcvBQFaoHk4RkWFYyw6nYSTJiDDLmBQBNPyVH4f HWXIF2KxJtTg08lLUvQhplnOxi+UBgdzTH0bR6+yCgfBrzMzLaZZSDcb+74YXjuqKasy 9wMF0Gdbb52n+kKQknvtVlhP9tVKqZH04o6UYWt0ubYxgHmfUtpG1C657KYTxaRngO7b 5uSpaXPasXs9Qd/WRVjdsKnhWzWtdeBnO5dHfQgYunEEowJKct6Y2P4dnTbKhZZLdW2Y 6eqw== X-Forwarded-Encrypted: i=1; AJvYcCXftnTYYO25q+n4OBX/jFdfO91dj7kgnVro0FW7lnCWEmrF/t1WHVwVcaPoygm/qXwYO7atA8AEMwuolOl+oWIWNVUEsVf9kh/kOCsSmwWUQpghF0Z7pGDVjk4XD4EwXOglrF+zxF0= X-Gm-Message-State: AOJu0YyL80kT8WCIeJewFKRoRzxxrvKdLbDoPgTmPdsWKpwNT7sAGPGG v4fwHcQd6pFY2mWDzZUrGRG8c4hDvOfCOF2jm26qhzWt7S2ajcLOL9lO3MkH3QQCHcIwfe0I5PN E5Z950QiyMs3LB9DXVilDQbt9aQo= X-Google-Smtp-Source: AGHT+IHDoIEn9CjqPBw0+EXAo8nkFooufEpfMHXpXYi8+hmHGF+/R3apRXYAAPUiHvMiC+QzNODzXIU+SsTkvwo4m6U= X-Received: by 2002:a25:8702:0:b0:dfa:e131:2a8e with SMTP id 3f1490d57ef6-dfaf6684510mr2863806276.47.1717780072182; Fri, 07 Jun 2024 10:07:52 -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:07:41 +0200 Message-ID: Subject: [io-uring] WARNING in io_fill_cqe_req_aux To: axboe@kernel.dk, asml.silence@gmail.com, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary="000000000000014ec2061a4fd716" --000000000000014ec2061a4fd716 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. ``` Syzkaller hit 'WARNING in io_fill_cqe_req_aux' bug. ------------[ cut here ]------------ WARNING: CPU: 7 PID: 8369 at io_uring/io_uring.h:132 io_lockdep_assert_cq_locked+0x2c7/0x340 io_uring/io_uring.h:132 Modules linked in: CPU: 7 PID: 8369 Comm: syz-executor263 Not tainted 6.8.0-rc3-00043-ga69d20885494-dirty #4 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:io_lockdep_assert_cq_locked+0x2c7/0x340 io_uring/io_uring.h:132 Code: 48 8d bb 98 03 00 00 be ff ff ff ff e8 52 45 4b 06 31 ff 89 c3 89 c6 e8 b7 e2 2d fd 85 db 0f 85 d5 fe ff ff e8 0a e7 2d fd 90 <0f> 0b 90 e9 c7 fe ff ff e8 fc e6 2d fd e8 c7 38 fa fc 48 85 c0 0f RSP: 0018:ffffc90012af79a8 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff845cf059 RDX: ffff8880252ea440 RSI: ffffffff845cf066 RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000001 FS: 00005555570e13c0(0000) GS:ffff88823bd80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f1bdbcae020 CR3: 0000000022624000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: io_fill_cqe_req_aux+0xd6/0x1f0 io_uring/io_uring.c:925 io_poll_check_events io_uring/poll.c:325 [inline] io_poll_task_func+0x16f/0x1000 io_uring/poll.c:357 io_handle_tw_list+0x172/0x560 io_uring/io_uring.c:1154 tctx_task_work_run+0xaa/0x330 io_uring/io_uring.c:1226 tctx_task_work+0x7b/0xd0 io_uring/io_uring.c:1244 task_work_run+0x16d/0x260 kernel/task_work.c:180 get_signal+0x1cb/0x25a0 kernel/signal.c:2669 arch_do_signal_or_restart+0x81/0x7e0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0x156/0x2b0 kernel/entry/common.c:212 do_syscall_64+0xe5/0x270 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7f1bdbc2d88d Code: c3 e8 a7 1f 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd12f6fa18 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: 0000000000000001 RBX: 000000000000220b RCX: 00007f1bdbc2d88d RDX: 0000000000000000 RSI: 0000000000005012 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 431bde82d7b634db R14: 00007f1bdbcaa4f0 R15: 0000000000000001 Syzkaller reproducer: # {Threaded:false Repeat:true RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false Swap:false UseTmpDir:false HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} r0 = syz_io_uring_setup(0x220b, &(0x7f0000000000)={0x0, 0x63db, 0x10000, 0x800}, &(0x7f0000000080)=0x0, &(0x7f0000000200)=0x0) r3 = socket$inet(0x2, 0x1, 0x0) syz_io_uring_submit(r1, r2, &(0x7f0000000a80)=@IORING_OP_POLL_ADD={0x6, 0x0, 0x0, @fd=r3, 0x0, 0x0, 0x1}) io_uring_enter(r0, 0x5012, 0x0, 0x0, 0x0, 0x0) ``` crepro is in the attachment. Best Regards Xdchase --000000000000014ec2061a4fd716 Content-Type: application/octet-stream; name="repro.c" Content-Disposition: attachment; filename="repro.c" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lx4xv5va0 I2RlZmluZSBfR05VX1NPVVJDRQoKI2luY2x1ZGUgPGRpcmVudC5oPgojaW5jbHVkZSA8ZW5kaWFu Lmg+CiNpbmNsdWRlIDxlcnJuby5oPgojaW5jbHVkZSA8ZmNudGwuaD4KI2luY2x1ZGUgPHNldGpt cC5oPgojaW5jbHVkZSA8c2lnbmFsLmg+CiNpbmNsdWRlIDxzdGRhcmcuaD4KI2luY2x1ZGUgPHN0 ZGJvb2wuaD4KI2luY2x1ZGUgPHN0ZGludC5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUg PHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDxzeXMvbW1hbi5oPgojaW5j bHVkZSA8c3lzL3ByY3RsLmg+CiNpbmNsdWRlIDxzeXMvc3RhdC5oPgojaW5jbHVkZSA8c3lzL3N5 c2NhbGwuaD4KI2luY2x1ZGUgPHN5cy90eXBlcy5oPgojaW5jbHVkZSA8c3lzL3dhaXQuaD4KI2lu Y2x1ZGUgPHRpbWUuaD4KI2luY2x1ZGUgPHVuaXN0ZC5oPgoKI2lmbmRlZiBfX05SX2lvX3VyaW5n X2VudGVyCiNkZWZpbmUgX19OUl9pb191cmluZ19lbnRlciA0MjYKI2VuZGlmCiNpZm5kZWYgX19O Ul9pb191cmluZ19yZWdpc3RlcgojZGVmaW5lIF9fTlJfaW9fdXJpbmdfcmVnaXN0ZXIgNDI3CiNl bmRpZgojaWZuZGVmIF9fTlJfaW9fdXJpbmdfc2V0dXAKI2RlZmluZSBfX05SX2lvX3VyaW5nX3Nl dHVwIDQyNQojZW5kaWYKCnN0YXRpYyBfX3RocmVhZCBpbnQgY2xvbmVfb25nb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CiAgc2Euc2FfZmxhZ3MgPSBTQV9OT0RFRkVSIHwgU0FfU0lHSU5GTzsKICBzaWdhY3Rpb24o U0lHU0VHViwgJnNhLCBOVUxMKTsKICBzaWdhY3Rpb24oU0lHQlVTLCAmc2EsIE5VTEwpOwp9Cgoj ZGVmaW5lIE5PTkZBSUxJTkcoLi4uKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgXAogICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgaW50IG9r ID0gMTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgXAogICAgX19hdG9taWNfZmV0Y2hfYWRkKCZza2lwX3NlZ3YsIDEsIF9fQVRP TUlDX1NFUV9DU1QpOyAgICAgICAgICAgICAgICAgICAgICAgXAogICAgaWYgKF9zZXRqbXAoc2Vn dl9lbnYpID09IDApIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgXAogICAgICBfX1ZBX0FSR1NfXzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgfSBlbHNlICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAg ICBvayA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgXAogICAgX19hdG9taWNfZmV0Y2hfc3ViKCZza2lwX3NlZ3YsIDEs IF9fQVRPTUlDX1NFUV9DU1QpOyAgICAgICAgICAgICAgICAgICAgICAgXAogICAgb2s7ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAg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9pZCBraWxsX2Fu ZF93YWl0KGludCBwaWQsIGludCogc3RhdHVzKQp7CiAga2lsbCgtcGlkLCBTSUdLSUxMKTsKICBr aWxsKHBpZCwgU0lHS0lMTCk7CiAgZm9yIChpbnQgaSA9IDA7IGkgPCAxMDA7IGkrKykgewogICAg aWYgKHdhaXRwaWQoLTEsIHN0YXR1cywgV05PSEFORyB8IF9fV0FMTCkgPT0gcGlkKQogICAgICBy ZXR1cm47CiAgICB1c2xlZXAoMTAwMCk7CiAgfQogIERJUiogZGlyID0gb3BlbmRpcigiL3N5cy9m cy9mdXNlL2Nvbm5lY3Rpb25zIik7CiAgaWYgKGRpcikgewogICAgZm9yICg7OykgewogICAgICBz dHJ1Y3QgZGlyZW50KiBlbnQgPSByZWFkZGlyKGRpcik7CiAgICAgIGlmICghZW50KQogICAgICAg IGJyZWFrOwogICAgICBpZiAoc3RyY21wKGVudC0+ZF9uYW1lLCAiLiIpID09IDAgfHwgc3RyY21w KGVudC0+ZF9uYW1lLCAiLi4iKSA9PSAwKQogICAgICAgIGNvbnRpbnVlOwogICAgICBjaGFyIGFi b3J0WzMwMF07CiAgICAgIHNucHJpbnRmKGFib3J0LCBzaXplb2YoYWJvcnQpLCAiL3N5cy9mcy9m dXNlL2Nvbm5lY3Rpb25zLyVzL2Fib3J0IiwKICAgICAgICAgICAgICAgZW50LT5kX25hbWUpOwog ICAgICBpbnQgZmQgPSBvcGVuKGFib3J0LCBPX1dST05MWSk7CiAgICAgIGlmIChmZCA9PSAtMSkg ewogICAgICAgIGNvbnRpbnVlOwogICAgICB9CiAgICAgIGlmICh3cml0ZShmZCwgYWJvcnQsIDEp IDwgMCkgewogICAgICB9CiAgICAgIGNsb3NlKGZkKTsKICAgIH0KICAgIGNsb3NlZGlyKGRpcik7 CiAgfSBlbHNlIHsKICB9CiAgd2hpbGUgKHdhaXRwaWQoLTEsIHN0YXR1cywgX19XQUxMKSAhPSBw aWQpIHsKICB9Cn0KCnN0YXRpYyB2b2lkIHNldHVwX3Rlc3QoKQp7CiAgcHJjdGwoUFJfU0VUX1BE RUFUSFNJRywgU0lHS0lMTCwgMCwgMCwgMCk7CiAgc2V0cGdycCgpOwogIHdyaXRlX2ZpbGUoIi9w cm9jL3NlbGYvb29tX3Njb3JlX2FkaiIsICIxMDAwIik7Cn0KCnN0YXRpYyB2b2lkIGV4ZWN1dGVf b25lKHZvaWQpOwoKI2RlZmluZSBXQUlUX0ZMQUdTIF9fV0FMTAoKc3RhdGljIHZvaWQgbG9vcCh2 b2lkKQp7CiAgaW50IGl0ZXIgPSAwOwogIGZvciAoOzsgaXRlcisrKSB7CiAgICBpbnQgcGlkID0g Zm9yaygpOwogICAgaWYgKHBpZCA8IDApCiAgICAgIGV4aXQoMSk7CiAgICBpZiAocGlkID09IDAp IHsKICAgICAgc2V0dXBfdGVzdCgpOwogICAgICBleGVjdXRlX29uZSgpOwogICAgICBleGl0KDAp OwogICAgfQogICAgaW50IHN0YXR1cyA9IDA7CiAgICB1aW50NjRfdCBzdGFydCA9IGN1cnJlbnRf dGltZV9tcygpOwogICAgZm9yICg7OykgewogICAgICBpZiAod2FpdHBpZCgtMSwgJnN0YXR1cywg V05PSEFORyB8IFdBSVRfRkxBR1MpID09IHBpZCkKICAgICAgICBicmVhazsKICAgICAgc2xlZXBf bXMoMSk7CiAgICAgIGlmIChjdXJyZW50X3RpbWVfbXMoKSAtIHN0YXJ0IDwgNTAwMCkKICAgICAg ICBjb250aW51ZTsKICAgICAga2lsbF9hbmRfd2FpdChwaWQsICZzdGF0dXMpOwogICAgICBicmVh azsKICAgIH0KICB9Cn0KCnVpbnQ2NF90IHJbNF0gPSB7MHgwLCAweDAsIDB4MCwgMHgwfTsKCnZv aWQgZXhlY3V0ZV9vbmUodm9pZCkKewogIGludHB0cl90IHJlcyA9IDA7CiAgTk9ORkFJTElORygq KHVpbnQzMl90KikweDIwMDAwMDA0ID0gMHgyZTI2KTsKICBOT05GQUlMSU5HKCoodWludDMyX3Qq KTB4MjAwMDAwMDggPSAweDgwMCk7CiAgTk9ORkFJTElORygqKHVpbnQzMl90KikweDIwMDAwMDBj ID0gMyk7CiAgTk9ORkFJTElORygqKHVpbnQzMl90KikweDIwMDAwMDEwID0gMHgyY2YpOwogIE5P TkZBSUxJTkcoKih1aW50MzJfdCopMHgyMDAwMDAxOCA9IDApOwogIE5PTkZBSUxJTkcobWVtc2V0 KCh2b2lkKikweDIwMDAwMDFjLCAwLCAxMikpOwogIHJlcyA9IC0xOwogIE5PTkZBSUxJTkcocmVz ID0gc3l6X2lvX3VyaW5nX3NldHVwKC8qZW50cmllcz0qLzB4MjI5OSwgLypwYXJhbXM9Ki8weDIw MDAwMDAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qcmluZ19wdHI9 Ki8weDIwMDAwMDgwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qc3Fl c19wdHI9Ki8weDIwMDAwMGMwKSk7CiAgaWYgKHJlcyAhPSAtMSkgewogICAgclswXSA9IHJlczsK ICAgIE5PTkZBSUxJTkcoclsxXSA9ICoodWludDY0X3QqKTB4MjAwMDAwODApOwogICAgTk9ORkFJ TElORyhyWzJdID0gKih1aW50NjRfdCopMHgyMDAwMDBjMCk7CiAgfQogIHN5c2NhbGwoX19OUl9v cGVuLCAvKmZpbGU9Ki8wdWwsCiAgICAgICAgICAvKmZsYWdzPV9fT19UTVBGSUxFfE9fU1lOQ3xP X05PTkJMT0NLfE9fRVhDTHxPX0RJUkVDVE9SWSovIDB4NTExODgwdWwsCiAgICAgICAgICAvKm1v ZGU9U19JV09USHxTX0lYR1JQKi8gMHhhdWwpOwogIHN5c2NhbGwoX19OUl9vcGVuLCAvKmZpbGU9 Ki8wdWwsCiAgICAgICAgICAvKmZsYWdzPU9fRElSRUNUT1JZfE9fRElSRUNUfE9fQ0xPRVhFQ3xP X0FQUEVORCovIDB4OTQ0MDB1bCwKICAgICAgICAgIC8qbW9kZT1TX0lYR1JQfFNfSVhVU1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8wdWwsCiAgICAgICAgICAvKm5yX2FyZ3M9Ki8ydWwpOwogIE5PTkZBSUxJTkcoCiAg ICAgIHN5el9pb191cmluZ19zdWJtaXQoLypyaW5nX3B0cj0qL3JbMV0sIC8qc3Flc19wdHI9Ki9y WzJdLCAvKnNxZT0qLzApKTsKICBOT05GQUlMSU5HKCoodWludDhfdCopMHgyMDAwMDU0MCA9IDYp OwogIE5PTkZBSUxJTkcoKih1aW50OF90KikweDIwMDAwNTQxID0gMHhjKTsKICBOT05GQUlMSU5H KCoodWludDE2X3QqKTB4MjAwMDA1NDIgPSAwKTsKICBOT05GQUlMSU5HKCoodWludDMyX3QqKTB4 MjAwMDA1NDQgPSByWzNdKTsKICBOT05GQUlMSU5HKCoodWludDY0X3QqKTB4MjAwMDA1NDggPSAw KTsKICBOT05GQUlMSU5HKCoodWludDY0X3QqKTB4MjAwMDA1NTAgPSAwKTsKICBOT05GQUlMSU5H KCoodWludDE2X3QqKTB4MjAwMDA1NTggPSAxKTsKICBOT05GQUlMSU5HKCoodWludDE2X3QqKTB4 MjAwMDA1NWEgPSAwKTsKICBOT05GQUlMSU5HKCoodWludDE2X3QqKTB4MjAwMDA1NWMgPSAwKTsK ICBOT05GQUlMSU5HKCoodWludDY0X3QqKTB4MjAwMDA1NjAgPSAxKTsKICBOT05GQUlMSU5HKCoo dWludDE2X3QqKTB4MjAwMDA1NjggPSAwKTsKICBOT05GQUlMSU5HKCoodWludDE2X3QqKTB4MjAw MDA1NmEgPSAwKTsKICBOT05GQUlMSU5HKG1lbXNldCgodm9pZCopMHgyMDAwMDU2YywgMCwgNCkp OwogIE5PTkZBSUxJTkcobWVtc2V0KCh2b2lkKikweDIwMDAwNTcwLCAwLCAxNikpOwogIE5PTkZB SUxJTkcoc3l6X2lvX3VyaW5nX3N1Ym1pdCgvKnJpbmdfcHRyPSovclsxXSwgLypzcWVzX3B0cj0q L3JbMl0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qc3FlPSovMH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