chiark / gitweb /
bus: make sure we check for "incompatible" flags negotiated with kernel kdbus
authorLennart Poettering <lennart@poettering.net>
Mon, 2 Dec 2013 22:31:41 +0000 (23:31 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 2 Dec 2013 22:32:34 +0000 (23:32 +0100)
src/libsystemd-bus/bus-kernel.c

index 98fc27cda51445385b51384d596f6a7bca1e01f3..fb852bd730a41b44016f623a84f265cee57cec79 100644 (file)
@@ -1074,6 +1074,13 @@ int bus_kernel_create_bus(const char *name, char **s) {
                 return -errno;
         }
 
+        /* The higher 32bit of the flags field are considered
+         * 'incompatible flags'. Refuse them all for now. */
+        if (make->flags > 0xFFFFFFFFULL) {
+                close_nointr_nofail(fd);
+                return -ENOTSUP;
+        }
+
         if (s) {
                 char *p;
 
@@ -1118,6 +1125,13 @@ int bus_kernel_create_namespace(const char *name, char **s) {
                 return -errno;
         }
 
+        /* The higher 32bit of the flags field are considered
+         * 'incompatible flags'. Refuse them all for now. */
+        if (make->flags > 0xFFFFFFFFULL) {
+                close_nointr_nofail(fd);
+                return -ENOTSUP;
+        }
+
         if (s) {
                 char *p;