Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1753645lqg; Mon, 4 Mar 2024 02:45:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWJfVQaCJMnlpVMpUIMp2dgpb9HM98sDhRJmzPe/7lmfBkxrSGsTL2p9673HPZqkHvKqEYYQjHV6iaQYHrc78qF1AVWCHwSbKGC4YAMvw== X-Google-Smtp-Source: AGHT+IF6lUlwLVhfktGZTiWJvkLyREQUfWOuVF23O/qQuo4nYvj4e2oANbq/Wdc04sA5Ve54aWK/ X-Received: by 2002:a05:6214:2481:b0:68f:d9f9:e10 with SMTP id gi1-20020a056214248100b0068fd9f90e10mr20086150qvb.28.1709549127008; Mon, 04 Mar 2024 02:45:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709549126; cv=pass; d=google.com; s=arc-20160816; b=ZJGgtlcZQzgdQvn5wOF/MWZOdWuL66H9mFxELVteJNE6/CRVzvbhq1j4PmB/Uo+ugC 5NkqN6U6riGpc4b/YRu+73Gnyj4XBFUQcsR9inOpMKT4ezQqN+z0uw7asqMLArcPhplp 0iCHoTmqpXeN38CTw4WM0se1izjC7YgnPpy/hAuyCUggo4IycMJkDVm10EeO7txqPa5I jiAs20N8195rTEKrFKRrx7x2qc4hjgU6QqZzTV8ce7DYEMpOFdYvPfjLHS16mtWNpV5Y /h7fO/gZsYCZFdpcqiw84TlLH7POKgLg9uaJv4ezvKn6f2OVMhia6r9ZYHiIofvyZc4L tvjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=c1/edOVx7+A7MJJCUu0OIjdgXZIZ1Tm6HSxdFBlhwRE=; fh=G5noQSpm/gwkfVnWeMQM+Y6lls5amIjMr33VvcBrD6A=; b=gaD+CDrbH8OznxWc0PihlG64lmI2OTQI3uqvCONYJKzn6iNupqyS52rPYWynJU++3K 7R4IsxdgE1f7Z9Js3GCemoTGyf4occdNQrdyrvNqrpf66KzNSL0YG5jMAsTOO9dpZvCJ zt9r8CnnrCYzNZDmSTUKgwaPXIkvhqUQsapoxcb41xA9bS8JUNKzaxtk6Eqse4rHZ69z RWog8/cqsIJnN71b3VyFuKR0W9EuKVzxt8v0jQpz9p+/UFF+TrF2lRWd247QfvOa206m 09hpkGR+fwUvXIeZ/a3orQC0CGJSvLOfqKZvYsHuacoUv2nFO/aEh668gvv12pQ1YCp/ ti+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-90453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90453-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 10-20020a05621420ea00b0068f7892eafcsi9349557qvk.511.2024.03.04.02.45.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 02:45:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-90453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90453-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BD8231C21357 for ; Mon, 4 Mar 2024 10:45:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46E36374C9; Mon, 4 Mar 2024 10:45:22 +0000 (UTC) Received: from mail78-59.sinamail.sina.com.cn (mail78-59.sinamail.sina.com.cn [219.142.78.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 531BD25764 for ; Mon, 4 Mar 2024 10:45:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=219.142.78.59 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709549121; cv=none; b=cCd7W1HWxlYI3OT4pApDDcE/hIKv+yFVhzMMZRtNZzo9PCR3+r076LlkMH6VrgLY1Gqlg1IBDgbAIyWsDP65XxSgQiaOk/Z3uyDMVndrcK34kJYfaWeMPpcztAKj83YZFp8wn9b81ht/zB72Fd0QVUoTx5c0yxppjWZrZSvEyIY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709549121; c=relaxed/simple; bh=PLOCerCJyfP8cOHEfZUjlmbNW1iTyeAmF7XJ+qQyqXw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BeJB4c8A/wXi/FH+5odc7AH7QobO7DJIkKZYSezCwfajEDDSCKOQgpIYMJHHCMuZi/HR1KsOqYfDW8XDgHyubrz6nDmSYLhn4iTNnLdWN2EJi7gxSjWSgR6OPF7Ubvh5t7DpTlb5auMDkw4M21/hs8Xps/3UlTjQbTo9m2jrU0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=219.142.78.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.118.66.159]) by sina.com (172.16.235.25) with ESMTP id 65E5A6300000384E; Mon, 4 Mar 2024 18:45:06 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 64487834210646 X-SMAIL-UIID: 345D9DF201C14AA489BF0A9333112DD0-20240304-184506-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [fs?] KASAN: slab-use-after-free Read in sys_io_cancel Date: Mon, 4 Mar 2024 18:44:57 +0800 Message-Id: <20240304104457.1348-1-hdanton@sina.com> In-Reply-To: <0000000000006945730612bc9173@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Sat, 02 Mar 2024 23:29:23 -0800 > syzbot found the following issue on: > > HEAD commit: 5ad3cb0ed525 Merge tag 'for-v6.8-rc2' of git://git.kernel... > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13877412180000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --- x/fs/aio.c +++ y/fs/aio.c @@ -2195,6 +2195,11 @@ SYSCALL_DEFINE3(io_cancel, aio_context_t if (kiocb->ki_res.obj == obj) { ret = kiocb->ki_cancel(&kiocb->rw); list_del_init(&kiocb->ki_list); + if (ret == 0 && kiocb->rw.ki_flags & IOCB_AIO_RW) { + struct aio_kiocb *iocb = container_of(&kiocb->rw, + struct aio_kiocb, rw); + refcount_inc(&iocb->ki_refcnt); + } break; } } --