lkml.org 
[lkml]   [2009]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/8] firewire: cdev: reduce stack usage by ioctl_dispatch
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/



\
 
 \ /
  Last update: 2009-10-14 22:51    [W:0.096 / U:3.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site