* [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) @ 2021-01-04 17:53 Alex Deucher 2021-01-14 3:24 ` Alex Deucher 0 siblings, 1 reply; 5+ messages in thread From: Alex Deucher @ 2021-01-04 17:53 UTC (permalink / raw) To: amd-gfx; +Cc: Alex Deucher Make sure the copy succeeded. Also fixes a warning. v2: fix the error check Signed-off-by: Alex Deucher <alexander.deucher@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c index 455978781380..b033344c5ce2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c @@ -101,7 +101,9 @@ static ssize_t amdgpu_securedisplay_debugfs_write(struct file *f, const char __u return -EINVAL; memset(str, 0, sizeof(str)); - copy_from_user(str, buf, size); + ret = copy_from_user(str, buf, size); + if (ret) + return -EFAULT; ret = pm_runtime_get_sync(dev->dev); if (ret < 0) { -- 2.29.2 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) 2021-01-04 17:53 [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) Alex Deucher @ 2021-01-14 3:24 ` Alex Deucher 2021-01-14 3:27 ` Su, Jinzhou (Joe) 0 siblings, 1 reply; 5+ messages in thread From: Alex Deucher @ 2021-01-14 3:24 UTC (permalink / raw) To: amd-gfx list, Su, Jinzhou (Joe); +Cc: Alex Deucher + Joe On Mon, Jan 4, 2021 at 12:53 PM Alex Deucher <alexdeucher@gmail.com> wrote: > > Make sure the copy succeeded. Also fixes a warning. > > v2: fix the error check > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > index 455978781380..b033344c5ce2 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > @@ -101,7 +101,9 @@ static ssize_t amdgpu_securedisplay_debugfs_write(struct file *f, const char __u > return -EINVAL; > > memset(str, 0, sizeof(str)); > - copy_from_user(str, buf, size); > + ret = copy_from_user(str, buf, size); > + if (ret) > + return -EFAULT; > > ret = pm_runtime_get_sync(dev->dev); > if (ret < 0) { > -- > 2.29.2 > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) 2021-01-14 3:24 ` Alex Deucher @ 2021-01-14 3:27 ` Su, Jinzhou (Joe) 2021-01-14 4:17 ` Deucher, Alexander 0 siblings, 1 reply; 5+ messages in thread From: Su, Jinzhou (Joe) @ 2021-01-14 3:27 UTC (permalink / raw) To: Alex Deucher, amd-gfx list; +Cc: Deucher, Alexander [AMD Official Use Only - Internal Distribution Only] Thanks, Alex! Regards, Joe -----Original Message----- From: Alex Deucher <alexdeucher@gmail.com> Sent: Thursday, January 14, 2021 11:24 AM To: amd-gfx list <amd-gfx@lists.freedesktop.org>; Su, Jinzhou (Joe) <Jinzhou.Su@amd.com> Cc: Deucher, Alexander <Alexander.Deucher@amd.com> Subject: Re: [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) + Joe On Mon, Jan 4, 2021 at 12:53 PM Alex Deucher <alexdeucher@gmail.com> wrote: > > Make sure the copy succeeded. Also fixes a warning. > > v2: fix the error check > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > index 455978781380..b033344c5ce2 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > @@ -101,7 +101,9 @@ static ssize_t amdgpu_securedisplay_debugfs_write(struct file *f, const char __u > return -EINVAL; > > memset(str, 0, sizeof(str)); > - copy_from_user(str, buf, size); > + ret = copy_from_user(str, buf, size); > + if (ret) > + return -EFAULT; > > ret = pm_runtime_get_sync(dev->dev); > if (ret < 0) { > -- > 2.29.2 > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) 2021-01-14 3:27 ` Su, Jinzhou (Joe) @ 2021-01-14 4:17 ` Deucher, Alexander 2021-01-14 6:14 ` Su, Jinzhou (Joe) 0 siblings, 1 reply; 5+ messages in thread From: Deucher, Alexander @ 2021-01-14 4:17 UTC (permalink / raw) To: Su, Jinzhou (Joe), Alex Deucher, amd-gfx list [AMD Public Use] > -----Original Message----- > From: Su, Jinzhou (Joe) <Jinzhou.Su@amd.com> > Sent: Wednesday, January 13, 2021 10:27 PM > To: Alex Deucher <alexdeucher@gmail.com>; amd-gfx list <amd- > gfx@lists.freedesktop.org> > Cc: Deucher, Alexander <Alexander.Deucher@amd.com> > Subject: RE: [PATCH] drm/amdgpu: check the result of copy_from_user in > secure display debugfs (v2) > > [AMD Official Use Only - Internal Distribution Only] > > Thanks, Alex! Can I get a Reviewed-by or Acked-by? Thanks! Alex > > Regards, > Joe > > -----Original Message----- > From: Alex Deucher <alexdeucher@gmail.com> > Sent: Thursday, January 14, 2021 11:24 AM > To: amd-gfx list <amd-gfx@lists.freedesktop.org>; Su, Jinzhou (Joe) > <Jinzhou.Su@amd.com> > Cc: Deucher, Alexander <Alexander.Deucher@amd.com> > Subject: Re: [PATCH] drm/amdgpu: check the result of copy_from_user in > secure display debugfs (v2) > > + Joe > > On Mon, Jan 4, 2021 at 12:53 PM Alex Deucher <alexdeucher@gmail.com> > wrote: > > > > Make sure the copy succeeded. Also fixes a warning. > > > > v2: fix the error check > > > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com> > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > > index 455978781380..b033344c5ce2 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > > @@ -101,7 +101,9 @@ static ssize_t > amdgpu_securedisplay_debugfs_write(struct file *f, const char __u > > return -EINVAL; > > > > memset(str, 0, sizeof(str)); > > - copy_from_user(str, buf, size); > > + ret = copy_from_user(str, buf, size); > > + if (ret) > > + return -EFAULT; > > > > ret = pm_runtime_get_sync(dev->dev); > > if (ret < 0) { > > -- > > 2.29.2 > > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) 2021-01-14 4:17 ` Deucher, Alexander @ 2021-01-14 6:14 ` Su, Jinzhou (Joe) 0 siblings, 0 replies; 5+ messages in thread From: Su, Jinzhou (Joe) @ 2021-01-14 6:14 UTC (permalink / raw) To: Deucher, Alexander, Alex Deucher, amd-gfx list [AMD Public Use] Reviewed-by : Jinzhou Su <Jinzhou.Su@amd.com> Regards, Joe -----Original Message----- From: Deucher, Alexander <Alexander.Deucher@amd.com> Sent: Thursday, January 14, 2021 12:17 PM To: Su, Jinzhou (Joe) <Jinzhou.Su@amd.com>; Alex Deucher <alexdeucher@gmail.com>; amd-gfx list <amd-gfx@lists.freedesktop.org> Subject: RE: [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) [AMD Public Use] > -----Original Message----- > From: Su, Jinzhou (Joe) <Jinzhou.Su@amd.com> > Sent: Wednesday, January 13, 2021 10:27 PM > To: Alex Deucher <alexdeucher@gmail.com>; amd-gfx list <amd- > gfx@lists.freedesktop.org> > Cc: Deucher, Alexander <Alexander.Deucher@amd.com> > Subject: RE: [PATCH] drm/amdgpu: check the result of copy_from_user in > secure display debugfs (v2) > > [AMD Official Use Only - Internal Distribution Only] > > Thanks, Alex! Can I get a Reviewed-by or Acked-by? Thanks! Alex > > Regards, > Joe > > -----Original Message----- > From: Alex Deucher <alexdeucher@gmail.com> > Sent: Thursday, January 14, 2021 11:24 AM > To: amd-gfx list <amd-gfx@lists.freedesktop.org>; Su, Jinzhou (Joe) > <Jinzhou.Su@amd.com> > Cc: Deucher, Alexander <Alexander.Deucher@amd.com> > Subject: Re: [PATCH] drm/amdgpu: check the result of copy_from_user in > secure display debugfs (v2) > > + Joe > > On Mon, Jan 4, 2021 at 12:53 PM Alex Deucher <alexdeucher@gmail.com> > wrote: > > > > Make sure the copy succeeded. Also fixes a warning. > > > > v2: fix the error check > > > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com> > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > > index 455978781380..b033344c5ce2 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c > > @@ -101,7 +101,9 @@ static ssize_t > amdgpu_securedisplay_debugfs_write(struct file *f, const char __u > > return -EINVAL; > > > > memset(str, 0, sizeof(str)); > > - copy_from_user(str, buf, size); > > + ret = copy_from_user(str, buf, size); > > + if (ret) > > + return -EFAULT; > > > > ret = pm_runtime_get_sync(dev->dev); > > if (ret < 0) { > > -- > > 2.29.2 > > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-01-14 6:14 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-01-04 17:53 [PATCH] drm/amdgpu: check the result of copy_from_user in secure display debugfs (v2) Alex Deucher 2021-01-14 3:24 ` Alex Deucher 2021-01-14 3:27 ` Su, Jinzhou (Joe) 2021-01-14 4:17 ` Deucher, Alexander 2021-01-14 6:14 ` Su, Jinzhou (Joe)
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.