]> err.no Git - linux-2.6/blobdiff - drivers/infiniband/core/uverbs.h
[IB] uverbs: Close some exploitable races
[linux-2.6] / drivers / infiniband / core / uverbs.h
index 180b3d4765e40bc4eae9d3c0c6516006fefdbee2..cc124344dd2c72335cc8ebcb476cc66e4802e75d 100644 (file)
@@ -69,6 +69,7 @@ struct ib_uverbs_event_file {
 
 struct ib_uverbs_file {
        struct kref                             ref;
+       struct semaphore                        mutex;
        struct ib_uverbs_device                *device;
        struct ib_ucontext                     *ucontext;
        struct ib_event_handler                 event_handler;
@@ -76,20 +77,28 @@ struct ib_uverbs_file {
        struct ib_uverbs_event_file             comp_file[1];
 };
 
-struct ib_uverbs_async_event {
-       struct ib_uverbs_async_event_desc       desc;
+struct ib_uverbs_event {
+       union {
+               struct ib_uverbs_async_event_desc       async;
+               struct ib_uverbs_comp_event_desc        comp;
+       }                                       desc;
        struct list_head                        list;
+       struct list_head                        obj_list;
+       u32                                    *counter;
 };
 
-struct ib_uverbs_comp_event {
-       struct ib_uverbs_comp_event_desc        desc;
-       struct list_head                        list;
+struct ib_uevent_object {
+       struct ib_uobject       uobject;
+       struct list_head        event_list;
+       u32                     events_reported;
 };
 
-struct ib_uobject_mr {
-       struct ib_uobject                       uobj;
-       struct page                            *page_list;
-       struct scatterlist                     *sg_list;
+struct ib_ucq_object {
+       struct ib_uobject       uobject;
+       struct list_head        comp_list;
+       struct list_head        async_list;
+       u32                     comp_events_reported;
+       u32                     async_events_reported;
 };
 
 extern struct semaphore ib_uverbs_idr_mutex;