firewire: cdev: restrict broadcast write requests to Units Space
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 4 Jan 2009 15:23:29 +0000 (16:23 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 24 Mar 2009 19:56:45 +0000 (20:56 +0100)
We don't want random users write to Memory Space (e.g. PCs with physical
DMA filters down) or to core CSRs like Reset_Start.

This does not protect SBP-2 target CSRs.  But properly behaving SBP-2
targets ignore broadcast write requests to these registers, and the
maximum damage which can happen with laxer targets is DOS.  But there
are ways to create DOS situations anyway if there are devices with weak
device file permissions (like audio/video devices) present at the same
bus as an SBP-2 target.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/fw-cdev.c

index a1637a86da3d49a5d99824b866710ab823ead1c7..d48fa1c23a7703bf0460b2461fd598027258ddd7 100644 (file)
@@ -1245,6 +1245,10 @@ static int ioctl_send_broadcast_request(struct client *client, void *buffer)
                return -EINVAL;
        }
 
+       /* Security policy: Only allow accesses to Units Space. */
+       if (request->offset < CSR_REGISTER_BASE + CSR_CONFIG_ROM_END)
+               return -EACCES;
+
        return init_request(client, request, LOCAL_BUS | 0x3f, SCODE_100);
 }
 
This page took 0.028437 seconds and 5 git commands to generate.