Re: [PATCH] tty: add lockdep annotations

From: Alan Cox
Date: Sun Jun 03 2012 - 09:02:28 EST


> Actually, I think we could probably make it really trivial by forcing
> the free'ing of the tty itself to be RCU-delayed.

It doesn't solve the problem of the synchronization between ->ttys[] and
->termios[]. Thats two objects, and the root of the problem. Given the
size of struct ktermios it appears to be a win anyway to put it in the
tty.

At that point tty_release can do what it should do.

> What do you think?

Second complication is some ttys have their own private ->shutdown.

It's possibly a useful optimisation and way of doing it *once* the
termios tidy is done, but I think once that is done then ->shutdown goes
away or becomes an non IRQ path event in tty_release.

> Anyway, I'm closing the merge window now (doing the tagging, booting
> and checking that allmodconfig/allyesconfig/allnoconfigs all compile
> fine) so it's 3.6 material, but it doesn't sound bad.

I've been gradually putting in places the bits leading up to the tty_lock
fix. I hadn't realised that one needed to be ahead or was exposing the
termios/tty array race.

I'll just go back and put the termios stuff further ahead and get that
chunk right first. After that tty locking, and then we can worry about
the real nasty which is that if we fix the open/close paths for console
devices to be secure Fedora breaks because their userspace appears to be
completely broken in this area.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/