Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-14 Thread Petr Mladek
On Tue 2021-04-13 17:22:46, Samo Pogačnik wrote: > Dne 13.04.2021 (tor) ob 16:32 +0200 je Petr Mladek napisal(a): > > On Tue 2021-04-13 13:10:50, Samo Pogačnik wrote: > > > Dne 13.04.2021 (tor) ob 11:41 +0200 je Petr Mladek napisal(a): > > > > On Mon 2021-04-12 14:41:27, Samo Pogačnik wrote: > > >

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-14 Thread Samo Pogačnik
Dne 14.04.2021 (sre) ob 20:11 +0900 je Tetsuo Handa napisal(a): > On 2021/04/14 9:45, Tetsuo Handa wrote: > > On 2021/04/12 21:04, Greg Kroah-Hartman wrote: > > > > Since syzkaller is a fuzzer, syzkaller happily opens /dev/ttyprintk from > > > > multiple threads. Should we update syzkaller to use C

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-14 Thread Tetsuo Handa
On 2021/04/14 9:45, Tetsuo Handa wrote: > On 2021/04/12 21:04, Greg Kroah-Hartman wrote: >>> Since syzkaller is a fuzzer, syzkaller happily opens /dev/ttyprintk from >>> multiple threads. Should we update syzkaller to use CONFIG_TTY_PRINTK=n ? >> >> Why? Can you not hit the same tty code paths fro

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-13 Thread Tetsuo Handa
On 2021/04/12 21:04, Greg Kroah-Hartman wrote: >> Since syzkaller is a fuzzer, syzkaller happily opens /dev/ttyprintk from >> multiple threads. Should we update syzkaller to use CONFIG_TTY_PRINTK=n ? > > Why? Can you not hit the same tty code paths from any other tty driver > being open multiple

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-13 Thread Samo Pogačnik
Dne 13.04.2021 (tor) ob 16:32 +0200 je Petr Mladek napisal(a): > On Tue 2021-04-13 13:10:50, Samo Pogačnik wrote: > > Dne 13.04.2021 (tor) ob 11:41 +0200 je Petr Mladek napisal(a): > > > On Mon 2021-04-12 14:41:27, Samo Pogačnik wrote: > > > > Dne 12.04.2021 (pon) ob 19:39 +0900 je Tetsuo Handa nap

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-13 Thread Petr Mladek
On Tue 2021-04-13 13:10:50, Samo Pogačnik wrote: > Dne 13.04.2021 (tor) ob 11:41 +0200 je Petr Mladek napisal(a): > > On Mon 2021-04-12 14:41:27, Samo Pogačnik wrote: > > > Dne 12.04.2021 (pon) ob 19:39 +0900 je Tetsuo Handa napisal(a): > > > > What is the intended usage of /dev/ttyprintk ? > > > >

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-13 Thread Samo Pogačnik
Dne 13.04.2021 (tor) ob 11:41 +0200 je Petr Mladek napisal(a): > On Mon 2021-04-12 14:41:27, Samo Pogačnik wrote: > > Dne 12.04.2021 (pon) ob 19:39 +0900 je Tetsuo Handa napisal(a): > > > What is the intended usage of /dev/ttyprintk ? > > > > > > > The intended use of 'ttyprintk' is to redirect c

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-13 Thread Petr Mladek
On Mon 2021-04-12 14:41:27, Samo Pogačnik wrote: > Dne 12.04.2021 (pon) ob 19:39 +0900 je Tetsuo Handa napisal(a): > > What is the intended usage of /dev/ttyprintk ? > > > > The intended use of 'ttyprintk' is to redirect console to /dev/ttyprintk > via the TIOCCONS ioctl. After successfull redire

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-12 Thread Samo Pogačnik
Dne 12.04.2021 (pon) ob 19:39 +0900 je Tetsuo Handa napisal(a): > What is the intended usage of /dev/ttyprintk ? > The intended use of 'ttyprintk' is to redirect console to /dev/ttyprintk via the TIOCCONS ioctl. After successfull redirection, all console messages get "merged" with kernel messages

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-12 Thread Greg Kroah-Hartman
On Mon, Apr 12, 2021 at 08:25:27PM +0900, Tetsuo Handa wrote: > On 2021/04/12 19:44, Greg Kroah-Hartman wrote: > > And trying to "open exclusive only" just does not work, the kernel can > > not enforce that at all, sorry. Any driver that you see trying to do > > that is trivial to work around in u

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-12 Thread Tetsuo Handa
On 2021/04/12 19:44, Greg Kroah-Hartman wrote: > And trying to "open exclusive only" just does not work, the kernel can > not enforce that at all, sorry. Any driver that you see trying to do > that is trivial to work around in userspace, making the kernel code > pointless. You mean something like

Re: How to handle concurrent access to /dev/ttyprintk ?

2021-04-12 Thread Greg Kroah-Hartman
ngtaskd warning due to tty_port_close(). > > Do we need to allow concurrent access to /dev/ttyprintk ? > If we can't change /dev/ttyprintk exclusively open()able by only > one thread, how to handle concurrent access to /dev/ttyprintk ? Like any tty port, if you have multipl

How to handle concurrent access to /dev/ttyprintk ?

2021-04-12 Thread Tetsuo Handa
/ttyprintk ? If we can't change /dev/ttyprintk exclusively open()able by only one thread, how to handle concurrent access to /dev/ttyprintk ? On 2021/04/07 23:24, Tetsuo Handa wrote: > On 2021/04/07 22:48, Greg Kroah-Hartman wrote: >>> By the way, as soon as applying this pa