Skip to content

Commit

Permalink
firewire: cdev: extend transaction payload size check
Browse files Browse the repository at this point in the history
Make the size check of ioctl_send_request and
ioctl_send_broadcast_request speed dependent.  Also change the error
return code from -EINVAL to -EIO to distinguish this from other errors
concerning the ioctl parameters.

Another payload size limit for which we don't check here though is the
remote node's Bus_Info_Block.max_rec.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
  • Loading branch information
Stefan Richter committed Mar 24, 2009
1 parent 1566f3d commit 5d3fd69
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/firewire/fw-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,8 @@ static int init_request(struct client *client,
struct outbound_transaction_event *e;
int ret;

/* What is the biggest size we'll accept, really? */
if (request->length > 4096)
return -EINVAL;
if (request->length > 4096 || request->length > 512 << speed)
return -EIO;

e = kmalloc(sizeof(*e) + request->length, GFP_KERNEL);
if (e == NULL)
Expand Down

0 comments on commit 5d3fd69

Please sign in to comment.