Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-20 Thread rananta
On 2020-05-20 02:38, Jiri Slaby wrote: On 15. 05. 20, 1:22, rana...@codeaurora.org wrote: On 2020-05-13 00:04, Greg KH wrote: On Tue, May 12, 2020 at 02:39:50PM -0700, rana...@codeaurora.org wrote: On 2020-05-12 01:25, Greg KH wrote: > On Tue, May 12, 2020 at 09:22:15AM +0200, Jiri Slaby

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-20 Thread Jiri Slaby
On 15. 05. 20, 1:22, rana...@codeaurora.org wrote: > On 2020-05-13 00:04, Greg KH wrote: >> On Tue, May 12, 2020 at 02:39:50PM -0700, rana...@codeaurora.org wrote: >>> On 2020-05-12 01:25, Greg KH wrote: >>> > On Tue, May 12, 2020 at 09:22:15AM +0200, Jiri Slaby wrote: >>> > > commit

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-15 Thread rananta
On 2020-05-15 00:30, Greg KH wrote: On Thu, May 14, 2020 at 04:22:10PM -0700, rana...@codeaurora.org wrote: On 2020-05-13 00:04, Greg KH wrote: > On Tue, May 12, 2020 at 02:39:50PM -0700, rana...@codeaurora.org wrote: > > On 2020-05-12 01:25, Greg KH wrote: > > > On Tue, May 12, 2020 at

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-15 Thread Greg KH
On Thu, May 14, 2020 at 04:22:10PM -0700, rana...@codeaurora.org wrote: > On 2020-05-13 00:04, Greg KH wrote: > > On Tue, May 12, 2020 at 02:39:50PM -0700, rana...@codeaurora.org wrote: > > > On 2020-05-12 01:25, Greg KH wrote: > > > > On Tue, May 12, 2020 at 09:22:15AM +0200, Jiri Slaby wrote: >

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-14 Thread rananta
On 2020-05-13 00:04, Greg KH wrote: On Tue, May 12, 2020 at 02:39:50PM -0700, rana...@codeaurora.org wrote: On 2020-05-12 01:25, Greg KH wrote: > On Tue, May 12, 2020 at 09:22:15AM +0200, Jiri Slaby wrote: > > On 11. 05. 20, 9:39, Greg KH wrote: > > > On Mon, May 11, 2020 at 12:23:58AM -0700,

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-13 Thread Greg KH
On Tue, May 12, 2020 at 02:39:50PM -0700, rana...@codeaurora.org wrote: > On 2020-05-12 01:25, Greg KH wrote: > > On Tue, May 12, 2020 at 09:22:15AM +0200, Jiri Slaby wrote: > > > On 11. 05. 20, 9:39, Greg KH wrote: > > > > On Mon, May 11, 2020 at 12:23:58AM -0700, rana...@codeaurora.org wrote: >

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-12 Thread rananta
On 2020-05-12 01:25, Greg KH wrote: On Tue, May 12, 2020 at 09:22:15AM +0200, Jiri Slaby wrote: On 11. 05. 20, 9:39, Greg KH wrote: > On Mon, May 11, 2020 at 12:23:58AM -0700, rana...@codeaurora.org wrote: >> On 2020-05-09 23:48, Greg KH wrote: >>> On Sat, May 09, 2020 at 06:30:56PM -0700,

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-12 Thread Greg KH
On Tue, May 12, 2020 at 09:22:15AM +0200, Jiri Slaby wrote: > On 11. 05. 20, 9:39, Greg KH wrote: > > On Mon, May 11, 2020 at 12:23:58AM -0700, rana...@codeaurora.org wrote: > >> On 2020-05-09 23:48, Greg KH wrote: > >>> On Sat, May 09, 2020 at 06:30:56PM -0700, rana...@codeaurora.org wrote: >

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-12 Thread Jiri Slaby
On 11. 05. 20, 9:39, Greg KH wrote: > On Mon, May 11, 2020 at 12:23:58AM -0700, rana...@codeaurora.org wrote: >> On 2020-05-09 23:48, Greg KH wrote: >>> On Sat, May 09, 2020 at 06:30:56PM -0700, rana...@codeaurora.org wrote: On 2020-05-06 02:48, Greg KH wrote: > On Mon, Apr 27, 2020 at

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-11 Thread Greg KH
On Mon, May 11, 2020 at 12:34:44AM -0700, rana...@codeaurora.org wrote: > On 2020-05-11 00:23, rana...@codeaurora.org wrote: > > On 2020-05-09 23:48, Greg KH wrote: > > > On Sat, May 09, 2020 at 06:30:56PM -0700, rana...@codeaurora.org > > > wrote: > > > > On 2020-05-06 02:48, Greg KH wrote: > > >

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-11 Thread Greg KH
On Mon, May 11, 2020 at 12:23:58AM -0700, rana...@codeaurora.org wrote: > On 2020-05-09 23:48, Greg KH wrote: > > On Sat, May 09, 2020 at 06:30:56PM -0700, rana...@codeaurora.org wrote: > > > On 2020-05-06 02:48, Greg KH wrote: > > > > On Mon, Apr 27, 2020 at 08:26:01PM -0700, Raghavendra Rao

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-11 Thread rananta
On 2020-05-11 00:23, rana...@codeaurora.org wrote: On 2020-05-09 23:48, Greg KH wrote: On Sat, May 09, 2020 at 06:30:56PM -0700, rana...@codeaurora.org wrote: On 2020-05-06 02:48, Greg KH wrote: > On Mon, Apr 27, 2020 at 08:26:01PM -0700, Raghavendra Rao Ananta wrote: > > Potentially,

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-11 Thread rananta
On 2020-05-09 23:48, Greg KH wrote: On Sat, May 09, 2020 at 06:30:56PM -0700, rana...@codeaurora.org wrote: On 2020-05-06 02:48, Greg KH wrote: > On Mon, Apr 27, 2020 at 08:26:01PM -0700, Raghavendra Rao Ananta wrote: > > Potentially, hvc_open() can be called in parallel when two tasks calls >

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-10 Thread Greg KH
On Sat, May 09, 2020 at 06:30:56PM -0700, rana...@codeaurora.org wrote: > On 2020-05-06 02:48, Greg KH wrote: > > On Mon, Apr 27, 2020 at 08:26:01PM -0700, Raghavendra Rao Ananta wrote: > > > Potentially, hvc_open() can be called in parallel when two tasks calls > > > open() on /dev/hvcX. In such

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-09 Thread rananta
On 2020-05-06 02:48, Greg KH wrote: On Mon, Apr 27, 2020 at 08:26:01PM -0700, Raghavendra Rao Ananta wrote: Potentially, hvc_open() can be called in parallel when two tasks calls open() on /dev/hvcX. In such a scenario, if the hp->ops->notifier_add() callback in the function fails, where it

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-05-06 Thread Greg KH
On Mon, Apr 27, 2020 at 08:26:01PM -0700, Raghavendra Rao Ananta wrote: > Potentially, hvc_open() can be called in parallel when two tasks calls > open() on /dev/hvcX. In such a scenario, if the hp->ops->notifier_add() > callback in the function fails, where it sets the tty->driver_data to > NULL,

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-04-28 Thread Markus Elfring
> Hence, serialize hvc_open and check if tty->private_data is NULL before > proceeding ahead. How do you think about to add the tag “Fixes” because of adjustments for the data synchronisation? … > +++ b/drivers/tty/hvc/hvc_console.c … @@ -384,6 +394,8 @@ static int hvc_open(struct tty_struct

[PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-04-27 Thread Raghavendra Rao Ananta
Potentially, hvc_open() can be called in parallel when two tasks calls open() on /dev/hvcX. In such a scenario, if the hp->ops->notifier_add() callback in the function fails, where it sets the tty->driver_data to NULL, the parallel hvc_open() can see this NULL and cause a memory abort. Hence,