[PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

Subsystems: the rest, virtio host (vhost)

STALE2035d REVIEWED: 1 (0M)

1 review trailer.

5 messages, 3 authors, 2021-01-13 · open the first message on its own page

[PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

From: Cindy Lu <hidden>
Date: 2021-01-12 05:38:27

In vhost_vdpa_set_config_call, the cb.private should be vhost_vdpa.
this cb.private will finally use in vhost_vdpa_config_cb as
vhost_vdpa. Fix this issue.

Fixes: 776f395004d82 ("vhost_vdpa: Support config interrupt in vdpa")
Acked-by: Jason Wang <redacted>
Signed-off-by: Cindy Lu <redacted>
---
 drivers/vhost/vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index ef688c8c0e0e..3fbb9c1f49da 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -319,7 +319,7 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
 	struct eventfd_ctx *ctx;
 
 	cb.callback = vhost_vdpa_config_cb;
-	cb.private = v->vdpa;
+	cb.private = v;
 	if (copy_from_user(&fd, argp, sizeof(fd)))
 		return  -EFAULT;
 
-- 
2.21.3

Re: [PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-01-12 07:50:53

On Tue, Jan 12, 2021 at 01:36:29PM +0800, Cindy Lu wrote:
In vhost_vdpa_set_config_call, the cb.private should be vhost_vdpa.
this cb.private will finally use in vhost_vdpa_config_cb as
vhost_vdpa. Fix this issue.

Fixes: 776f395004d82 ("vhost_vdpa: Support config interrupt in vdpa")
Acked-by: Jason Wang <redacted>
Signed-off-by: Cindy Lu <redacted>
---
 drivers/vhost/vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

Re: [PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

From: Jason Wang <hidden>
Date: 2021-01-13 03:40:28

On 2021/1/12 下午1:36, Cindy Lu wrote:
In vhost_vdpa_set_config_call, the cb.private should be vhost_vdpa.
this cb.private will finally use in vhost_vdpa_config_cb as
vhost_vdpa. Fix this issue.

Fixes: 776f395004d82 ("vhost_vdpa: Support config interrupt in vdpa")
Acked-by: Jason Wang <redacted>
Signed-off-by: Cindy Lu <redacted>
---

Hi Cindy:

I think at least you forget to cc stable.

Thanks

quoted hunk
  drivers/vhost/vdpa.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index ef688c8c0e0e..3fbb9c1f49da 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -319,7 +319,7 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
  	struct eventfd_ctx *ctx;
  
  	cb.callback = vhost_vdpa_config_cb;
-	cb.private = v->vdpa;
+	cb.private = v;
  	if (copy_from_user(&fd, argp, sizeof(fd)))
  		return  -EFAULT;
  

Re: [PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

From: Cindy Lu <hidden>
Date: 2021-01-13 04:14:33

On Wed, Jan 13, 2021 at 11:38 AM Jason Wang [off-list ref] wrote:

On 2021/1/12 下午1:36, Cindy Lu wrote:
quoted
In vhost_vdpa_set_config_call, the cb.private should be vhost_vdpa.
this cb.private will finally use in vhost_vdpa_config_cb as
vhost_vdpa. Fix this issue.

Fixes: 776f395004d82 ("vhost_vdpa: Support config interrupt in vdpa")
Acked-by: Jason Wang <redacted>
Signed-off-by: Cindy Lu <redacted>
---

Hi Cindy:

I think at least you forget to cc stable.

Thanks
Sure Thanks Jason I will post a new version
quoted
  drivers/vhost/vdpa.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index ef688c8c0e0e..3fbb9c1f49da 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -319,7 +319,7 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
      struct eventfd_ctx *ctx;

      cb.callback = vhost_vdpa_config_cb;
-     cb.private = v->vdpa;
+     cb.private = v;
      if (copy_from_user(&fd, argp, sizeof(fd)))
              return  -EFAULT;

Re: [PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

From: Cindy Lu <hidden>
Date: 2021-01-13 04:15:25

On Tue, Jan 12, 2021 at 3:53 PM Greg KH [off-list ref] wrote:
On Tue, Jan 12, 2021 at 01:36:29PM +0800, Cindy Lu wrote:
quoted
In vhost_vdpa_set_config_call, the cb.private should be vhost_vdpa.
this cb.private will finally use in vhost_vdpa_config_cb as
vhost_vdpa. Fix this issue.

Fixes: 776f395004d82 ("vhost_vdpa: Support config interrupt in vdpa")
Acked-by: Jason Wang <redacted>
Signed-off-by: Cindy Lu <redacted>
---
 drivers/vhost/vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>
Thanks Greg, I will fix this and send a new version
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help