Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758237AbYGCIYp (ORCPT ); Thu, 3 Jul 2008 04:24:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752886AbYGCIQk (ORCPT ); Thu, 3 Jul 2008 04:16:40 -0400 Received: from mtagate8.de.ibm.com ([195.212.29.157]:49765 "EHLO mtagate8.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932964AbYGCHIN (ORCPT ); Thu, 3 Jul 2008 03:08:13 -0400 Date: Thu, 3 Jul 2008 09:07:22 +0200 From: Cornelia Huck To: Greg KH Cc: Anton Vorontsov , schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, linux390@de.ibm.com, Kay Sievers , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/04] s390: bus_id -> dev_set_name() changes Message-ID: <20080703090722.525b3930@gondolin.boeblingen.de.ibm.com> In-Reply-To: <20080702230742.GA708@kroah.com> References: <20080702154811.GB31083@kroah.com> <20080702221401.GA15142@zarina> <20080702230742.GA708@kroah.com> Organization: IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter =?ISO-8859-15?Q?Gesch=E4ftsf=FChrung:?= Herbert Kircher Sitz der Gesellschaft: =?ISO-8859-15?Q?B=F6blingen?= Registergericht: Amtsgericht Stuttgart, HRB 243294 X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1165 Lines: 30 On Wed, 2 Jul 2008 16:07:42 -0700, Greg KH wrote: > On Thu, Jul 03, 2008 at 02:14:01AM +0400, Anton Vorontsov wrote: > > On Wed, Jul 02, 2008 at 08:48:11AM -0700, Greg KH wrote: > > > --- a/drivers/s390/block/dcssblk.c > > > +++ b/drivers/s390/block/dcssblk.c > > > @@ -349,7 +349,7 @@ dcssblk_add_store(struct device *dev, st > > > } > > > > > > strcpy(dev_info->segment_name, local_buf); > > > - strlcpy(dev_info->dev.bus_id, local_buf, BUS_ID_SIZE); > > > + dev_set_name(&dev_info->dev, local_buf); > > > > As I see it, dev_set_name accepts printf like string, so this > > dev_set_name is quite dangerous (since local_buf is formed > > by the module param), no? > > So you would rather see: > dev_set_name(&dev_info->dev, "%s", local_buf); > > instead? Hm, I thought the string had already been sanitized at that time, but looking again it doesn't do many checks... so this looks better. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/