Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp274477rdb; Thu, 25 Jan 2024 15:15:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9aKTEEaw2wcmUWX/FHyQtTFuFqlYqfVqWrQtQy1ODtHErDPfkWLq3gGVtyzSG296xjqej X-Received: by 2002:a17:902:7b82:b0:1d8:8ca8:d74a with SMTP id w2-20020a1709027b8200b001d88ca8d74amr411828pll.33.1706224528937; Thu, 25 Jan 2024 15:15:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706224528; cv=pass; d=google.com; s=arc-20160816; b=AWMP4trvmKStTPfd/Ang756Z8Puh0SerZNxQdIr95TQKl6OQ9hWNUmGZvaHSV78NZW sea2L8y9kHM3ZRI7ghhvG60bmcKKyxeVDJs4ScT4meR7fKUv1NiRQx3i5UR2RHbJNVNj pfPGSzQEcpVhvPBTrWFTt45KH46lIRMzzOWB+Nt9yM9NCtqVY7StHvhs0MmSmaXfih1/ mauCBogll0K+gv8FT9P70/gr5wFdcVlNpP3nXhEfAYSx8Q9xMzw3nsVPpiglgk3AGjhR JODeAIYxx28xDmnGgAvHfebfWNmDwCwTaSqYYOyjEtM/yLyjK2PMzf9DYYbUnApVvn68 knsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=UkBx2y8JxJGDKFQ+vmo2cn7oqhflyD25Zk9I8jYJcsk=; fh=+zMkUwSOzv38zj9ebjbQWckgPoHtfbPanbi4ZEUXir0=; b=ZZZLJ+SSdTnZTdRbcBbQdHQh0L6qb/2eQilJR4Yrh7A0Rvb7L5pzaBKJyGyZs29QKD NJIWjF4/wKzH0nPQGYvxByHvr+2FGQg+Pvei+iC3laAkRUhTfZmZ7dDZ0o5hQsdfax8Y /XH1k+oJZlJE00gwnGydoWyFhw4YOgqf9kxCj84LeEsZd8y8QAW0Cmr/lWhqcn/2Hj2r JOj3dnPo2soDm2s0h+1JK1D8xZVmiyedaHfJwWIvaAqGWDwoPmypp3SJkEyfHGq4R60Y osJEwqSRtL5ImF/IS4wI06bxD/LrrRDfa3bQn1jhmGmoem2JXa9jpPSxYWxbZUkhkQG8 7KPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jDnlj2/Q"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 t12-20020a170902dccc00b001d71a0a37d7si27766pll.542.2024.01.25.15.15.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 15:15:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39404-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jDnlj2/Q"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 9973A28F7D0 for ; Thu, 25 Jan 2024 23:15:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22A8912E75; Thu, 25 Jan 2024 23:15:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jDnlj2/Q" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 471BD12B8A; Thu, 25 Jan 2024 23:15:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706224520; cv=none; b=h8+QP7W7UwYinQK6wOjK5m/0cCqXDSCzhmNmLCOT9Gjlu6rmfo3lDWSdrDrN0sLWSDkrb71HeJRur2gu/VZ0NeurrCxMg6lpS4h7DnSTHDBOwPtQcelP5XOYo8aBh2vcVHLV4zVXZSG4c+hy9bR2devgrUuVcWeDXMdtn37EMlo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706224520; c=relaxed/simple; bh=d+oT/WUNGWywn59+jNCEnCZSa3hl6Z/rNAKSjHlpy1I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LeZI064cggri9keXZsPO5QWgLkJ3bHdClYKQWDEGkOdNt4Fln4NWXuFTE+mm8Ox5FgZrT+6CVDlBwrPp+8sDlQdb6+kKZYalXw1+ovdoU/Kp9jZLDz0Nt+hJ5pDMJiiLzMbcL+udMSX17K77CM9E62hEgTLssVKHbRMMr+jRAMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jDnlj2/Q; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F21B3C433C7; Thu, 25 Jan 2024 23:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706224518; bh=d+oT/WUNGWywn59+jNCEnCZSa3hl6Z/rNAKSjHlpy1I=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jDnlj2/Qbq9OZq3roGlMPt9F2pstORi1pvBFFeM6oSpIVZ91jkVjXkJIegdjLHmJg Vg9ObUj1YOA84SkkgIVCHN5W0/PTTyBam0aYgZNJcSs1i36+XkYgYKej3WgW1KeVYv wqZ6VmUiOakGj31rkss/DyzLkcBVnJHRTQ9bC04crauN6Pi/n5730YnKfRp8l4KujL MX11SVPW9KVWbLt7X6KlfOU3tIEnkXr/Mimw4AIuoMKidkJIhI3PPAyq32kEuR5P7X Tx9ANdB/72rHNqVsF9wifuKRPFJbS9PgiF6uGu6IEXVXC7ECDTI07+wHRTTNndqC3l 2u01xBXsHYAGw== Message-ID: <5e2b5f23-94f0-4bf0-80a6-48380c7dc730@kernel.org> Date: Fri, 26 Jan 2024 08:15:13 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] softirq: fix memory corruption when freeing tasklet_struct Content-Language: en-US To: Mikulas Patocka , Linus Torvalds Cc: Tejun Heo , Thomas Gleixner , linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev, Mike Snitzer , Ignat Korchagin , Damien Le Moal , Hou Tao , Peter Zijlstra , Ingo Molnar References: <82b964f0-c2c8-a2c6-5b1f-f3145dc2c8e5@redhat.com> <586ca4dd-f191-9ada-1bc3-e5672f17f7c@redhat.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <586ca4dd-f191-9ada-1bc3-e5672f17f7c@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/26/24 07:04, Mikulas Patocka wrote: > > > On Thu, 25 Jan 2024, Linus Torvalds wrote: > >> On Thu, 25 Jan 2024 at 10:30, Mikulas Patocka wrote: >>> >>> There's a problem with the tasklet API - there is no reliable way how to >>> free a structure that contains tasklet_struct. The problem is that the >>> function tasklet_action_common calls task_unlock(t) after it called the >>> callback. If the callback does something that frees tasklet_struct, >>> task_unlock(t) would write into free memory. >> >> Ugh. >> >> I see what you're doing, but I have to say, I dislike this patch >> immensely. It feels like a serious misdesign that is then papered over >> with a hack. >> >> I'd much rather see us trying to move away from tasklets entirely in >> cases like this. Just say "you cannot do that". > > OK. I will delete tasklets from both dm-crypt and dm-verity - it will > simplify them quite a bit. > > BTW. Do you think that we should get rid of request-based device mapper as > well? (that's another thing that looks like code bloat to me) That would force removing dm-multipath, which is I think the only DM driver using requests. But given how widespread the use of dm-multipath is, killing it would likely make a lot of people unhappy... -- Damien Le Moal Western Digital Research