tracing: Fix null pointer deref with SEND_SIG_FORCED
[safe/jmp/linux-2.6] / security / commoncap.c
index 677fad9..4e01599 100644 (file)
@@ -570,7 +570,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,
        }
 
        if (!strncmp(name, XATTR_SECURITY_PREFIX,
-                    sizeof(XATTR_SECURITY_PREFIX) - 1)  &&
+                    sizeof(XATTR_SECURITY_PREFIX) - 1) &&
            !capable(CAP_SYS_ADMIN))
                return -EPERM;
        return 0;
@@ -596,7 +596,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)
        }
 
        if (!strncmp(name, XATTR_SECURITY_PREFIX,
-                    sizeof(XATTR_SECURITY_PREFIX) - 1)  &&
+                    sizeof(XATTR_SECURITY_PREFIX) - 1) &&
            !capable(CAP_SYS_ADMIN))
                return -EPERM;
        return 0;
@@ -896,10 +896,10 @@ error:
  */
 int cap_syslog(int type, bool from_file)
 {
-       /* /proc/kmsg can open be opened by CAP_SYS_ADMIN */
-       if (type != 1 && from_file)
+       if (type != SYSLOG_ACTION_OPEN && from_file)
                return 0;
-       if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN))
+       if ((type != SYSLOG_ACTION_READ_ALL &&
+            type != SYSLOG_ACTION_SIZE_BUFFER) && !capable(CAP_SYS_ADMIN))
                return -EPERM;
        return 0;
 }
@@ -931,7 +931,7 @@ int cap_vm_enough_memory(struct mm_struct *mm, long pages)
  * @addr: address attempting to be mapped
  * @addr_only: unused
  *
- * If the process is attempting to map memory below mmap_min_addr they need
+ * If the process is attempting to map memory below dac_mmap_min_addr they need
  * CAP_SYS_RAWIO.  The other parameters to this function are unused by the
  * capability security module.  Returns 0 if this mapping should be allowed
  * -EPERM if not.