linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Avoid card name truncation
@ 2021-08-03 19:46 Kees Cook
  2021-08-03 19:46 ` [PATCH 1/3] media: radio-wl1273: " Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kees Cook @ 2021-08-03 19:46 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Kees Cook, Mauro Carvalho Chehab, linux-media, linux-kernel,
	linux-hardening

Hi,

While fixing some missing compile-time overflow warnings, I found a few
media devices that had their card description silently truncated. Fix
them using Hans's suggested text.

-Kees

Kees Cook (3):
  media: radio-wl1273: Avoid card name truncation
  media: si470x: Avoid card name truncation
  media: tm6000: Avoid card name truncation

 drivers/media/radio/radio-wl1273.c            | 2 +-
 drivers/media/radio/si470x/radio-si470x-i2c.c | 2 +-
 drivers/media/radio/si470x/radio-si470x-usb.c | 2 +-
 drivers/media/usb/tm6000/tm6000-video.c       | 3 +--
 4 files changed, 4 insertions(+), 5 deletions(-)

-- 
2.30.2


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

* [PATCH 1/3] media: radio-wl1273: Avoid card name truncation
  2021-08-03 19:46 [PATCH 0/3] Avoid card name truncation Kees Cook
@ 2021-08-03 19:46 ` Kees Cook
  2021-08-03 19:46 ` [PATCH 2/3] media: si470x: " Kees Cook
  2021-08-03 19:46 ` [PATCH 3/3] media: tm6000: " Kees Cook
  2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2021-08-03 19:46 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Kees Cook, Mauro Carvalho Chehab, linux-media, linux-kernel,
	linux-hardening

The "card" string only holds 31 characters (and the terminating NUL).
In order to avoid truncation, use a shorter card description instead of
the current result, "Texas Instruments Wl1273 FM Rad".

Suggested-by: Hans Verkuil <hverkuil@xs4all.nl>
Fixes: 87d1a50ce451 ("[media] V4L2: WL1273 FM Radio: TI WL1273 FM radio driver")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/media/radio/radio-wl1273.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 112376873167..484046471c03 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1279,7 +1279,7 @@ static int wl1273_fm_vidioc_querycap(struct file *file, void *priv,
 
 	strscpy(capability->driver, WL1273_FM_DRIVER_NAME,
 		sizeof(capability->driver));
-	strscpy(capability->card, "Texas Instruments Wl1273 FM Radio",
+	strscpy(capability->card, "TI Wl1273 FM Radio",
 		sizeof(capability->card));
 	strscpy(capability->bus_info, radio->bus_type,
 		sizeof(capability->bus_info));
-- 
2.30.2


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

* [PATCH 2/3] media: si470x: Avoid card name truncation
  2021-08-03 19:46 [PATCH 0/3] Avoid card name truncation Kees Cook
  2021-08-03 19:46 ` [PATCH 1/3] media: radio-wl1273: " Kees Cook
@ 2021-08-03 19:46 ` Kees Cook
  2021-08-03 19:46 ` [PATCH 3/3] media: tm6000: " Kees Cook
  2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2021-08-03 19:46 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Kees Cook, Mauro Carvalho Chehab, linux-media, linux-kernel,
	linux-hardening

The "card" string only holds 31 characters (and the terminating NUL).
In order to avoid truncation, use a shorter card description instead of
the current result, "Silicon Labs Si470x FM Radio Re".

Suggested-by: Hans Verkuil <hverkuil@xs4all.nl>
Fixes: 78656acdcf48 ("V4L/DVB (7038): USB radio driver for Silicon Labs Si470x FM Radio Receivers")
Fixes: cc35bbddfe10 ("V4L/DVB (12416): radio-si470x: add i2c driver for si470x")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/media/radio/si470x/radio-si470x-i2c.c | 2 +-
 drivers/media/radio/si470x/radio-si470x-usb.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c
index f491420d7b53..a972c0705ac7 100644
--- a/drivers/media/radio/si470x/radio-si470x-i2c.c
+++ b/drivers/media/radio/si470x/radio-si470x-i2c.c
@@ -11,7 +11,7 @@
 
 /* driver definitions */
 #define DRIVER_AUTHOR "Joonyoung Shim <jy0922.shim@samsung.com>";
-#define DRIVER_CARD "Silicon Labs Si470x FM Radio Receiver"
+#define DRIVER_CARD "Silicon Labs Si470x FM Radio"
 #define DRIVER_DESC "I2C radio driver for Si470x FM Radio Receivers"
 #define DRIVER_VERSION "1.0.2"
 
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c
index fedff68d8c49..3f8634a46573 100644
--- a/drivers/media/radio/si470x/radio-si470x-usb.c
+++ b/drivers/media/radio/si470x/radio-si470x-usb.c
@@ -16,7 +16,7 @@
 
 /* driver definitions */
 #define DRIVER_AUTHOR "Tobias Lorenz <tobias.lorenz@gmx.net>"
-#define DRIVER_CARD "Silicon Labs Si470x FM Radio Receiver"
+#define DRIVER_CARD "Silicon Labs Si470x FM Radio"
 #define DRIVER_DESC "USB radio driver for Si470x FM Radio Receivers"
 #define DRIVER_VERSION "1.0.10"
 
-- 
2.30.2


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

* [PATCH 3/3] media: tm6000: Avoid card name truncation
  2021-08-03 19:46 [PATCH 0/3] Avoid card name truncation Kees Cook
  2021-08-03 19:46 ` [PATCH 1/3] media: radio-wl1273: " Kees Cook
  2021-08-03 19:46 ` [PATCH 2/3] media: si470x: " Kees Cook
@ 2021-08-03 19:46 ` Kees Cook
  2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2021-08-03 19:46 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Kees Cook, Mauro Carvalho Chehab, linux-media, linux-kernel,
	linux-hardening

The "card" string only holds 31 characters (and the terminating NUL).
In order to avoid truncation, use a shorter card description instead of
the current result, "Trident TVMaster TM5600/6000/60".

Suggested-by: Hans Verkuil <hverkuil@xs4all.nl>
Fixes: e28f49b0b2a8 ("V4L/DVB: tm6000: fix some info messages")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/media/usb/tm6000/tm6000-video.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index 3f650ede0c3d..e293f6f3d1bc 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -852,8 +852,7 @@ static int vidioc_querycap(struct file *file, void  *priv,
 	struct tm6000_core *dev = ((struct tm6000_fh *)priv)->dev;
 
 	strscpy(cap->driver, "tm6000", sizeof(cap->driver));
-	strscpy(cap->card, "Trident TVMaster TM5600/6000/6010",
-		sizeof(cap->card));
+	strscpy(cap->card, "Trident TM5600/6000/6010", sizeof(cap->card));
 	usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
 	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
 			    V4L2_CAP_DEVICE_CAPS;
-- 
2.30.2


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

end of thread, other threads:[~2021-08-03 19:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 19:46 [PATCH 0/3] Avoid card name truncation Kees Cook
2021-08-03 19:46 ` [PATCH 1/3] media: radio-wl1273: " Kees Cook
2021-08-03 19:46 ` [PATCH 2/3] media: si470x: " Kees Cook
2021-08-03 19:46 ` [PATCH 3/3] media: tm6000: " Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).