From: Mikulas Patocka <mpatocka@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>, Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev,
Mike Snitzer <msnitzer@redhat.com>,
Ignat Korchagin <ignat@cloudflare.com>,
Damien Le Moal <damien.lemoal@wdc.com>,
Hou Tao <houtao1@huawei.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] softirq: fix memory corruption when freeing tasklet_struct
Date: Thu, 25 Jan 2024 23:04:35 +0100 (CET) [thread overview]
Message-ID: <586ca4dd-f191-9ada-1bc3-e5672f17f7c@redhat.com> (raw)
In-Reply-To: <CAHk-=wjDW53w4-YcSmgKC5RruiRLHmJ1sXeYdp_ZgVoBw=5byA@mail.gmail.com>
On Thu, 25 Jan 2024, Linus Torvalds wrote:
> On Thu, 25 Jan 2024 at 10:30, Mikulas Patocka <mpatocka@redhat.com> 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
next prev parent reply other threads:[~2024-01-25 22:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 18:29 [PATCH] softirq: fix memory corruption when freeing tasklet_struct Mikulas Patocka
2024-01-25 19:51 ` Linus Torvalds
2024-01-25 22:04 ` Mikulas Patocka [this message]
2024-01-25 23:15 ` Damien Le Moal
2024-01-26 6:56 ` Hannes Reinecke
2024-01-26 18:09 ` Mikulas Patocka
2024-01-25 22:51 ` Ignat Korchagin
2024-01-26 0:33 ` Tejun Heo
2024-01-26 18:36 ` Allen
2024-01-26 23:43 ` Tejun Heo
2024-01-27 3:13 ` Allen
2024-01-27 18:37 ` Tejun Heo
2024-01-30 9:19 ` Tejun Heo
2024-01-29 17:00 ` Allen
2024-01-29 17:06 ` Tejun Heo
2024-04-09 14:15 ` Li Lingfeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=586ca4dd-f191-9ada-1bc3-e5672f17f7c@redhat.com \
--to=mpatocka@redhat.com \
--cc=damien.lemoal@wdc.com \
--cc=dm-devel@lists.linux.dev \
--cc=houtao1@huawei.com \
--cc=ignat@cloudflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=msnitzer@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox