[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiaaCatzmF6GXxP97pa8oEX7e4rBpd4JgsbKex3Ek1_9A@mail.gmail.com>
Date: Fri, 26 Jan 2024 14:36:13 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Kees Cook <keescook@...omium.org>
Cc: "Gustavo A. R. Silva" <gustavo@...eddedor.com>, "Gustavo A. R. Silva" <gustavoars@...nel.org>,
linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [GIT PULL] Enable -Wstringop-overflow globally
On Fri, 26 Jan 2024 at 14:24, Kees Cook <keescook@...omium.org> wrote:
>
> I think xe has some other weird problems too. This may be related (under
> allocating):
>
> ../drivers/gpu/drm/xe/xe_vm.c: In function 'xe_vma_create':
> ../drivers/gpu/drm/xe/xe_vm.c:806:21: warning: allocation of insufficient size '224' for type 'struct xe_vma' with size '368' [-Walloc-size]
> 806 | vma = kzalloc(sizeof(*vma) - sizeof(struct xe_userptr),
> | ^
That code is indeed odd, but there's a comment in the xe_vma definition
/**
* @userptr: user pointer state, only allocated for VMAs that are
* user pointers
*/
struct xe_userptr userptr;
although I agree that it should probably simply be made a final
variably-sized array instead (and then you make that array size be
0/1).
Linus
Powered by blists - more mailing lists