diff options
-rw-r--r-- | drivers/firewire/fw-cdev.c | 8 | ||||
-rw-r--r-- | include/linux/firewire-cdev.h | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c index 2784f91896db..160cb27e120c 100644 --- a/drivers/firewire/fw-cdev.c +++ b/drivers/firewire/fw-cdev.c | |||
@@ -742,9 +742,17 @@ static void release_descriptor(struct client *client, | |||
742 | static int ioctl_add_descriptor(struct client *client, void *buffer) | 742 | static int ioctl_add_descriptor(struct client *client, void *buffer) |
743 | { | 743 | { |
744 | struct fw_cdev_add_descriptor *request = buffer; | 744 | struct fw_cdev_add_descriptor *request = buffer; |
745 | struct fw_card *card = client->device->card; | ||
745 | struct descriptor_resource *r; | 746 | struct descriptor_resource *r; |
746 | int ret; | 747 | int ret; |
747 | 748 | ||
749 | /* Access policy: Allow this ioctl only on local nodes' device files. */ | ||
750 | spin_lock_irq(&card->lock); | ||
751 | ret = client->device->node_id != card->local_node->node_id; | ||
752 | spin_unlock_irq(&card->lock); | ||
753 | if (ret) | ||
754 | return -ENOSYS; | ||
755 | |||
748 | if (request->length > 256) | 756 | if (request->length > 256) |
749 | return -EINVAL; | 757 | return -EINVAL; |
750 | 758 | ||
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index de4035792f70..25bc82726ef7 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -394,6 +394,9 @@ struct fw_cdev_initiate_bus_reset { | |||
394 | * If successful, the kernel adds the descriptor and writes back a handle to the | 394 | * If successful, the kernel adds the descriptor and writes back a handle to the |
395 | * kernel-side object to be used for later removal of the descriptor block and | 395 | * kernel-side object to be used for later removal of the descriptor block and |
396 | * immediate key. | 396 | * immediate key. |
397 | * | ||
398 | * This ioctl affects the configuration ROMs of all local nodes. | ||
399 | * The ioctl only succeeds on device files which represent a local node. | ||
397 | */ | 400 | */ |
398 | struct fw_cdev_add_descriptor { | 401 | struct fw_cdev_add_descriptor { |
399 | __u32 immediate; | 402 | __u32 immediate; |
@@ -409,7 +412,7 @@ struct fw_cdev_add_descriptor { | |||
409 | * descriptor was added | 412 | * descriptor was added |
410 | * | 413 | * |
411 | * Remove a descriptor block and accompanying immediate key from the local | 414 | * Remove a descriptor block and accompanying immediate key from the local |
412 | * node's configuration ROM. | 415 | * nodes' configuration ROMs. |
413 | */ | 416 | */ |
414 | struct fw_cdev_remove_descriptor { | 417 | struct fw_cdev_remove_descriptor { |
415 | __u32 handle; | 418 | __u32 handle; |