arm64: Tighten the PR_{SET, GET}_TAGGED_ADDR_CTRL prctl() unused arguments
authorCatalin Marinas <catalin.marinas@arm.com>
Thu, 15 Aug 2019 15:44:00 +0000 (16:44 +0100)
committerWill Deacon <will@kernel.org>
Tue, 20 Aug 2019 17:17:55 +0000 (18:17 +0100)
Require that arg{3,4,5} of the PR_{SET,GET}_TAGGED_ADDR_CTRL prctl and
arg2 of the PR_GET_TAGGED_ADDR_CTRL prctl() are zero rather than ignored
for future extensions.

Acked-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
kernel/sys.c

index c6c4d5358bd35870d455530bae4abe440e64da35..ec48396b494375aa22dc8a3d5570cd477db4b429 100644 (file)
@@ -2499,9 +2499,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
                error = PAC_RESET_KEYS(me, arg2);
                break;
        case PR_SET_TAGGED_ADDR_CTRL:
+               if (arg3 || arg4 || arg5)
+                       return -EINVAL;
                error = SET_TAGGED_ADDR_CTRL(arg2);
                break;
        case PR_GET_TAGGED_ADDR_CTRL:
+               if (arg2 || arg3 || arg4 || arg5)
+                       return -EINVAL;
                error = GET_TAGGED_ADDR_CTRL();
                break;
        default: