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

Discuss and suggest new grsecurity features

Moderators: spender, PaX Team

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

Postby blueness » Fri Apr 29, 2016 6:32 am

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
+
blueness
 
Posts: 5
Joined: Sun Jul 04, 2010 7:30 am

Return to grsecurity development