mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] firewire: cdev: reduce stack usage by ioctl_dispatch
Date: Wed, 14 Oct 2009 22:43:54 +0200 (CEST)	[thread overview]
Message-ID: <tkrat.ec38f27900b7af20@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.af1058f9e26f4dba@s5r6.in-berlin.de>

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/


  reply	other threads:[~2009-10-14 20:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-07 22:38 [PATCH 0/8] firewire: misc updates Stefan Richter
2009-10-07 22:39 ` [PATCH 1/8] firewire: sbp2: provide fallback if mgt_ORB_timeout is missing Stefan Richter
2009-10-07 22:39 ` [PATCH 2/8] firewire: cdev: fix memory leak in an error path Stefan Richter
2009-10-07 22:40 ` [PATCH 3/8] firewire: cdev: reduce stack usage by ioctl_dispatch Stefan Richter
2009-10-14 20:43   ` Stefan Richter [this message]
2009-10-14 21:14     ` [PATCH update] " Stefan Richter
     [not found]       ` <4AD6F672.705@cam.ac.uk>
2009-10-15 19:16         ` [PATCH v3] " Stefan Richter
2009-10-07 22:41 ` [PATCH 4/8] firewire: normalize style of queue_work wrappers Stefan Richter
2009-10-07 22:41 ` [PATCH 5/8] firewire: cdev: normalize variable names Stefan Richter
2009-10-07 22:41 ` [PATCH 6/8] firewire: optimize config ROM creation Stefan Richter
2009-10-07 22:42 ` [PATCH 7/8] firewire: core: clarify generate_config_rom usage Stefan Richter
2009-10-07 22:42 ` [PATCH 8/8] firewire: core: optimize Topology Map creation Stefan Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tkrat.ec38f27900b7af20@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®