Page 1 of 1

redunded nested ifdefs in grsecurity-3.1-4.5.2-201604282058.

PostPosted: Fri Apr 29, 2016 6:32 am
by blueness
Around line 146742 of grsecurity-3.1-4.5.2-201604282058.patch we have some redundant nested ifdefs. Here's the patch hunk for context. The inner if CONFIG_PAX_XATTR_PAX_FLAGS
is lint.

Code: Select all
+#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
+static int shmem_user_xattr_handler_set(const struct xattr_handler *handler,
+                                  struct dentry *dentry, const char *name,
+                                  const void *value, size_t size, int flags)
+{
+       struct shmem_inode_info *info = SHMEM_I(d_inode(dentry));
+
+#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
+       if (strcmp(name, XATTR_NAME_PAX_FLAGS))
+               return -EOPNOTSUPP;
+       if (size > 8)
+               return -EINVAL;
+#endif
+
+       name = xattr_full_name(handler, name);
+       return simple_xattr_set(&info->xattrs, name, value, size, flags);
+}
+#endif
+