* [PATCH v2] drm/nouveau/secboot: remove VLA usage
@ 2018-03-13 16:24 Gustavo A. R. Silva
2018-03-14 11:08 ` Thierry Reding
0 siblings, 1 reply; 11+ messages in thread
From: Gustavo A. R. Silva @ 2018-03-13 16:24 UTC (permalink / raw)
To: David Laight, Ben Skeggs, David Airlie
Cc: dri-devel, nouveau, linux-kernel, Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA. In this particular
case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
variable cmdline_size. Also, remove cmdline_size as it is not
actually useful anymore.
The use of stack Variable Length Arrays needs to be avoided, as they
can be a vector for stack exhaustion, which can be both a runtime bug
or a security flaw. Also, in general, as code evolves it is easy to
lose track of how big a VLA can get. Thus, we can end up having runtime
failures that are hard to debug.
Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
Changes in v2:
- Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
is based on the feedback provided by David Laight. Thanks David.
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c
index 6f10b09..1e1f1c6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c
@@ -80,12 +80,11 @@ acr_ls_msgqueue_post_run(struct nvkm_msgqueue *queue,
struct nvkm_falcon *falcon, u32 addr_args)
{
struct nvkm_device *device = falcon->owner->device;
- u32 cmdline_size = NVKM_MSGQUEUE_CMDLINE_SIZE;
- u8 buf[cmdline_size];
+ u8 buf[NVKM_MSGQUEUE_CMDLINE_SIZE];
- memset(buf, 0, cmdline_size);
+ memset(buf, 0, sizeof(buf));
nvkm_msgqueue_write_cmdline(queue, buf);
- nvkm_falcon_load_dmem(falcon, buf, addr_args, cmdline_size, 0);
+ nvkm_falcon_load_dmem(falcon, buf, addr_args, sizeof(buf), 0);
/* rearm the queue so it will wait for the init message */
nvkm_msgqueue_reinit(queue);
--
2.7.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
2018-03-13 16:24 [PATCH v2] drm/nouveau/secboot: remove VLA usage Gustavo A. R. Silva
@ 2018-03-14 11:08 ` Thierry Reding
0 siblings, 0 replies; 11+ messages in thread
From: Thierry Reding @ 2018-03-14 11:08 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: David Laight, Ben Skeggs, David Airlie, dri-devel, nouveau, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]
On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wvla, remove VLA. In this particular
> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
> variable cmdline_size. Also, remove cmdline_size as it is not
> actually useful anymore.
>
> The use of stack Variable Length Arrays needs to be avoided, as they
> can be a vector for stack exhaustion, which can be both a runtime bug
> or a security flaw. Also, in general, as code evolves it is easy to
> lose track of how big a VLA can get. Thus, we can end up having runtime
> failures that are hard to debug.
>
> Also, fixed as part of the directive to remove all VLAs from
> the kernel: https://lkml.org/lkml/2018/3/7/621
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> Changes in v2:
> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
> is based on the feedback provided by David Laight. Thanks David.
>
> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
Reviewed-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
@ 2018-03-14 11:08 ` Thierry Reding
0 siblings, 0 replies; 11+ messages in thread
From: Thierry Reding @ 2018-03-14 11:08 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: David Airlie, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, David Laight,
Ben Skeggs
[-- Attachment #1.1: Type: text/plain, Size: 1229 bytes --]
On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wvla, remove VLA. In this particular
> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
> variable cmdline_size. Also, remove cmdline_size as it is not
> actually useful anymore.
>
> The use of stack Variable Length Arrays needs to be avoided, as they
> can be a vector for stack exhaustion, which can be both a runtime bug
> or a security flaw. Also, in general, as code evolves it is easy to
> lose track of how big a VLA can get. Thus, we can end up having runtime
> failures that are hard to debug.
>
> Also, fixed as part of the directive to remove all VLAs from
> the kernel: https://lkml.org/lkml/2018/3/7/621
>
> Signed-off-by: Gustavo A. R. Silva <gustavo-L1vi/lXTdts+Va1GwOuvDg@public.gmane.org>
> ---
> Changes in v2:
> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
> is based on the feedback provided by David Laight. Thanks David.
>
> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
Reviewed-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
2018-03-14 11:08 ` Thierry Reding
@ 2018-03-16 2:05 ` Ben Skeggs
-1 siblings, 0 replies; 11+ messages in thread
From: Ben Skeggs @ 2018-03-16 2:05 UTC (permalink / raw)
To: Thierry Reding
Cc: Gustavo A. R. Silva, David Airlie, nouveau, linux-kernel,
dri-devel, David Laight, Ben Skeggs
On 14 March 2018 at 21:08, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wvla, remove VLA. In this particular
>> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
>> variable cmdline_size. Also, remove cmdline_size as it is not
>> actually useful anymore.
>>
>> The use of stack Variable Length Arrays needs to be avoided, as they
>> can be a vector for stack exhaustion, which can be both a runtime bug
>> or a security flaw. Also, in general, as code evolves it is easy to
>> lose track of how big a VLA can get. Thus, we can end up having runtime
>> failures that are hard to debug.
>>
>> Also, fixed as part of the directive to remove all VLAs from
>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>> Changes in v2:
>> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
>> is based on the feedback provided by David Laight. Thanks David.
>>
>> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> Reviewed-by: Thierry Reding <treding@nvidia.com>
Thanks everyone. I've taken the patch in my tree.
Ben.
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
@ 2018-03-16 2:05 ` Ben Skeggs
0 siblings, 0 replies; 11+ messages in thread
From: Ben Skeggs @ 2018-03-16 2:05 UTC (permalink / raw)
To: Thierry Reding
Cc: Gustavo A. R. Silva, David Airlie,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, David Laight,
Ben Skeggs
On 14 March 2018 at 21:08, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wvla, remove VLA. In this particular
>> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
>> variable cmdline_size. Also, remove cmdline_size as it is not
>> actually useful anymore.
>>
>> The use of stack Variable Length Arrays needs to be avoided, as they
>> can be a vector for stack exhaustion, which can be both a runtime bug
>> or a security flaw. Also, in general, as code evolves it is easy to
>> lose track of how big a VLA can get. Thus, we can end up having runtime
>> failures that are hard to debug.
>>
>> Also, fixed as part of the directive to remove all VLAs from
>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>> Changes in v2:
>> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
>> is based on the feedback provided by David Laight. Thanks David.
>>
>> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> Reviewed-by: Thierry Reding <treding@nvidia.com>
Thanks everyone. I've taken the patch in my tree.
Ben.
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
2018-03-16 2:05 ` Ben Skeggs
(?)
@ 2018-04-26 23:25 ` Kees Cook
2018-05-23 22:48 ` Kees Cook
-1 siblings, 1 reply; 11+ messages in thread
From: Kees Cook @ 2018-04-26 23:25 UTC (permalink / raw)
To: Ben Skeggs
Cc: Thierry Reding, Gustavo A. R. Silva, David Airlie, nouveau, LKML,
Maling list - DRI developers, David Laight, Ben Skeggs
On Thu, Mar 15, 2018 at 7:05 PM, Ben Skeggs <skeggsb@gmail.com> wrote:
> On 14 March 2018 at 21:08, Thierry Reding <thierry.reding@gmail.com> wrote:
>> On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
>>> In preparation to enabling -Wvla, remove VLA. In this particular
>>> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
>>> variable cmdline_size. Also, remove cmdline_size as it is not
>>> actually useful anymore.
>>>
>>> The use of stack Variable Length Arrays needs to be avoided, as they
>>> can be a vector for stack exhaustion, which can be both a runtime bug
>>> or a security flaw. Also, in general, as code evolves it is easy to
>>> lose track of how big a VLA can get. Thus, we can end up having runtime
>>> failures that are hard to debug.
>>>
>>> Also, fixed as part of the directive to remove all VLAs from
>>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>>
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>> ---
>>> Changes in v2:
>>> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
>>> is based on the feedback provided by David Laight. Thanks David.
>>>
>>> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> Reviewed-by: Thierry Reding <treding@nvidia.com>
> Thanks everyone. I've taken the patch in my tree.
Hi!
Just checking in on this -- I don't see this patch in linux-next. Is
this queued somewhere else?
Thanks!
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
2018-04-26 23:25 ` Kees Cook
@ 2018-05-23 22:48 ` Kees Cook
2018-05-24 0:36 ` Ben Skeggs
0 siblings, 1 reply; 11+ messages in thread
From: Kees Cook @ 2018-05-23 22:48 UTC (permalink / raw)
To: Ben Skeggs, Daniel Vetter
Cc: Thierry Reding, Gustavo A. R. Silva, David Airlie, nouveau, LKML,
Maling list - DRI developers, David Laight, Ben Skeggs
On Thu, Apr 26, 2018 at 4:25 PM, Kees Cook <keescook@chromium.org> wrote:
> On Thu, Mar 15, 2018 at 7:05 PM, Ben Skeggs <skeggsb@gmail.com> wrote:
>> On 14 March 2018 at 21:08, Thierry Reding <thierry.reding@gmail.com> wrote:
>>> On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
>>>> In preparation to enabling -Wvla, remove VLA. In this particular
>>>> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
>>>> variable cmdline_size. Also, remove cmdline_size as it is not
>>>> actually useful anymore.
>>>>
>>>> The use of stack Variable Length Arrays needs to be avoided, as they
>>>> can be a vector for stack exhaustion, which can be both a runtime bug
>>>> or a security flaw. Also, in general, as code evolves it is easy to
>>>> lose track of how big a VLA can get. Thus, we can end up having runtime
>>>> failures that are hard to debug.
>>>>
>>>> Also, fixed as part of the directive to remove all VLAs from
>>>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>>>
>>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>>> ---
>>>> Changes in v2:
>>>> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
>>>> is based on the feedback provided by David Laight. Thanks David.
>>>>
>>>> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
>>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>>
>>> Reviewed-by: Thierry Reding <treding@nvidia.com>
>> Thanks everyone. I've taken the patch in my tree.
>
> Hi!
>
> Just checking in on this -- I don't see this patch in linux-next. Is
> this queued somewhere else?
Hi, it's been another month; I still don't see this in linux-next.
Daniel, can this go via drm-misc?
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
@ 2018-05-24 0:36 ` Ben Skeggs
0 siblings, 0 replies; 11+ messages in thread
From: Ben Skeggs @ 2018-05-24 0:36 UTC (permalink / raw)
To: Kees Cook
Cc: Ben Skeggs, Daniel Vetter, Thierry Reding, Gustavo A. R. Silva,
David Airlie, nouveau, LKML, Maling list - DRI developers,
David Laight
On Thu, May 24, 2018 at 8:48 AM, Kees Cook <keescook@chromium.org> wrote:
> On Thu, Apr 26, 2018 at 4:25 PM, Kees Cook <keescook@chromium.org> wrote:
>> On Thu, Mar 15, 2018 at 7:05 PM, Ben Skeggs <skeggsb@gmail.com> wrote:
>>> On 14 March 2018 at 21:08, Thierry Reding <thierry.reding@gmail.com> wrote:
>>>> On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
>>>>> In preparation to enabling -Wvla, remove VLA. In this particular
>>>>> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
>>>>> variable cmdline_size. Also, remove cmdline_size as it is not
>>>>> actually useful anymore.
>>>>>
>>>>> The use of stack Variable Length Arrays needs to be avoided, as they
>>>>> can be a vector for stack exhaustion, which can be both a runtime bug
>>>>> or a security flaw. Also, in general, as code evolves it is easy to
>>>>> lose track of how big a VLA can get. Thus, we can end up having runtime
>>>>> failures that are hard to debug.
>>>>>
>>>>> Also, fixed as part of the directive to remove all VLAs from
>>>>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>>>>
>>>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>>>> ---
>>>>> Changes in v2:
>>>>> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
>>>>> is based on the feedback provided by David Laight. Thanks David.
>>>>>
>>>>> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
>>>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>>>
>>>> Reviewed-by: Thierry Reding <treding@nvidia.com>
>>> Thanks everyone. I've taken the patch in my tree.
>>
>> Hi!
>>
>> Just checking in on this -- I don't see this patch in linux-next. Is
>> this queued somewhere else?
>
> Hi, it's been another month; I still don't see this in linux-next.
> Daniel, can this go via drm-misc?
It's already queued in drm-next.
>
> -Kees
>
> --
> Kees Cook
> Pixel Security
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
@ 2018-05-24 0:36 ` Ben Skeggs
0 siblings, 0 replies; 11+ messages in thread
From: Ben Skeggs @ 2018-05-24 0:36 UTC (permalink / raw)
To: Kees Cook
Cc: Gustavo A. R. Silva, David Airlie, LKML,
Maling list - DRI developers, Thierry Reding, nouveau,
David Laight
On Thu, May 24, 2018 at 8:48 AM, Kees Cook <keescook@chromium.org> wrote:
> On Thu, Apr 26, 2018 at 4:25 PM, Kees Cook <keescook@chromium.org> wrote:
>> On Thu, Mar 15, 2018 at 7:05 PM, Ben Skeggs <skeggsb@gmail.com> wrote:
>>> On 14 March 2018 at 21:08, Thierry Reding <thierry.reding@gmail.com> wrote:
>>>> On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
>>>>> In preparation to enabling -Wvla, remove VLA. In this particular
>>>>> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
>>>>> variable cmdline_size. Also, remove cmdline_size as it is not
>>>>> actually useful anymore.
>>>>>
>>>>> The use of stack Variable Length Arrays needs to be avoided, as they
>>>>> can be a vector for stack exhaustion, which can be both a runtime bug
>>>>> or a security flaw. Also, in general, as code evolves it is easy to
>>>>> lose track of how big a VLA can get. Thus, we can end up having runtime
>>>>> failures that are hard to debug.
>>>>>
>>>>> Also, fixed as part of the directive to remove all VLAs from
>>>>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>>>>
>>>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>>>> ---
>>>>> Changes in v2:
>>>>> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
>>>>> is based on the feedback provided by David Laight. Thanks David.
>>>>>
>>>>> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
>>>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>>>
>>>> Reviewed-by: Thierry Reding <treding@nvidia.com>
>>> Thanks everyone. I've taken the patch in my tree.
>>
>> Hi!
>>
>> Just checking in on this -- I don't see this patch in linux-next. Is
>> this queued somewhere else?
>
> Hi, it's been another month; I still don't see this in linux-next.
> Daniel, can this go via drm-misc?
It's already queued in drm-next.
>
> -Kees
>
> --
> Kees Cook
> Pixel Security
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
@ 2018-05-24 0:47 ` Kees Cook
0 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2018-05-24 0:47 UTC (permalink / raw)
To: Ben Skeggs
Cc: Ben Skeggs, Daniel Vetter, Thierry Reding, Gustavo A. R. Silva,
David Airlie, nouveau, LKML, Maling list - DRI developers,
David Laight
On Wed, May 23, 2018 at 5:36 PM, Ben Skeggs <bskeggs@redhat.com> wrote:
> On Thu, May 24, 2018 at 8:48 AM, Kees Cook <keescook@chromium.org> wrote:
>> On Thu, Apr 26, 2018 at 4:25 PM, Kees Cook <keescook@chromium.org> wrote:
>>> On Thu, Mar 15, 2018 at 7:05 PM, Ben Skeggs <skeggsb@gmail.com> wrote:
>>>> On 14 March 2018 at 21:08, Thierry Reding <thierry.reding@gmail.com> wrote:
>>>>> On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
>>>>>> In preparation to enabling -Wvla, remove VLA. In this particular
>>>>>> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
>>>>>> variable cmdline_size. Also, remove cmdline_size as it is not
>>>>>> actually useful anymore.
>>>>>>
>>>>>> The use of stack Variable Length Arrays needs to be avoided, as they
>>>>>> can be a vector for stack exhaustion, which can be both a runtime bug
>>>>>> or a security flaw. Also, in general, as code evolves it is easy to
>>>>>> lose track of how big a VLA can get. Thus, we can end up having runtime
>>>>>> failures that are hard to debug.
>>>>>>
>>>>>> Also, fixed as part of the directive to remove all VLAs from
>>>>>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>>>>>
>>>>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>>>>> ---
>>>>>> Changes in v2:
>>>>>> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
>>>>>> is based on the feedback provided by David Laight. Thanks David.
>>>>>>
>>>>>> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
>>>>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>>>>
>>>>> Reviewed-by: Thierry Reding <treding@nvidia.com>
>>>> Thanks everyone. I've taken the patch in my tree.
>>>
>>> Hi!
>>>
>>> Just checking in on this -- I don't see this patch in linux-next. Is
>>> this queued somewhere else?
>>
>> Hi, it's been another month; I still don't see this in linux-next.
>> Daniel, can this go via drm-misc?
> It's already queued in drm-next.
Ah-ha, great, thanks! Looks like I just got unlucky with linux-next
pausing on the 17th and this getting committed on the 18th. :) But,
yes, I see it now:
https://cgit.freedesktop.org/drm/drm/commit/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c?id=7bf5b70befd7817b9e42acbd2291b2042ea1bf81
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drm/nouveau/secboot: remove VLA usage
@ 2018-05-24 0:47 ` Kees Cook
0 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2018-05-24 0:47 UTC (permalink / raw)
To: Ben Skeggs
Cc: Gustavo A. R. Silva, David Airlie, LKML,
Maling list - DRI developers, Thierry Reding, nouveau,
David Laight
On Wed, May 23, 2018 at 5:36 PM, Ben Skeggs <bskeggs@redhat.com> wrote:
> On Thu, May 24, 2018 at 8:48 AM, Kees Cook <keescook@chromium.org> wrote:
>> On Thu, Apr 26, 2018 at 4:25 PM, Kees Cook <keescook@chromium.org> wrote:
>>> On Thu, Mar 15, 2018 at 7:05 PM, Ben Skeggs <skeggsb@gmail.com> wrote:
>>>> On 14 March 2018 at 21:08, Thierry Reding <thierry.reding@gmail.com> wrote:
>>>>> On Tue, Mar 13, 2018 at 11:24:11AM -0500, Gustavo A. R. Silva wrote:
>>>>>> In preparation to enabling -Wvla, remove VLA. In this particular
>>>>>> case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
>>>>>> variable cmdline_size. Also, remove cmdline_size as it is not
>>>>>> actually useful anymore.
>>>>>>
>>>>>> The use of stack Variable Length Arrays needs to be avoided, as they
>>>>>> can be a vector for stack exhaustion, which can be both a runtime bug
>>>>>> or a security flaw. Also, in general, as code evolves it is easy to
>>>>>> lose track of how big a VLA can get. Thus, we can end up having runtime
>>>>>> failures that are hard to debug.
>>>>>>
>>>>>> Also, fixed as part of the directive to remove all VLAs from
>>>>>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>>>>>
>>>>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>>>>> ---
>>>>>> Changes in v2:
>>>>>> - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change
>>>>>> is based on the feedback provided by David Laight. Thanks David.
>>>>>>
>>>>>> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 7 +++----
>>>>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>>>>
>>>>> Reviewed-by: Thierry Reding <treding@nvidia.com>
>>>> Thanks everyone. I've taken the patch in my tree.
>>>
>>> Hi!
>>>
>>> Just checking in on this -- I don't see this patch in linux-next. Is
>>> this queued somewhere else?
>>
>> Hi, it's been another month; I still don't see this in linux-next.
>> Daniel, can this go via drm-misc?
> It's already queued in drm-next.
Ah-ha, great, thanks! Looks like I just got unlucky with linux-next
pausing on the 17th and this getting committed on the 18th. :) But,
yes, I see it now:
https://cgit.freedesktop.org/drm/drm/commit/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c?id=7bf5b70befd7817b9e42acbd2291b2042ea1bf81
-Kees
--
Kees Cook
Pixel Security
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-05-24 0:47 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 16:24 [PATCH v2] drm/nouveau/secboot: remove VLA usage Gustavo A. R. Silva
2018-03-14 11:08 ` Thierry Reding
2018-03-14 11:08 ` Thierry Reding
2018-03-16 2:05 ` Ben Skeggs
2018-03-16 2:05 ` Ben Skeggs
2018-04-26 23:25 ` Kees Cook
2018-05-23 22:48 ` Kees Cook
2018-05-24 0:36 ` Ben Skeggs
2018-05-24 0:36 ` Ben Skeggs
2018-05-24 0:47 ` Kees Cook
2018-05-24 0:47 ` Kees Cook
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.