Merge tag 'safesetid-5.13' of git://github.com/micah-morton/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2021 19:08:06 +0000 (12:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2021 19:08:06 +0000 (12:08 -0700)
Pull SafeSetID update from Micah Morton:
 "Simple code cleanup

  This just has a single three-line code cleanup to eliminate some
  unnecessary 'break' statements"

* tag 'safesetid-5.13' of git://github.com/micah-morton/linux:
  LSM: SafeSetID: Fix code specification by scripts/checkpatch.pl

security/safesetid/lsm.c

index 8a176b6adbe5b5e9ebb8620c897ce8c1e57b1e60..1079c6d5478464cab18c702fe9471e4a575225ae 100644 (file)
@@ -125,7 +125,6 @@ static int safesetid_security_capable(const struct cred *cred,
                pr_warn("Operation requires CAP_SETUID, which is not available to UID %u for operations besides approved set*uid transitions\n",
                        __kuid_val(cred->uid));
                return -EPERM;
-               break;
        case CAP_SETGID:
                /*
                * If no policy applies to this task, allow the use of CAP_SETGID for
@@ -140,11 +139,9 @@ static int safesetid_security_capable(const struct cred *cred,
                pr_warn("Operation requires CAP_SETGID, which is not available to GID %u for operations besides approved set*gid transitions\n",
                        __kuid_val(cred->uid));
                return -EPERM;
-               break;
        default:
                /* Error, the only capabilities were checking for is CAP_SETUID/GID */
                return 0;
-               break;
        }
        return 0;
 }