Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760070AbZJNUop (ORCPT ); Wed, 14 Oct 2009 16:44:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759749AbZJNUop (ORCPT ); Wed, 14 Oct 2009 16:44:45 -0400 Received: from einhorn.in-berlin.de ([192.109.42.8]:55470 "EHLO einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757204AbZJNUoo (ORCPT ); Wed, 14 Oct 2009 16:44:44 -0400 X-Envelope-From: stefanr@s5r6.in-berlin.de Date: Wed, 14 Oct 2009 22:43:54 +0200 (CEST) From: Stefan Richter Subject: Re: [PATCH 3/8] firewire: cdev: reduce stack usage by ioctl_dispatch To: linux1394-devel@lists.sourceforge.net cc: linux-kernel@vger.kernel.org In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1116 Lines: 35 I wrote: > --- linux-2.6.31.orig/drivers/firewire/core-cdev.c > +++ linux-2.6.31/drivers/firewire/core-cdev.c > @@ -1299,28 +1299,47 @@ static int (* const ioctl_handlers[])(st > static int dispatch_ioctl(struct client *client, > unsigned int cmd, void __user *arg) > { > - char buffer[256]; > + char buffer[40]; > int ret; > > +#define check_ioctl_size(x) BUILD_BUG_ON(_IOC_SIZE(x) > sizeof(buffer)) > + > + check_ioctl_size(FW_CDEV_IOC_GET_INFO); > + check_ioctl_size(FW_CDEV_IOC_SEND_REQUEST); [...] With linux 2.6.32-rc1's version of BUILD_BUG_ON, this adds sparse warnings (seen with sparse 0.4.2): drivers/firewire/core-cdev.c:1308:9: error: bad integer constant expression drivers/firewire/core-cdev.c:1309:9: error: bad integer constant expression [...] Back to the drawing board. -- Stefan Richter -=====-==--= =-=- -===- http://arcgraph.de/sr/ -- 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/