Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp245603rdb; Thu, 25 Jan 2024 14:04:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHY/mbUBiH8lYtk20YGq/32Y2E6uJbRG0PvIMGFFziiXQaIrAfcCE4dAtSbxlgPqWBnFCXk X-Received: by 2002:a17:906:3411:b0:a29:a65c:4f7f with SMTP id c17-20020a170906341100b00a29a65c4f7fmr67787ejb.63.1706220294390; Thu, 25 Jan 2024 14:04:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706220294; cv=pass; d=google.com; s=arc-20160816; b=XiE/3l15lZ75h83SkVUB1d9pykOHbW7wTfOcCoBy2Lu1wu+VZ4FU8+rjKeQav5I29j ZPlimOqgn/zal75lz1QvmHLJf/6Km+EHk25bVBf1v7E4RjTKxD5AMYWO0a4Y28D9kiGM gQigioOEfO688tqkXbXMmNgJvvC/ia5buGWVRZfink66ph1bvULZ6zpoQfvsE4hIb6RW /0srIr0hLKjgflK3mY7N9cuodZuHY2+aquAqjV8xOfXRiSTe+bfRcZnnRIXr/5RgPzgF nnA67xg9yEdye1UrCNTVViiy7DJ3ZjZseoSGx1v+J1vAm601cp+rlVWhgVnkQ5av5+PG ah2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=ND3gC5edxcaoPgStVxLJXgo22mQ2Z/46B7atIlzRitw=; fh=QpAjOpCNMi8blIs5TzdF5OdppokFsdjLPnzFI9e3fhg=; b=hkAOOeGjVSnXU/44LBAjcINlPRc07lx4U/AeYI88NGo5Z2cmSPE6f7erMs5fQL8usE /hy2HxZvKMuEy52ckEOQ0rWnZfyEGTch76lWEZg4pEScbJ/ssT7EilGoEOBDSIHTjvWW enx1onczEs2JtfqKGXKdLElsECNaPb0e1nQyZBD3v68V19Y+GKOOYFQ4MuD59nxVYNYo yQ8GVkvn66XmwqyelREOt/bfSiDyFxJ8CNXuTxuxGPnkq+Wt3f72JUQ9j5m/5sKbIzsd jEb6hxdfQ5mrs17zA6REOls+w+W5dImHoYHkok5yW4PI1hSXRiWHHNErpOE2bnEAB2sj bu8Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N5QSbJnZ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-39345-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id kl17-20020a170907995100b00a316a356593si1195534ejc.207.2024.01.25.14.04.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 14:04:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39345-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N5QSbJnZ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-39345-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 293E61F2846C for ; Thu, 25 Jan 2024 22:04:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33C9213AA4F; Thu, 25 Jan 2024 22:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N5QSbJnZ" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 D641613A272 for ; Thu, 25 Jan 2024 22:04:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706220284; cv=none; b=R66pQTqKdN5ePqs+P4Vo+mBfavNoF4u4+1tSXSzJNXTZenXWPba9FSweOmcBzbL4McZCA0+i/6I4+L7Q0WotjTn6R4cpx40qZGQq2qR2iEEUqP757OPaHlTiftGwHTixjoj5B56D/oIN78ad8bvFTuVMHoc58MZbZJDAqdDQET0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706220284; c=relaxed/simple; bh=F6BdAOpGQ3/dhQX/Njz5YjMdVFa6pj6a+ARiS6t0Kn8=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=TkFTaUZP0274hT6i21jPvsdGz9EsTARuPyNPAIAtGXhcmPCgBhkbtazriiFWLVmZSQTmsJxTSR0CHQrffeRO7j+0wvzhGm1yi638NtyV1qF4WByNn6YzTc6huC91nG1cq57X27g0MY+2TgGiNLVx9VgCvsV2Ms+lNxqQEfMpTwE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=N5QSbJnZ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706220281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ND3gC5edxcaoPgStVxLJXgo22mQ2Z/46B7atIlzRitw=; b=N5QSbJnZo8xJYHusA0Iq719tY4/oczu6Ejzd0Trg1GitA6wcIWmOZbVBExt340zw9DSIT1 Ges2Dkhdg88SXdCB2ZV/PVswVm1AAlwU/WqpbF6ElF+W5ZixVnwF/UckyS4m3vvWRipr4t PxWc6ziI4Gz+rq2i51NR+0BAnwDhCpE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-27xKG1s-PhSUfzCTcz0Ing-1; Thu, 25 Jan 2024 17:04:36 -0500 X-MC-Unique: 27xKG1s-PhSUfzCTcz0Ing-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 104993C13A8C; Thu, 25 Jan 2024 22:04:36 +0000 (UTC) Received: from file1-rdu.file-001.prod.rdu2.dc.redhat.com (unknown [10.11.5.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A21CE3C2E; Thu, 25 Jan 2024 22:04:35 +0000 (UTC) Received: by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix, from userid 12668) id 88DD030C72AB; Thu, 25 Jan 2024 22:04:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix) with ESMTP id 844DE3FB50; Thu, 25 Jan 2024 23:04:35 +0100 (CET) Date: Thu, 25 Jan 2024 23:04:35 +0100 (CET) From: Mikulas Patocka To: 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 Subject: Re: [PATCH] softirq: fix memory corruption when freeing tasklet_struct In-Reply-To: Message-ID: <586ca4dd-f191-9ada-1bc3-e5672f17f7c@redhat.com> References: <82b964f0-c2c8-a2c6-5b1f-f3145dc2c8e5@redhat.com> 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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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) Mikulas