From: Karol Lewandowski <[email protected]>

Signed-off-by: Karol Lewandowski <[email protected]>
---
 drivers/misc/kdbus/queue.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/misc/kdbus/queue.c b/drivers/misc/kdbus/queue.c
index 6693852..dae18bd 100644
--- a/drivers/misc/kdbus/queue.c
+++ b/drivers/misc/kdbus/queue.c
@@ -25,6 +25,7 @@
 #include <linux/poll.h>
 #include <linux/sched.h>
 #include <linux/sizes.h>
+#include <linux/security.h>
 #include <linux/slab.h>
 #include <linux/syscalls.h>
 
@@ -41,6 +42,18 @@ static int kdbus_queue_entry_fds_install(struct 
kdbus_queue_entry *entry)
        int ret, *fds;
        size_t count;
 
+        for (i = 0; i < entry->fds_count; i++) {
+                ret = security_file_receive(entry->fds_fp[i]);
+                if (ret)
+                        return ret;
+        }
+
+        for (i = 0; i < entry->memfds_count; i++) {
+                ret = security_file_receive(entry->memfds_fp[i]);
+                if (ret)
+                        return ret;
+        }
+
        /* get array of file descriptors */
        count = entry->fds_count + entry->memfds_count;
        if (!count)
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to