[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201217151931.8078-1-sjpark@amazon.com>
Date: Thu, 17 Dec 2020 16:19:31 +0100
From: SeongJae Park <sjpark@...zon.com>
To: Jürgen Groß <jgross@...e.com>
CC: SeongJae Park <sjpark@...zon.com>, <stable@...r.kernel.org>,
SeongJae Park <sjpark@...zon.de>, <doebel@...zon.de>,
<aams@...zon.de>, <mku@...zon.de>, <julien@....org>,
<wipawel@...zon.de>, <linux-kernel@...r.kernel.org>,
"Author Redacted" <security@....org>
Subject: Re: [PATCH 4/5] xen/xenbus: Count pending messages for each watch
On Thu, 17 Dec 2020 15:50:34 +0100 "Jürgen Groß" <jgross@...e.com> wrote:
> [-- Attachment #1.1.1: Type: text/plain, Size: 3509 bytes --]
>
> On 17.12.20 09:17, SeongJae Park wrote:
> > From: SeongJae Park <sjpark@...zon.de>
> >
> > This commit adds a counter of pending messages for each watch in the
> > struct. It is used to skip unnecessary pending messages lookup in
> > 'unregister_xenbus_watch()'. It could also be used in 'will_handle'
> > callback.
> >
> > This is part of XSA-349
> >
> > This is upstream commit 3dc86ca6b4c8cfcba9da7996189d1b5a358a94fc
> >
> > Cc: stable@...r.kernel.org
> > Signed-off-by: SeongJae Park <sjpark@...zon.de>
> > Reported-by: Michael Kurth <mku@...zon.de>
> > Reported-by: Pawel Wieczorkiewicz <wipawel@...zon.de>
> > Signed-off-by: Author Redacted <security@....org>
> > Reviewed-by: Juergen Gross <jgross@...e.com>
> > Signed-off-by: Juergen Gross <jgross@...e.com>
> > ---
> > drivers/xen/xenbus/xenbus_xs.c | 30 ++++++++++++++++++------------
> > include/xen/xenbus.h | 2 ++
> > 2 files changed, 20 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
> > index 0ea1c259f2f1..420d478e1708 100644
> > --- a/drivers/xen/xenbus/xenbus_xs.c
> > +++ b/drivers/xen/xenbus/xenbus_xs.c
> > @@ -701,6 +701,8 @@ int register_xenbus_watch(struct xenbus_watch *watch)
> >
> > sprintf(token, "%lX", (long)watch);
> >
> > + watch->nr_pending = 0;
> > +
>
> I'm missing the incrementing of nr_pending, which was present in the
> upstream patch.
Oops, it should be in this patch, but I mistakenly put it in the fifth patch.
67 --- a/drivers/xen/xenbus/xenbus_xs.c
68 +++ b/drivers/xen/xenbus/xenbus_xs.c
69 @@ -917,6 +917,7 @@ static int process_msg(void)
70 msg->u.watch.vec_size))) {
71 spin_lock(&watch_events_lock);
72 list_add_tail(&msg->list, &watch_events);
73 + msg->u.watch.handle->nr_pending++;
74 wake_up(&watch_events_waitq);
75 spin_unlock(&watch_events_lock);
76 } else {
77 --
And I just realized I even didn't post the fifth patch.
I will fix this and post new version (v3) soon.
Thank you for catching this, Juergen.
Thanks,
SeongJae Park
Powered by blists - more mailing lists