Re: [PATCH v2] udmabuf: Fix a potential (and unlikely) access to unallocated memory

2024-02-19 Thread Gustavo A. R. Silva
at it, include . Fixes: fbb0de795078 ("Add udmabuf misc device")' I don't think this tag is needed in this case. Also, please, CC linux-hardening next time. Signed-off-by: Christophe JAILLET In any case, LGTM: Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- v2: - Use memdup_

Re: [PATCH] drm/xe: Prefer struct_size over open coded arithmetic

2024-02-10 Thread Gustavo A. R. Silva
ttps://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1] Link: https://github.com/KSPP/linux/issues/160 [2] Signed-off-by: Erick Archer LGTM: Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- drivers/gpu/drm/xe/xe_exec_queue.c | 2 +-

Re: [PATCH] drm/i915: Add flex arrays to struct i915_syncmap

2024-02-08 Thread Gustavo A. R. Silva
deprecated.html#zero-length-and-one-element-arrays [1] Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [2] Signed-off-by: Erick Archer Nice transformation! LGTM: Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/g

Re: [GIT PULL] Enable -Wstringop-overflow globally

2024-01-27 Thread Gustavo A. R. Silva
On 1/27/24 09:11, David Laight wrote: From: Linus Torvalds Sent: 26 January 2024 22:36 On Fri, 26 Jan 2024 at 14:24, Kees Cook 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':

Re: [PATCH] accel/habanalabs: use kcalloc() instead of kzalloc()

2024-01-22 Thread Gustavo A. R. Silva
ze * count in the kzalloc() function. Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1] Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Erick Archer Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- dri

Re: [Nouveau] [PATCH][next] nouveau/gsp: replace zero-length array with flex-array member and use __counted_by

2023-11-28 Thread Gustavo A. R. Silva
On 11/28/23 19:01, Danilo Krummrich wrote: On 11/16/23 20:55, Timur Tabi wrote: On Thu, 2023-11-16 at 20:45 +0100, Danilo Krummrich wrote: As I already mentioned for Timur's patch [2], I'd prefer to get a fix upstream (meaning [1] in this case). Of course, that's probably more up to Timur

[PATCH][next] nouveau/gsp: replace zero-length array with flex-array member and use __counted_by

2023-11-16 Thread Gustavo A. R. Silva
bounds of 'PACKED_REGISTRY_ENTRY[0]' [-Warray-bounds=] While there, also make use of the struct_size() helper, and address checkpatch.pl warning: WARNING: please, no spaces at the start of a line This results in no differences in binary output. Signed-off-by: Gustavo A. R. Silva --- .../nvrm

Re: [PATCH][next] dma-buf: Fix NULL pointer dereference in dma_fence_enable_sw_signaling()

2023-10-11 Thread Gustavo A. R. Silva
On 10/11/23 10:03, Kees Cook wrote: On Wed, Oct 11, 2023 at 08:03:43AM -0600, Gustavo A. R. Silva wrote: Currently, a NULL pointer dereference will happen in function `dma_fence_enable_sw_signaling()` (at line 615), in case `chain` is not allocated in `mock_chain()` and this function returns

[PATCH][next] dma-buf: Fix NULL pointer dereference in dma_fence_enable_sw_signaling()

2023-10-11 Thread Gustavo A. R. Silva
"dma-buf: Enable signaling on fence for selftests") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/dma-buf/dma-fence.c | 9 - include/linux/dma-fence.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/d

Re: [PATCH] drm/i915/guc: Annotate struct ct_incoming_msg with __counted_by

2023-10-06 Thread Gustavo A. R. Silva
(for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ct_incoming_msg. Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: "Gustavo A. R. Silva" Cc: John Harrison Cc: Matthew

Re: [PATCH 5/9] drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by

2023-09-24 Thread Gustavo A. R. Silva
Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau

Re: [PATCH 7/9] drm/virtio: Annotate struct virtio_gpu_object_array with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: virtualizat...@lists.linux-foundation.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH] video: mmp: Annotate struct mmp_path with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- include/video/mmp_disp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/video/mmp_disp.h b/include/video/mmp_disp.h index 77252cb46361..a722dcbf5073 100644 --- a/include/video/mmp_disp.h

Re: [PATCH] video: fbdev: mmp: Annotate struct mmphw_ctrl with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/video/fbdev/mmp/hw/mmp_ctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.h b/drivers/video/fbdev/mmp/hw/mmp_ctrl.h index 167585a889d3

Re: [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Xiaojian Du Cc: Huang Rui Cc: Kevin Wang Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/am

Re: [PATCH 6/9] drm/vc4: Annotate struct vc4_perfmon with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index bf66499765fb

Re: [PATCH 4/9] drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Cc: David Airlie Cc: Daniel Vetter Cc: Bjorn Andersson Cc: linux-arm-...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: freedr...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/msm/disp/dpu1

Re: [PATCH 3/9] drm/i915/selftests: Annotate struct perf_series with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Airlie Cc: Daniel Vetter Cc: Chris Wilson Cc: John Harrison Cc: Andi Shyti Cc: Matthew Brost Cc: intel-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/i915/selftests

Re: [PATCH 2/9] drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Cc: David Airlie Cc: Daniel Vetter Cc: Hawking Zhang Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH] udmabuf: Fix a potential (and unlikely) access to unallocated memory

2023-09-18 Thread Gustavo A. R. Silva
On 9/18/23 12:46, Christophe JAILLET wrote: If 'list_limit' is set to a very high value, 'lsize' computation could overflow if 'head.count' is big enough. In such a case, udmabuf_create() will access to memory beyond 'list'. Use size_mul() to saturate the value, and have memdup_user() fail.

Re: [PATCH][next] drm/gud: Use size_add() in call to struct_size()

2023-09-15 Thread Gustavo A. R. Silva
On 9/15/23 12:52, Kees Cook wrote: On Fri, Sep 15, 2023 at 12:43:20PM -0600, Gustavo A. R. Silva wrote: If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call

[PATCH][next] drm/gud: Use size_add() in call to struct_size()

2023-09-15 Thread Gustavo A. R. Silva
Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/gud/gud_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gud/gud_pipe.c b/drivers/gpu/drm/gud/gud_pipe.c index d2f199ea3c11..a02f75be81f0 100644 --- a/drivers/gpu/drm/gud/gud_pipe.c +++ b/drivers/gpu/drm/gud/

Re: [PATCH] clk: Annotate struct clk_hw_onecell_data with __counted_by

2023-08-17 Thread Gustavo A. R. Silva
...@lists.infradead.org Cc: linux-asp...@lists.ozlabs.org Cc: linux-arm-...@vger.kernel.org Cc: linux-media...@lists.infradead.org Cc: dri-devel@lists.freedesktop.org Cc: linux-su...@lists.linux.dev Cc: linux-...@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks

[PATCH 2/2][next] nouveau/svm: Split assignment from if conditional

2023-08-16 Thread Gustavo A. R. Silva
Fix checkpatch.pl ERROR: do not use assignment in if condition. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nouveau_svm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c index

[PATCH 1/2][next] nouveau/svm: Replace one-element array with flexible-array member in struct nouveau_svm

2023-08-16 Thread Gustavo A. R. Silva
One-element and zero-length arrays are deprecated. So, replace one-element array in struct nouveau_svm with flexible-array member. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/338 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau

[PATCH 0/2][next] nouveau/svm: Replace one-element array with flexible-array member

2023-08-16 Thread Gustavo A. R. Silva
This small series aims to replace a one-element array with a flexible-array member in struct nouveau_svm. And, while at it, fix a checkpatch.pl error. Gustavo A. R. Silva (2): nouveau/svm: Replace one-element array with flexible-array member in struct nouveau_svm nouveau/svm: Split

[PATCH][next] fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings

2023-06-22 Thread Gustavo A. R. Silva
| lgray = 1; | ~~^~~ drivers/video/fbdev/sh7760fb.c:144:9: note: here 144 | case LDDFR_8BPP: | ^~~~ Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/sh7760fb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/fbdev

[PATCH][next] drm/amdgpu/discovery: Replace fake flex-arrays with flexible-array members

2023-05-28 Thread Gustavo A. R. Silva
/602902.html [1] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/include/discovery.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/include/discovery.h b/drivers/gpu/drm/amd/include/discovery.h index 9181e57887db..f43e29722ef7 100644

Re: [PATCH][next] drm/i915/uapi: Replace fake flex-array with flexible-array member

2023-04-06 Thread Gustavo A. R. Silva
On 3/31/23 01:02, Jani Nikula wrote: On Thu, 30 Mar 2023, "Gustavo A. R. Silva" wrote: Friendly ping: who can take this, please?  It's in drm-intel-gt-next. Awesome. :) Thank you! -- Gustavo commit 02abecdeebfcd3848b26b70778dd7f6eb0db65e1 Author: Gustavo A. R. Silva

Re: [PATCH][next] drm/i915/uapi: Replace fake flex-array with flexible-array member

2023-03-30 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please?  Thanks -- Gustavo On 3/17/23 12:18, Gustavo A. R. Silva wrote: Zero-length arrays as fake flexible arrays are deprecated and we are moving towards adopting C99 flexible-array members instead. Address the following warning found with GCC-13

Re: [PATCH] drm/nouveau/disp: More DP_RECEIVER_CAP_SIZE array fixes

2023-03-22 Thread Gustavo A. R. Silva
], | ~~~^~ Fixes: 813443721331 ("drm/nouveau/disp: move DP link config into acquire") Cc: Ben Skeggs Cc: Lyude Paul Cc: Karol Herbst Cc: David Airlie Cc: Daniel Vetter Cc: Dave Airlie Cc: "Gustavo A

[PATCH][next] drm/i915/uapi: Replace fake flex-array with flexible-array member

2023-03-17 Thread Gustavo A. R. Silva
lex-arrays=3 [1]. Link: https://github.com/KSPP/linux/issues/21 Link: https://github.com/KSPP/linux/issues/271 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva --- include/uapi/drm/i915_drm.h | 2 +- 1 file changed, 1 insertion(+)

[PATCH][next] drm/vmwgfx: Replace one-element array with flexible-array member

2023-02-02 Thread Gustavo A. R. Silva
globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/254 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva

Re: [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members

2023-01-10 Thread Gustavo A. R. Silva
On Tue, Jan 10, 2023 at 02:28:11PM -0500, Rodrigo Vivi wrote: > > On Tue, Jan 10, 2023 at 10:44:53AM -0600, Gustavo A. R. Silva wrote: > > Zero-length arrays are deprecated[1] and we are moving towards > > adopting C99 flexible-array members, instead. So, replace zero

[PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members

2023-01-10 Thread Gustavo A. R. Silva
/linux/issues/78 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h b/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h index 3624abfd22d1

[PATCH][next] habanalabs: Replace zero-length arrays with flexible-array members

2023-01-09 Thread Gustavo A. R. Silva
-off-by: Gustavo A. R. Silva --- drivers/accel/habanalabs/include/gaudi2/gaudi2_packets.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/accel/habanalabs/include/gaudi2/gaudi2_packets.h b/drivers/accel/habanalabs/include/gaudi2/gaudi2_packets.h index 8bf90fc18bf5

[PATCH][next] drm/nouveau/nvkm: Replace zero-length array with flexible-array member

2023-01-09 Thread Gustavo A. R. Silva
/issues/78 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/include/nvfw/hs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/include/nvfw/hs.h b/drivers/gpu/drm/nouveau/include/nvfw/hs.h index 8c4cd08a7b5f..8b58b668fc0c 100644

Re: [PATCH] fbdev: Replace 0-length array with flexible array

2023-01-06 Thread Gustavo A. R. Silva
/process/deprecated.html#zero-length-and-one-element-arrays > > Cc: Helge Deller > Cc: "Gustavo A. R. Silva" > Cc: linux-fb...@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo >

Re: [RESEND][PATCH] drm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array

2023-01-03 Thread Gustavo A. R. Silva
ude Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc: Gourav Samaiya > Cc: "Gustavo A. R. Silva" > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Kees Cook Here is my RB again: Reviewed-by: Gustavo A. R. Silva T

Re: [PATCH] drm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array

2022-11-18 Thread Gustavo A. R. Silva
ude Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc: Gourav Samaiya > Cc: "Gustavo A. R. Silva" > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo >

Re: [RFC] Approaches to deal with a struct with multiple fake flexible arrays members

2022-11-10 Thread Gustavo A. R. Silva
On Wed, Nov 09, 2022 at 10:20:34PM -0500, Alex Deucher wrote: > On Wed, Nov 9, 2022 at 8:31 PM Paulo Miguel Almeida > wrote: > > > > On Wed, Nov 09, 2022 at 06:45:57PM -0600, Gustavo A. R. Silva wrote: > > > On Wed, Nov 09, 2022 at 04:45:42PM +1300, Paulo Miguel Almeid

Re: [RFC] Approaches to deal with a struct with multiple fake flexible arrays members

2022-11-09 Thread Gustavo A. R. Silva
On Wed, Nov 09, 2022 at 04:45:42PM +1300, Paulo Miguel Almeida wrote: Adding Alex, Christian and DRM lists to the thread. > Hi KSPP community, > > I've been working on replacing 1-element arrays with flex array members > on the drm/amdgpu files. I came across one insteresting case which I > may

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-28 Thread Gustavo A. R. Silva
On Mon, Jun 27, 2022 at 12:53:43PM -0700, Stephen Hemminger wrote: > Thanks this fixes warning with gcc-12 in iproute2. > In function ‘xfrm_algo_parse’, > inlined from ‘xfrm_state_modify.constprop’ at xfrm_state.c:573:5: > xfrm_state.c:162:32: warning: writing 1 byte into a region of size 0 >

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-28 Thread Gustavo A. R. Silva
On Tue, Jun 28, 2022 at 10:36:51AM -0300, Jason Gunthorpe wrote: > On Tue, Jun 28, 2022 at 04:21:29AM +0200, Gustavo A. R. Silva wrote: > > > > > Though maybe we could just switch off > > > > -Wgnu-variable-sized-type-not-at-end during configuration ? > &g

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-27 Thread Gustavo A. R. Silva
On Tue, Jun 28, 2022 at 02:58:25AM +0200, Gustavo A. R. Silva wrote: > On Mon, Jun 27, 2022 at 09:40:52PM -0300, Jason Gunthorpe wrote: > > On Mon, Jun 27, 2022 at 08:27:37PM +0200, Daniel Borkmann wrote: > > > On 6/27/22 8:04 PM, Gustavo A. R. Silva wrote: > > >

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-27 Thread Gustavo A. R. Silva
On Mon, Jun 27, 2022 at 09:40:52PM -0300, Jason Gunthorpe wrote: > On Mon, Jun 27, 2022 at 08:27:37PM +0200, Daniel Borkmann wrote: > > On 6/27/22 8:04 PM, Gustavo A. R. Silva wrote: > > > There is a regular need in the kernel to provide a way to declare > > > hav

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-27 Thread Gustavo A. R. Silva
On Mon, Jun 27, 2022 at 08:27:37PM +0200, Daniel Borkmann wrote: > On 6/27/22 8:04 PM, Gustavo A. R. Silva wrote: > > There is a regular need in the kernel to provide a way to declare > > having a dynamically sized set of trailing elements in a structure. > > Kernel c

[PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-27 Thread Gustavo A. R. Silva
ecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/78 Build-tested-by: https://lore.kernel.org/lkml/62b675ec.wkx6aoz6cbe71vtf%25...@intel.com/ Signed-off-by: Gustavo A. R. Silva --- Hi all! JFYI: I'm adding this to my -next tree. :) arch/m68k/include/uap

[PATCH][next] drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()

2022-04-27 Thread Gustavo A. R. Silva
cks for that. This helps with the ongoing efforts to globally enable -Wstringop-overflow. Link: https://github.com/KSPP/linux/issues/181 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/intel_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i

Re: [PATCH][next] drm/amd/display: Fix Wstringop-overflow warnings in dc_link_dp.c

2022-03-03 Thread Gustavo A. R. Silva
On Thu, Mar 03, 2022 at 12:19:57PM -0600, Gustavo A. R. Silva wrote: > On Thu, Mar 03, 2022 at 09:43:28AM -0800, Kees Cook wrote: > > On Thu, Mar 03, 2022 at 11:25:03AM -0600, Gustavo A. R. Silva wrote: > > > Fix the following Wstringop-overflow warnings when bu

Re: [PATCH][next] drm/amd/display: Fix Wstringop-overflow warnings in dc_link_dp.c

2022-03-03 Thread Gustavo A. R. Silva
On Thu, Mar 03, 2022 at 09:43:28AM -0800, Kees Cook wrote: > On Thu, Mar 03, 2022 at 11:25:03AM -0600, Gustavo A. R. Silva wrote: > > Fix the following Wstringop-overflow warnings when building with GCC-11: > > > > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dpia.c

[PATCH][next] drm/amd/display: Fix Wstringop-overflow warnings in dc_link_dp.c

2022-03-03 Thread Gustavo A. R. Silva
-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++-- drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc

Re: [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-16 Thread Gustavo A. R. Silva
On Wed, Feb 16, 2022 at 08:05:47PM +0100, Rafael J. Wysocki wrote: > On Tue, Feb 15, 2022 at 8:24 PM Gustavo A. R. Silva > wrote: > > Can you also send the ACPI patch separately, please? > > We would like to route it through the upstream ACPICA code base. Yeah; no problem. Thanks -- Gustavo

Re: [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-15 Thread Gustavo A. R. Silva
On Tue, Feb 15, 2022 at 09:19:29PM +0200, Leon Romanovsky wrote: > On Tue, Feb 15, 2022 at 01:21:10PM -0600, Gustavo A. R. Silva wrote: > > On Tue, Feb 15, 2022 at 10:17:40AM -0800, Kees Cook wrote: > > > On Tue, Feb 15, 2022 at 11:47:43AM -0600, Gustavo A. R. Silva wrote: >

Re: [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-15 Thread Gustavo A. R. Silva
On Tue, Feb 15, 2022 at 10:17:40AM -0800, Kees Cook wrote: > On Tue, Feb 15, 2022 at 11:47:43AM -0600, Gustavo A. R. Silva wrote: > > There is a regular need in the kernel to provide a way to declare > > having a dynamically sized set of trailing elements in a structure. > &g

[PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-15 Thread Gustavo A. R. Silva
off-by: Gustavo A. R. Silva --- Hi all, I'm expecting to carry this patch in my tree, so it'd be great to get some Acks. And given the size of the patch, I'm only sending this to mailing lists. Thanks! arch/alpha/include/asm/hwrpb.h| 2 +- arch/ia64/include/asm/sa

[PATCH][next] nouveau/svm: Use struct_size() helper in nouveau_pfns_map()

2022-02-07 Thread Gustavo A. R. Silva
Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worse scenario, could lead to heap overflows. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu

[PATCH][next] drm/i915/guc: Use struct_size() helper in kmalloc()

2022-01-25 Thread Gustavo A. R. Silva
: warning: using sizeof on a flexible structure Link: https://github.com/KSPP/linux/issues/174 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu

Re: [PATCH] drm/dp: Remove common Post Cursor2 register handling

2022-01-18 Thread Gustavo A. R. Silva
tagged for -stable: Cc: sta...@vger.kernel.org > Cc: Maarten Lankhorst > Cc: Maxime Ripard > Cc: Thomas Zimmermann > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustav

Re: [PATCH] drm/dp: Fix off-by-one in register cache size

2021-12-13 Thread Gustavo A. R. Silva
Cc: Thomas Zimmermann > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo > --- > include/drm/drm_dp_helper.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

Re: [PATCH] fbdev: sh7760fb: document fallthrough cases

2021-11-15 Thread Gustavo A. R. Silva
On Mon, Nov 15, 2021 at 09:35:09AM +0100, Geert Uytterhoeven wrote: > On Mon, Nov 15, 2021 at 7:33 AM Randy Dunlap wrote: > > Fix fallthrough warnings in sh776fb.c: > > > > ../drivers/video/fbdev/sh7760fb.c: In function 'sh7760fb_get_color_info': > > ../drivers/video/fbdev/sh7760fb.c:138:23:

Re: [PATCH] fbdev: sh7760fb: document fallthrough cases

2021-11-14 Thread Gustavo A. R. Silva
4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver") > Signed-off-by: Randy Dunlap > Cc: "Gustavo A. R. Silva" > Cc: Nobuhiro Iwamatsu > Cc: Manuel Lauss > Cc: Yoshinori Sato > Cc: Rich Felker > Cc: linux...@vger.kernel.org &

Re: [PATCH][next] nouveau/svm: Use kvcalloc() instead of kvzalloc()

2021-10-28 Thread Gustavo A. R. Silva
that kvcalloc checks whether the multiplication overflows and > > returns NULL in this case? > > That's correct. :) > > > On Wed, Sep 29, 2021 at 12:21 AM Gustavo A. R. Silva > > wrote: > > > > > > Use 2-factor argument form kvcalloc() instead of kvza

Re: [PATCH] video: omapfb: Fix fall-through warning for Clang

2021-10-14 Thread Gustavo A. R. Silva
On Thu, Oct 14, 2021 at 08:26:52PM +0200, Sam Ravnborg wrote: > Hi Gustavo, > On Thu, Oct 14, 2021 at 11:53:20AM -0500, Gustavo A. R. Silva wrote: > > Fix the following fallthrough warnings: > > > > drivers/video/fbdev/omap/omapfb_main.c:1558:2: warning: unannotated

[PATCH] video: omapfb: Fix fall-through warning for Clang

2021-10-14 Thread Gustavo A. R. Silva
-by: kernel test robot Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/omap/omapfb_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 3d090d2d9ed9..b495c09e6102 100644 --- a/drivers/video/fbdev/omap

[PATCH][next] nouveau/svm: Use kvcalloc() instead of kvzalloc()

2021-09-28 Thread Gustavo A. R. Silva
Use 2-factor argument form kvcalloc() instead of kvzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b

Re: [PATCH 19/64] ip: Use struct_group() for memcpy() regions

2021-07-28 Thread Gustavo A. R. Silva
On 7/28/21 01:31, Gustavo A. R. Silva wrote: > > > On 7/28/21 01:19, Greg Kroah-Hartman wrote: >> On Wed, Jul 28, 2021 at 01:14:33AM -0500, Gustavo A. R. Silva wrote: >>> >>> >>> On 7/28/21 00:55, Greg Kroah-Hartman wrote: >>>> On

Re: [PATCH 19/64] ip: Use struct_group() for memcpy() regions

2021-07-28 Thread Gustavo A. R. Silva
On 7/28/21 01:19, Greg Kroah-Hartman wrote: > On Wed, Jul 28, 2021 at 01:14:33AM -0500, Gustavo A. R. Silva wrote: >> >> >> On 7/28/21 00:55, Greg Kroah-Hartman wrote: >>> On Tue, Jul 27, 2021 at 01:58:10PM -0700, Kees Cook wrote: >>>> In preparation

Re: [PATCH 19/64] ip: Use struct_group() for memcpy() regions

2021-07-28 Thread Gustavo A. R. Silva
On 7/28/21 00:55, Greg Kroah-Hartman wrote: > On Tue, Jul 27, 2021 at 01:58:10PM -0700, Kees Cook wrote: >> In preparation for FORTIFY_SOURCE performing compile-time and run-time >> field bounds checking for memcpy(), memmove(), and memset(), avoid >> intentionally writing across neighboring

Re: [PATCH 06/64] bnxt_en: Use struct_group_attr() for memcpy() region

2021-07-27 Thread Gustavo A. R. Silva
le" shows no size nor member offset changes to struct bnxt_cos2bw_cfg. > "objdump -d" shows no meaningful object code changes (i.e. only source > line number induced differences and optimizations). > > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- G

Re: [PATCH 05/64] skbuff: Switch structure bounds to struct_group()

2021-07-27 Thread Gustavo A. R. Silva
> "objdump -d" shows no no meaningful object code changes (i.e. only source > line number induced differences and optimizations.) > > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo > --- > drivers/net/wireguard/queuein

Re: [PATCH 04/64] stddef: Introduce struct_group() helper macro

2021-07-27 Thread Gustavo A. R. Silva
int three, > ); > int four; > }; > > if (length > sizeof(src.thing)) > return -EINVAL; > memcpy(, , length); > do_something(dst.three); > > There are some rare cases where the resulting struc

Re: [PATCH 03/64] rpmsg: glink: Replace strncpy() with strscpy_pad()

2021-07-27 Thread Gustavo A. R. Silva
cess/deprecated.html#strncpy-on-nul-terminated-strings > > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo > --- > drivers/rpmsg/qcom_glink_native.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/rpmsg/qcom_g

Re: [PATCH 01/64] media: omap3isp: Extract struct group for memcpy() region

2021-07-27 Thread Gustavo A. R. Silva
On Tue, Jul 27, 2021 at 01:57:52PM -0700, Kees Cook wrote: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field bounds checking for memcpy(), memmove(), and memset(), avoid > intentionally writing across neighboring fields. Wrap the target region > in a common named

[PATCH][next] drm/amd/display: Fix fall-through warning for Clang

2021-06-16 Thread Gustavo A. R. Silva
need to be replaced with fallthrough; in the whole codebase. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- JFYI: We had thousands of these sorts of warnings and now we are down to just 15 in linux-next. This is one of those last remaining warnings

[PATCH][next] drm/i915/gem: Fix fall-through warning for Clang

2021-06-07 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough; statement. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- JFYI: We had thousands of these sorts of warnings and now we are down to just 13

[PATCH][next] drm/amd/pm: Fix fall-through warning for Clang

2021-06-03 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- JFYI: We had thousands of these sorts

Re: [PATCH RESEND][next] drm/nouveau/clk: Fix fall-through warnings for Clang

2021-06-03 Thread Gustavo A. R. Silva
Hi all, If you don't mind, I'm taking this in my -next[1] branch for v5.14. Thanks -- Gustavo [1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp On 6/1/21 17:57, Gustavo A. R. Silva wrote: > Hi, > > Friendly second ping: who can take thi

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau: Fix fall-through warnings for Clang

2021-06-03 Thread Gustavo A. R. Silva
ers? No other person has replied after pinging multiple times and resending these patches, so I guess people don't care. I'll add this and the other similar patches to my -next branch for 5.14. Thanks, Karol. -- Gustavo > > On Wed, Jun 2, 2021 at 1:16 AM Gustavo A. R. Silva > wrote: &

Re: [PATCH RESEND][next] drm/nouveau/therm: Fix fall-through warnings for Clang

2021-06-03 Thread Gustavo A. R. Silva
Hi all, If you don't mind, I'm taking this in my -next[1] branch for v5.14. Thanks -- Gustavo [1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp On 6/1/21 17:58, Gustavo A. R. Silva wrote: > Hi, > > Friendly second ping: who can take thi

Re: [PATCH RESEND][next] drm/nouveau: Fix fall-through warnings for Clang

2021-06-01 Thread Gustavo A. R. Silva
A. R. Silva wrote: > Hi all, > > Friendly ping: who can take this, please? > > Thanks > -- > Gustavo > > On 3/5/21 03:56, Gustavo A. R. Silva wrote: >> In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple >> of warnings by explicitly addi

Re: [PATCH RESEND][next] drm/nouveau/clk: Fix fall-through warnings for Clang

2021-06-01 Thread Gustavo A. R. Silva
A. R. Silva wrote: > Hi all, > > Friendly ping: who can take this, please? > > Thanks > -- > Gustavo > > On 3/5/21 03:56, Gustavo A. R. Silva wrote: >> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning >> by explicitly adding a brea

Re: [PATCH RESEND][next] drm/nouveau/therm: Fix fall-through warnings for Clang

2021-06-01 Thread Gustavo A. R. Silva
A. R. Silva wrote: > Hi all, > > Friendly ping: who can take this, please? > > Thanks > -- > Gustavo > > On 3/5/21 03:58, Gustavo A. R. Silva wrote: >> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning >> by explicitly adding a brea

Re: [PATCH] drm/radeon/ni_dpm: Fix booting bug

2021-05-10 Thread Gustavo A. R. Silva
Hi Alex, On 5/10/21 16:17, Alex Deucher wrote: > On Sun, May 9, 2021 at 6:48 PM Gustavo A. R. Silva > wrote: [..] >> >> Bug: >> https://lore.kernel.org/dri-devel/3eedbe78-1fbd-4763-a7f3-ac5665e76...@xenosoft.de/ >> Fixes: 434fb1e7444a ("drm/radeon/nislan

[PATCH] drm/amd/pm: Fix out-of-bounds bug

2021-05-10 Thread Gustavo A. R. Silva
;drm/amd/pm: Replace one-element array with flexible-array in struct SISLANDS_SMC_SWSTATE") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/pm/powerplay/si_dpm.c | 174 +- .../gpu/drm/amd/pm/powerplay/sislands_smc.h | 34 ++-- 2

Re: Radeon NI: GIT kernel with the nislands_smc commit doesn't boot on a Freescale P5040 board and P.A.Semi Nemo board

2021-05-09 Thread Gustavo A. R. Silva
nk you! -- Gustavo > > Have a nice day, > Christian > > > On 07 May 2021 at 08:43am, Christian Zigotzky wrote: >> Hi Gustavo, >> >> Great! I will test it. Many thanks for your help. >> >> Cheers, >> Christian >> >> >>> On 7. Ma

[PATCH] drm/radeon/si_dpm: Fix SMU power state load

2021-05-09 Thread Gustavo A. R. Silva
eplace one-element array with flexible-array in struct SISLANDS_SMC_SWSTATE") Cc: sta...@vger.kernel.org Reported-by: Kai-Heng Feng Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/radeon/si_dpm.c | 174 +- drivers/gpu/drm/radeon/sislands_smc.h | 3

[PATCH] drm/radeon/ni_dpm: Fix booting bug

2021-05-09 Thread Gustavo A. R. Silva
sta...@vger.kernel.org Reported-by: Christian Zigotzky Tested-by: Christian Zigotzky Link: https://lore.kernel.org/dri-devel/9bb5fcbd-daf5-1669-b3e7-b8624b3c3...@xenosoft.de/ Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/radeon/ni_dpm.c | 144 +- drivers/gpu

Re: Radeon NI: GIT kernel with the nislands_smc commit doesn't boot on a Freescale P5040 board and P.A.Semi Nemo board

2021-05-06 Thread Gustavo A. R. Silva
Hi Christian, On 4/30/21 06:59, Christian Zigotzky wrote: > Hello, > > The Nemo board (A-EON AmigaOne X1000) [1] and the FSL P5040 Cyrus+ board > (A-EON AmigaOne X5000) [2] with installed AMD Radeon HD6970 NI graphics cards > (Cayman > XT) [3] don't boot with the latest git kernel anymore

Re: Radeon NI: GIT kernel with the nislands_smc commit doesn't boot on a Freescale P5040 board and P.A.Semi Nemo board

2021-04-30 Thread Gustavo A. R. Silva
On 4/30/21 10:26, Deucher, Alexander wrote: > [AMD Public Use] > > + Gustavo, amd-gfx > >> -Original Message- >> From: Christian Zigotzky >> Sent: Friday, April 30, 2021 8:00 AM >> To: gustavo...@kernel.org; Deucher, Alexander >> >> Cc: R.T.Dickinson ; Darren Stevens > zone.net>;

Re: [PATCH RESEND][next] drm/nouveau: Fix fall-through warnings for Clang

2021-04-20 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? Thanks -- Gustavo On 3/5/21 03:56, Gustavo A. R. Silva wrote: > In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple > of warnings by explicitly adding a couple of break statements instead > of letting the code fal

Re: [PATCH RESEND][next] drm/nouveau/therm: Fix fall-through warnings for Clang

2021-04-20 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? Thanks -- Gustavo On 3/5/21 03:58, Gustavo A. R. Silva wrote: > In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning > by explicitly adding a break statement instead of letting the code fall > through to the

Re: [PATCH RESEND][next] drm/nouveau/clk: Fix fall-through warnings for Clang

2021-04-20 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? Thanks -- Gustavo On 3/5/21 03:56, Gustavo A. R. Silva wrote: > In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning > by explicitly adding a break statement instead of letting the code fall > through to the

Re: [PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init()

2021-03-22 Thread Gustavo A. R. Silva
On 3/22/21 09:04, Chen, Guchun wrote: > [AMD Public Use] > > Thanks for your patch, Silva. The issue has been fixed by " a5c6007e20e1 > drm/amd/display: fix modprobe failure on vega series". Great. :) Good to know this is already fixed. Thanks! -- Gustavo

[PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init()

2021-03-22 Thread Gustavo A. R. Silva
arge variables from the stack") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.

Re: [PATCH] drivers/video/fbdev:modify 0 to NULL

2021-03-17 Thread Gustavo A. R. Silva
On 3/17/21 21:47, Chunyou Tang wrote: > I think "if (info == NULL)" is more intuitive,and there have many > compare likes "if (info == NULL)" in this file. In that case, all those instances should be changed to if (!foo), instead. -- Gustavo ___

Re: [PATCH] drivers/video/fbdev:modify 0 to NULL

2021-03-17 Thread Gustavo A. R. Silva
On 3/17/21 21:33, ChunyouTang wrote: > From: tangchunyou > > modify 0 to NULL,info is a pointer,it should be > > compared with NULL,not 0 > > Signed-off-by: tangchunyou > --- > drivers/video/fbdev/offb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH][next] drm/radeon/si_dpm: Replace one-element array with flexible-array in struct SISLANDS_SMC_SWSTATE

2021-03-05 Thread Gustavo A. R. Silva
On Fri, Mar 05, 2021 at 02:10:44PM -0500, Alex Deucher wrote: > Applied. Thanks! Awesome. :) Thanks, Alex. -- Gustavo ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH RESEND][next] drm/nouveau/therm: Fix fall-through warnings for Clang

2021-03-05 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev

[PATCH RESEND][next] drm/nouveau: Fix fall-through warnings for Clang

2021-03-05 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of break statements instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

  1   2   3   4   5   >