From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764381AbYD2SyT (ORCPT ); Tue, 29 Apr 2008 14:54:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759431AbYD2SvR (ORCPT ); Tue, 29 Apr 2008 14:51:17 -0400 Received: from mx1.suse.de ([195.135.220.2]:51672 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758939AbYD2SvP (ORCPT ); Tue, 29 Apr 2008 14:51:15 -0400 Date: Tue, 29 Apr 2008 11:50:05 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Alan Cox , Hans Verkuil , v4l-dvb maintainer list , Mauro Carvalho Chehab Subject: [10/12] V4L: Fix VIDIOCGAP corruption in ivtv Message-ID: <20080429185005.GL24199@suse.de> References: <20080429184543.308594866@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="v4l-fix-vidiocgap-corruption-in-ivtv.patch" In-Reply-To: <20080429184911.GA24199@suse.de> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.24-stable review patch. If anyone has any objections, please let us know. ------------------ From: Alan Cox Frank Bennett reported that ivtv was causing skype to crash. With help from one of their developers he showed it was a kernel problem. VIDIOCGCAP copies a name into a fixed length buffer - ivtv uses names that are too long and does not truncate them so corrupts a few bytes of the app data area. Possibly the names also want trimming but for now this should fix the corruption case. Signed-off-by: Alan Cox Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Michael Krufky (cherry picked from commit d2b213f7b76f187c4391079c7581d3a08b940133) Signed-off-by: Greg Kroah-Hartman --- drivers/media/video/ivtv/ivtv-ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c @@ -727,7 +727,8 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, s memset(vcap, 0, sizeof(*vcap)); strcpy(vcap->driver, IVTV_DRIVER_NAME); /* driver name */ - strcpy(vcap->card, itv->card_name); /* card type */ + strncpy(vcap->card, itv->card_name, + sizeof(vcap->card)-1); /* card type */ strcpy(vcap->bus_info, pci_name(itv->dev)); /* bus info... */ vcap->version = IVTV_DRIVER_VERSION; /* version */ vcap->capabilities = itv->v4l2_cap; /* capabilities */ --