Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp2011375lqg; Mon, 4 Mar 2024 10:03:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVbse9fzskIpAaiFaiI2M4UefZRfaY/VjlJ/h+LxwummV1zM8ByVuHddrxseYnI3LCUe5nHYWFiQo1pLHOba6bAXTfL+VVBv1cfzVOVow== X-Google-Smtp-Source: AGHT+IHMons+2M34tS89zgdIc9zy1PzQlnwGr+jOwBBPZdEgHFcMVpbJVWOPJ01kj/SZNcUHOmb4 X-Received: by 2002:a17:90b:128b:b0:29b:931:37f1 with SMTP id fw11-20020a17090b128b00b0029b093137f1mr268057pjb.19.1709575416842; Mon, 04 Mar 2024 10:03:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709575416; cv=pass; d=google.com; s=arc-20160816; b=yu925Hhwh+/2fWN86cfqD/Ai5JX5ktjGJxIw9Tr/gupajs2ZQBxCIzY1eWiG/p+W+l OKpiEzhHJQbaFgWGjjN7jBMuk5SLQarXIPt+Qi3wM54m5bSy8k43w+Tf6bzxRn2UqV5H yCyzwWbB0D9PNU6Q9iadtx6GQ7KeKslzH2Li+d3vkmmxOjTnL4m0l0rSt39SP/xSNNVy iKVnZZ5HldhVc5NN0azuiHrpNnIcwOZ/Gp9k7jyLMQpcFcCnenByd2jtV7ejn3hpqYno 2Ea2iAarPM5HG13sntERv/Bx7/3CPPq8DGu3vaKrxfLGofbCwr+qnqu0EQVKzm8HgFuP wHlg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=9bImP841ZdyQhFV1reVYOWjtKjqLV/w0kSRAhiXD0rs=; fh=98KwVV8RpDNth19YVoL1G0g1wneJOt7kGhMv/1sMvIU=; b=XleXLLjzRifmsVxi7KvnyomBxYiuPmGrU83dKr4USPvKmQq7g+TszF/rbE5fEcgfco nWAAKBYZAYV1S09ijyxX6mZad0XDu2ErftD/kpkOJNVWcck/BTSHtpn3hoVPLJ1YQNgZ aeJ36b1Pox3dcwHF7yYmyjrG2Vy9GQXeE33orN3QoW5IhYgxwfjM6vvYnuZ6zbeymeb9 rmyvV5Be92m32ht6jY6156Ia5kM9YxZB1SGUWFFxLdPzpAhuhiiwahZEpzK3qE1VmBJw GvLJh/EANszg3GEdXcOK//zp7BQkbzWXlqvASrqBj2ckUUDJcHp3Vlc4vxRCJ9I+T5r4 bg7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=communityfibre.ca); spf=pass (google.com: domain of linux-kernel+bounces-91050-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91050-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bj6-20020a17090b088600b0029a1b34b0a0si10526872pjb.53.2024.03.04.10.03.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 10:03:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91050-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=communityfibre.ca); spf=pass (google.com: domain of linux-kernel+bounces-91050-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91050-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E872C283A55 for ; Mon, 4 Mar 2024 18:02:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2A7A6168E; Mon, 4 Mar 2024 18:02:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A5701756D; Mon, 4 Mar 2024 18:02:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.233.56.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709575342; cv=none; b=gJImwkNCxi/2iMcvsQX5YXODzThBMYS0USZ/QFkYL1Nir0zglCp/k07T7LMShSpC4Y1r9YFApGStHVeOzshgsizQw+J44bsgWaaC6HlsJsSQoAPAK2af+h3nclW2NsFjQ9oLFwbu+12kB6oOQ22i9Pmkkxep/Wt7GLxqAhqg5kk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709575342; c=relaxed/simple; bh=o2Uqzli5Q7BAm+6NVdRphFaatmxkjhCCRQN6B1rsgic=; h=Date:From:To:Cc:Subject:Message-ID:References:Mime-Version: Content-Type:Content-Disposition:In-Reply-To; b=fr/QlDLQXwZnV+Z/BegyRdxf4jfvX+FaxiIhxtc4u8SGeqJYnVsUt+Ji7gCFs0/3+1FKWWmowkMzNP51Mc3OEP+X0P8/ht3a21pHRIC12FSAntj1Hl2CV9ClrpamX50v44np2IrRMhaAoeRaAULCcuuWn9K93M8GCN6ymj6U77Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=communityfibre.ca; spf=pass smtp.mailfrom=communityfibre.ca; arc=none smtp.client-ip=205.233.56.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=communityfibre.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=communityfibre.ca Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FA496B0088; Mon, 4 Mar 2024 13:02:20 -0500 (EST) Date: Mon, 4 Mar 2024 13:02:20 -0500 From: Benjamin LaHaise To: Bart Van Assche Cc: Edward Adam Davis , syzbot+b91eb2ed18f599dd3c31@syzkaller.appspotmail.com, brauner@kernel.org, jack@suse.cz, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk Subject: Re: [PATCH] fs/aio: fix uaf in sys_io_cancel Message-ID: <20240304180220.GR20455@kvack.org> References: <0000000000006945730612bc9173@google.com> <14f85d0c-8303-4710-b8b1-248ce27a6e1f@acm.org> <20240304170343.GO20455@kvack.org> <73949a4d-6087-4d8c-bae0-cda60e733442@acm.org> <20240304173120.GP20455@kvack.org> <5ee4df86-458f-4544-85db-81dc82c2df4c@acm.org> <20240304174721.GQ20455@kvack.org> <2587412f-454d-472c-84b3-d7b9776a105a@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2587412f-454d-472c-84b3-d7b9776a105a@acm.org> User-Agent: Mutt/1.4.2.2i On Mon, Mar 04, 2024 at 09:58:37AM -0800, Bart Van Assche wrote: > On 3/4/24 09:47, Benjamin LaHaise wrote: > >On Mon, Mar 04, 2024 at 09:40:35AM -0800, Bart Van Assche wrote: > >>On 3/4/24 09:31, Benjamin LaHaise wrote: > >>>A revert is justified when a series of patches is buggy and had > >>>insufficient review prior to merging. > >> > >>That's not how Linux kernel development works. If a bug can get fixed > >>easily, a fix is preferred instead of reverting + reapplying a patch. > > > >Your original "fix" is not right, and it wasn't properly tested. Commit > >54cbc058d86beca3515c994039b5c0f0a34f53dd needs to be reverted. > > As I explained before, the above reply is not sufficiently detailed to > motivate a revert. You have introduced a use-after-free. You have not corrected the underlying cause of that use-after-free. Once you call ->ki_cancel(), you can't touch the kiocb. The call into ->ki_cancel() can result in a subsequent aio_complete() happening on that kiocb. Your change is wrong, your "fix" is wrong, and you are refusing to understand *why* your change was wrong in the first place. You haven't even given me a test case justifying your change. You need to justify your change to the maintainer, not the other way around. Revert 54cbc058d86beca3515c994039b5c0f0a34f53dd and the problem goes away. -ben > Bart. > -- "Thought is the essence of where you are now."