diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-07-23 07:02:54 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-07-23 07:36:28 -0400 |
commit | 0c9ae701ae1caf657326db22d61074b40a747c9d (patch) | |
tree | 97eccc9b9941e71c471b5b3f32450c89f476093f /drivers/firewire | |
parent | cc550216ae9a2993ef3973464714dc1a39ab1f86 (diff) |
firewire: core: fix upper bound of possible CSR allocations
region->end is defined as an upper bound of the requested address range,
exclusive --- i.e. as an address outside of the range in which the
requested CSR is to be placed.
Hence 0x0001,0000,0000,0000 is the biggest valid region->end, not
0x0000,ffff,ffff,fffc like the current check asserted.
For simplicity, the fix drops the region->end & 3 test because there is
no actual problem with these bits set in region->end. The allocated
address range will be quadlet aligned and of a size of multiple quadlets
due to the checks for region->start & 3 and handler->length & 3 alone.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/core-transaction.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 6f225cacbc3d..ca7ca56661e0 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c | |||
@@ -543,8 +543,8 @@ int fw_core_add_address_handler(struct fw_address_handler *handler, | |||
543 | int ret = -EBUSY; | 543 | int ret = -EBUSY; |
544 | 544 | ||
545 | if (region->start & 0xffff000000000003ULL || | 545 | if (region->start & 0xffff000000000003ULL || |
546 | region->end & 0xffff000000000003ULL || | ||
547 | region->start >= region->end || | 546 | region->start >= region->end || |
547 | region->end > 0x0001000000000000ULL || | ||
548 | handler->length & 3 || | 548 | handler->length & 3 || |
549 | handler->length == 0) | 549 | handler->length == 0) |
550 | return -EINVAL; | 550 | return -EINVAL; |