lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1398532162-23006-1-git-send-email-laurent.navet@gmail.com>
Date:	Sat, 26 Apr 2014 19:09:22 +0200
From:	Laurent Navet <laurent.navet@...il.com>
To:	gregkh@...uxfoundation.org
Cc:	tiwai@...e.de, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org,
	Laurent Navet <laurent.navet@...il.com>
Subject: [PATCH] staging: line6: fix possible overrun

The strcpy operation may write past the end of the fixed-size destination
buffer if the source buffer is too large.

Found by coverity scan : CID 144979

Signed-off-by: Laurent Navet <laurent.navet@...il.com>
---
build tested only

 drivers/staging/line6/audio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/line6/audio.c b/drivers/staging/line6/audio.c
index 171d80c..65f5cd4 100644
--- a/drivers/staging/line6/audio.c
+++ b/drivers/staging/line6/audio.c
@@ -32,9 +32,10 @@ int line6_init_audio(struct usb_line6 *line6)
 
 	line6->card = card;
 
-	strcpy(card->id, line6->properties->id);
+	strncpy(card->id, line6->properties->id, (sizeof(card->id)-1));
 	strcpy(card->driver, DRIVER_NAME);
-	strcpy(card->shortname, line6->properties->name);
+	strncpy(card->shortname, line6->properties->name,
+			(sizeof(card->shortname)-1));
 	/* longname is 80 chars - see asound.h */
 	sprintf(card->longname, "Line6 %s at USB %s", line6->properties->name,
 		dev_name(line6->ifcdev));
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ