Re: [PATCH] acct: Prevent NULL pointer dereference when writing to sysfs

From: Christian Brauner
Date: Mon Feb 10 2025 - 11:03:00 EST


On Mon, Feb 10, 2025 at 03:21:46PM +0000, Al Viro wrote:
> On Mon, Feb 10, 2025 at 04:12:54PM +0100, Christian Brauner wrote:
>
> > One fix would be to move exit_fs() past exit_task_work(). It looks like
> > that this should be doable without much of a problem and it would fix
> > the path_init() problem.
> >
> > There should hopefully be nothing relying on task->fs == NULL in
> > exit_task_work().
>
> There's a question of the task_work_add() issued by exit_task_fs(),
> though.

Can't we simply remove the pins on the mounts of fs->root and fs->pwd in
exit_fs() explicitly? If that works I think that's a fair enough
compromise for this shite.