Re: [PATCH] drm/amd/pm: Replace all non-returning strlcpy with strscpy

2023-05-22 Thread Kees Cook
gned-off-by: Azeem Shaikh Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH] drm/radeon: Replace all non-returning strlcpy with strscpy

2023-05-22 Thread Kees Cook
gned-off-by: Azeem Shaikh Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH] drm/amd/pm: Replace all non-returning strlcpy with strscpy

2023-05-22 Thread Kees Cook
ffort to remove strlcpy() completely [2], replace > strlcpy() here with strscpy(). > No return values were used, so direct replacement is safe. > > [...] Applied to for-next/hardening, thanks! [1/1] drm/amd/pm: Replace all non-returning strlcpy with strscpy https://git.kernel.org/ke

Re: [PATCH] drm/radeon: Replace all non-returning strlcpy with strscpy

2023-05-22 Thread Kees Cook
ffort to remove strlcpy() completely [2], replace > strlcpy() here with strscpy(). > No return values were used, so direct replacement is safe. > > [...] Applied to for-next/hardening, thanks! [1/1] drm/radeon: Replace all non-returning strlcpy with strscpy https://git.kernel.org/ke

Re: [PATCH v2] drm/amd/display: enable more strict compile checks

2023-05-25 Thread Kees Cook
o > > > > > Signed-off-by: Hamza Mahfooz > > > > > --- > > > > > v2: fix grammatical error > > > > > --- > > > > > drivers/gpu/drm/amd/display/Makefile | 2 ++ > > > > > 1 file changed, 2 insertions(+) > > > > > > > > > > diff --git a/drivers/gpu/drm/amd/display/Makefile > > > > b/drivers/gpu/drm/amd/display/Makefile > > > > > index 0d610cb376bb..3c44162ebe21 100644 > > > > > --- a/drivers/gpu/drm/amd/display/Makefile > > > > > +++ b/drivers/gpu/drm/amd/display/Makefile > > > > > @@ -26,6 +26,8 @@ > > > > > > > > > > AMDDALPATH = $(RELATIVE_AMD_DISPLAY_PATH) > > > > > > > > > > +subdir-ccflags-y += -Werror -Wunused -Wmisleading-indentation > > > > > + > > > > > > > > Care to enable this for the rest of amdgpu as well? Or send out an > > > > additional patch to do that? Either way: > > > > Reviewed-by: Alex Deucher > > > > > > > > Alex > > > > > > > > > subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/inc/ > > > > > subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/inc/hw > > > > > subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/clk_mgr > > > > > -- > > > > > 2.40.1 > > > > > > > > > > -- > Hamza > -- Kees Cook

Re: [PATCH v2] drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()'

2024-02-13 Thread Kees Cook
l; > struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu; > + uint32_t otg_inst; > + > + if (!abm && !tg && !panel_cntl) > + return; > + > + otg_inst = tg->inst; Is the "if" supposed to be using "||"s instead of "&&"s? I noticed Coverity complained "tg may be NULL" for the "tg->inst" dereference... -Kees -- Kees Cook

Re: [PATCH 0/3] Update LLVM Phabricator and Bugzilla links

2024-01-11 Thread Kees Cook
Nathan Chancellor > Excellent! Thanks for doing this. I spot checked a handful I was familiar with and everything looks good to me. Reviewed-by: Kees Cook -- Kees Cook

Re: 6.5.5: UBSAN: radeon_atombios.c: index 1 is out of range for type 'UCHAR [1]'

2024-04-08 Thread Kees Cook
s, >> Justin > >+Kees since I've worked with him on several of these flexible array issues. > >I just happened to look at kernel logs today for my ath1*k driver maintenance >and see the subject issue is present on my device, running 6.9.0-rc1. The >freedesktop issue tracker says the issue is closed, but any fix has not landed >in the upstream kernel. Is there a -next patch somewhere? > >[ 12.105270] UBSAN: array-index-out-of-bounds in >drivers/gpu/drm/radeon/radeon_atombios.c:2718:34 >[ 12.105272] index 48 is out of range for type 'UCHAR [1]' >[ > >If there isn't really an upstream fix, I can probably supply one. I would expect this to have fixed it: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/gpu/drm/radeon/pptable.h?id=c63079c61177ba1b17fa05c6875699a36924fe39 If not, there must be something else happening? -Kees -- Kees Cook

Re: [PATCH] drm/radeon: silence UBSAN warning (v2)

2024-04-10 Thread Kees Cook
typedef struct _NonClockInfoArray{ > @@ -460,7 +460,7 @@ typedef struct _NonClockInfoArray{ > //sizeof(ATOM_PPLIB_NONCLOCK_INFO) > UCHAR ucEntrySize; > > -ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1]; > +ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[]; > }NonClockInfoArray; > > typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record -Kees -- Kees Cook

Re: [PATCH] drm/radeon: make -fstrict-flex-arrays=3 happy

2024-04-16 Thread Kees Cook
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3323 > Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") > Signed-off-by: Alex Deucher > Cc: Kees Cook Yup, this looks correct to me. These were trailing arrays that were not bounds checked prio

Re: [PATCH] drm/radeon: silence UBSAN warning (v3)

2024-04-16 Thread Kees Cook
M! :) Reviewed-by: Kees Cook -- Kees Cook

<    1   2