All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/doc: Fix title underline length
@ 2022-11-28  8:19 Maxime Ripard
  2022-11-28  8:19 ` [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name Maxime Ripard
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Maxime Ripard @ 2022-11-28  8:19 UTC (permalink / raw)
  To: Daniel Vetter, David Airlie, Maarten Lankhorst, Thomas Zimmermann,
	Maxime Ripard
  Cc: kernel test robot, dri-devel

The underline length for the new Analog TV properties section doesn't
match the title length, resulting in a warning.

Fixes: 7d63cd8526f1 ("drm/connector: Add TV standard property")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 Documentation/gpu/drm-kms.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
index 321f2f582c64..c92d425cb2dd 100644
--- a/Documentation/gpu/drm-kms.rst
+++ b/Documentation/gpu/drm-kms.rst
@@ -521,7 +521,7 @@ HDMI Specific Connector Properties
    :doc: HDMI connector properties
 
 Analog TV Specific Connector Properties
-----------------------------------
+---------------------------------------
 
 .. kernel-doc:: drivers/gpu/drm/drm_connector.c
    :doc: Analog TV Connector Properties
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name
  2022-11-28  8:19 [PATCH 1/3] drm/doc: Fix title underline length Maxime Ripard
@ 2022-11-28  8:19 ` Maxime Ripard
  2022-12-01  9:51   ` Javier Martinez Canillas
  2022-12-01 16:28   ` Kees Cook
  2022-11-28  8:19 ` [PATCH 3/3] drm/tests: helpers: Add missing export Maxime Ripard
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Maxime Ripard @ 2022-11-28  8:19 UTC (permalink / raw)
  To: Daniel Vetter, David Airlie, Maarten Lankhorst, Thomas Zimmermann,
	Maxime Ripard
  Cc: coverity-bot, dri-devel

The mode name in struct drm_cmdline_mode can hold 32 characters at most,
which can easily get overrun. Switch to strscpy() to prevent such a
thing.

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527354 ("Security best practices violations")
Fixes: a7ab155397dd ("drm/modes: Switch to named mode descriptors")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/drm_modes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 699c66e54668..be030f4a5311 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -2316,7 +2316,7 @@ static int drm_mode_parse_cmdline_named_mode(const char *name,
 		if (ret != name_end)
 			continue;
 
-		strcpy(cmdline_mode->name, mode->name);
+		strscpy(cmdline_mode->name, mode->name, sizeof(cmdline_mode->name));
 		cmdline_mode->pixel_clock = mode->pixel_clock_khz;
 		cmdline_mode->xres = mode->xres;
 		cmdline_mode->yres = mode->yres;
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] drm/tests: helpers: Add missing export
  2022-11-28  8:19 [PATCH 1/3] drm/doc: Fix title underline length Maxime Ripard
  2022-11-28  8:19 ` [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name Maxime Ripard
@ 2022-11-28  8:19 ` Maxime Ripard
  2022-11-28 11:04   ` Maíra Canal
  2022-12-01  9:49 ` [PATCH 1/3] drm/doc: Fix title underline length Javier Martinez Canillas
  2022-12-01 10:18 ` Maxime Ripard
  3 siblings, 1 reply; 8+ messages in thread
From: Maxime Ripard @ 2022-11-28  8:19 UTC (permalink / raw)
  To: Daniel Vetter, David Airlie, Maarten Lankhorst, Thomas Zimmermann,
	Maxime Ripard
  Cc: kernel test robot, dri-devel

drm_kunit_device_init() is a public function meant to be used by other
tests, but isn't exported. This leads to modpost errors when the other
tests are compiled as module.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/tests/drm_kunit_helpers.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
index f1662091f250..8c738384a992 100644
--- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
+++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
@@ -66,6 +66,7 @@ struct drm_device *drm_kunit_device_init(struct kunit *test, u32 features, char
 
 	return drm;
 }
+EXPORT_SYMBOL(drm_kunit_device_init);
 
 MODULE_AUTHOR("Maxime Ripard <maxime@cerno.tech>");
 MODULE_LICENSE("GPL");
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] drm/tests: helpers: Add missing export
  2022-11-28  8:19 ` [PATCH 3/3] drm/tests: helpers: Add missing export Maxime Ripard
@ 2022-11-28 11:04   ` Maíra Canal
  0 siblings, 0 replies; 8+ messages in thread
From: Maíra Canal @ 2022-11-28 11:04 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann
  Cc: kernel test robot, dri-devel

On 11/28/22 05:19, Maxime Ripard wrote:
> drm_kunit_device_init() is a public function meant to be used by other
> tests, but isn't exported. This leads to modpost errors when the other
> tests are compiled as module.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

Reviewed-by: Maíra Canal <mairacanal@riseup.net>

Best Regards,
- Maíra Canal

> ---
>  drivers/gpu/drm/tests/drm_kunit_helpers.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
> index f1662091f250..8c738384a992 100644
> --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
> +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
> @@ -66,6 +66,7 @@ struct drm_device *drm_kunit_device_init(struct kunit *test, u32 features, char
>  
>  	return drm;
>  }
> +EXPORT_SYMBOL(drm_kunit_device_init);
>  
>  MODULE_AUTHOR("Maxime Ripard <maxime@cerno.tech>");
>  MODULE_LICENSE("GPL");

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] drm/doc: Fix title underline length
  2022-11-28  8:19 [PATCH 1/3] drm/doc: Fix title underline length Maxime Ripard
  2022-11-28  8:19 ` [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name Maxime Ripard
  2022-11-28  8:19 ` [PATCH 3/3] drm/tests: helpers: Add missing export Maxime Ripard
@ 2022-12-01  9:49 ` Javier Martinez Canillas
  2022-12-01 10:18 ` Maxime Ripard
  3 siblings, 0 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2022-12-01  9:49 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann
  Cc: kernel test robot, dri-devel

On 11/28/22 09:19, Maxime Ripard wrote:
> The underline length for the new Analog TV properties section doesn't
> match the title length, resulting in a warning.
> 
> Fixes: 7d63cd8526f1 ("drm/connector: Add TV standard property")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---

Ah, I wasn't aware that this would lead to a kernel-doc warning.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name
  2022-11-28  8:19 ` [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name Maxime Ripard
@ 2022-12-01  9:51   ` Javier Martinez Canillas
  2022-12-01 16:28   ` Kees Cook
  1 sibling, 0 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2022-12-01  9:51 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann
  Cc: dri-devel, coverity-bot

On 11/28/22 09:19, Maxime Ripard wrote:
> The mode name in struct drm_cmdline_mode can hold 32 characters at most,
> which can easily get overrun. Switch to strscpy() to prevent such a
> thing.
> 
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1527354 ("Security best practices violations")
> Fixes: a7ab155397dd ("drm/modes: Switch to named mode descriptors")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] drm/doc: Fix title underline length
  2022-11-28  8:19 [PATCH 1/3] drm/doc: Fix title underline length Maxime Ripard
                   ` (2 preceding siblings ...)
  2022-12-01  9:49 ` [PATCH 1/3] drm/doc: Fix title underline length Javier Martinez Canillas
@ 2022-12-01 10:18 ` Maxime Ripard
  3 siblings, 0 replies; 8+ messages in thread
From: Maxime Ripard @ 2022-12-01 10:18 UTC (permalink / raw)
  To: Thomas Zimmermann, David Airlie, Maarten Lankhorst, Maxime Ripard,
	Daniel Vetter
  Cc: kernel test robot, dri-devel

On Mon, 28 Nov 2022 09:19:36 +0100, Maxime Ripard wrote:
> The underline length for the new Analog TV properties section doesn't
> match the title length, resulting in a warning.
> 
> 

Applied to drm/drm-misc (drm-misc-next).

Thanks!
Maxime

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name
  2022-11-28  8:19 ` [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name Maxime Ripard
  2022-12-01  9:51   ` Javier Martinez Canillas
@ 2022-12-01 16:28   ` Kees Cook
  1 sibling, 0 replies; 8+ messages in thread
From: Kees Cook @ 2022-12-01 16:28 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: David Airlie, Daniel Vetter, dri-devel, Thomas Zimmermann

On Mon, Nov 28, 2022 at 09:19:37AM +0100, Maxime Ripard wrote:
> The mode name in struct drm_cmdline_mode can hold 32 characters at most,
> which can easily get overrun. Switch to strscpy() to prevent such a
> thing.
> 
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1527354 ("Security best practices violations")
> Fixes: a7ab155397dd ("drm/modes: Switch to named mode descriptors")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-01 16:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-28  8:19 [PATCH 1/3] drm/doc: Fix title underline length Maxime Ripard
2022-11-28  8:19 ` [PATCH 2/3] drm/modes: Use strscpy() to copy command-line mode name Maxime Ripard
2022-12-01  9:51   ` Javier Martinez Canillas
2022-12-01 16:28   ` Kees Cook
2022-11-28  8:19 ` [PATCH 3/3] drm/tests: helpers: Add missing export Maxime Ripard
2022-11-28 11:04   ` Maíra Canal
2022-12-01  9:49 ` [PATCH 1/3] drm/doc: Fix title underline length Javier Martinez Canillas
2022-12-01 10:18 ` Maxime Ripard

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.