mbox series

[v1,0/1,SRU,J:linux-bluefield,v1,0/1] UBUNTU: SAUCE: mlxbf-tmfifo: fix potential race

Message ID cover.1681327632.git.limings@nvidia.com
Headers show
Series UBUNTU: SAUCE: mlxbf-tmfifo: fix potential race | expand

Message

Liming Sun April 12, 2023, 7:35 p.m. UTC
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux-bluefield/+bug/2016039

SRU Justification:

[Impact]
This change is needed to avoid potential race of accessing the 'vq' pointer

[Fix]
The fix adds memory barrier for the is_ready flag and the 'vq' pointer access in mlxbf_tmfifo_virtio_find_vqs(), so updated in vq will be visible before accessing this pointer.

[Test Case]
Same functionality and testing as on BlueField-1/2/3. No functionality change.

[Regression Potential]
Same behavior from user perspective

Liming Sun (1):
  mlxbf-tmfifo: fix potential race

 drivers/platform/mellanox/mlxbf-tmfifo.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Andrei Gherzan April 13, 2023, 12:26 p.m. UTC | #1
On 23/04/12 03:35PM, Liming Sun wrote:
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux-bluefield/+bug/2016039

We should use the standard bug links. This would be:

https://bugs.launchpad.net/bugs/2016039

> 
> SRU Justification:
> 
> [Impact]
> This change is needed to avoid potential race of accessing the 'vq' pointer
> 
> [Fix]
> The fix adds memory barrier for the is_ready flag and the 'vq' pointer access in mlxbf_tmfifo_virtio_find_vqs(), so updated in vq will be visible before accessing this pointer.
> 
> [Test Case]
> Same functionality and testing as on BlueField-1/2/3. No functionality change.
> 
> [Regression Potential]
> Same behavior from user perspective
> 
> Liming Sun (1):
>   mlxbf-tmfifo: fix potential race
> 
>  drivers/platform/mellanox/mlxbf-tmfifo.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> -- 
> 2.30.1
>
Liming Sun April 13, 2023, 12:33 p.m. UTC | #2
Thanks! I posted v2 with the updated bug link. No other changes.

- Liming

> -----Original Message-----
> From: Andrei Gherzan <andrei.gherzan@canonical.com>
> Sent: Thursday, April 13, 2023 8:26 AM
> To: Liming Sun <limings@nvidia.com>
> Cc: kernel-team@lists.ubuntu.com
> Subject: Cmnt: [PATCH v1 0/1] [SRU][J:linux-bluefield][PATCH v1 0/1]
> UBUNTU: SAUCE: mlxbf-tmfifo: fix potential race
> 
> On 23/04/12 03:35PM, Liming Sun wrote:
> > BugLink: https://bugs.launchpad.net/ubuntu/+source/linux-
> bluefield/+bug/2016039
> 
> We should use the standard bug links. This would be:
> 
> https://bugs.launchpad.net/bugs/2016039
> 
> >
> > SRU Justification:
> >
> > [Impact]
> > This change is needed to avoid potential race of accessing the 'vq' pointer
> >
> > [Fix]
> > The fix adds memory barrier for the is_ready flag and the 'vq' pointer access
> in mlxbf_tmfifo_virtio_find_vqs(), so updated in vq will be visible before
> accessing this pointer.
> >
> > [Test Case]
> > Same functionality and testing as on BlueField-1/2/3. No functionality
> change.
> >
> > [Regression Potential]
> > Same behavior from user perspective
> >
> > Liming Sun (1):
> >   mlxbf-tmfifo: fix potential race
> >
> >  drivers/platform/mellanox/mlxbf-tmfifo.c | 11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> >
> > --
> > 2.30.1
> >
> 
> --
> Andrei Gherzan
Bartlomiej Zolnierkiewicz June 2, 2023, 11:53 a.m. UTC | #3
Acked-by: Bartlomiej Zolnierkiewicz <bartlomiej.zolnierkiewicz@canonical.com>

Since the patch is small and info about mlxbf_tmfifo_create_vdev()
failure case fix can be added while applying it I've reluctantly
ACK-ed it as it is. However please next time use separate patches for
unrelated changes.

On Thu, Apr 13, 2023 at 2:33 PM Liming Sun <limings@nvidia.com> wrote:
>
> BugLink: https://bugs.launchpad.net/bugs/2016039
>
> SRU Justification:
>
> [Impact]
> This change is needed to avoid potential race of accessing the 'vq' pointer
>
> [Fix]
> The fix adds memory barrier for the is_ready flag and the 'vq' pointer access in mlxbf_tmfifo_virtio_find_vqs(), so updated in vq will be visible before accessing this pointer.
>
> [Test Case]
> Same functionality and testing as on BlueField-1/2/3. No functionality change.
>
> [Regression Potential]
> Same behavior from user perspective
>
> Liming Sun (1):
>   mlxbf-tmfifo: fix potential race
>
>  drivers/platform/mellanox/mlxbf-tmfifo.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
Bartlomiej Zolnierkiewicz June 5, 2023, 10:14 a.m. UTC | #4
Applied to jammy:linux-bluefield/master-next. Thanks.

--
Best regards,
Bartlomiej

On Thu, Apr 13, 2023 at 2:33 PM Liming Sun <limings@nvidia.com> wrote:
>
> BugLink: https://bugs.launchpad.net/bugs/2016039
>
> SRU Justification:
>
> [Impact]
> This change is needed to avoid potential race of accessing the 'vq' pointer
>
> [Fix]
> The fix adds memory barrier for the is_ready flag and the 'vq' pointer access in mlxbf_tmfifo_virtio_find_vqs(), so updated in vq will be visible before accessing this pointer.
>
> [Test Case]
> Same functionality and testing as on BlueField-1/2/3. No functionality change.
>
> [Regression Potential]
> Same behavior from user perspective
>
> Liming Sun (1):
>   mlxbf-tmfifo: fix potential race
>
>  drivers/platform/mellanox/mlxbf-tmfifo.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)