diff options
author | Mark Brown <broonie@kernel.org> | 2023-01-31 22:20:39 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2023-02-01 17:56:47 +0000 |
commit | 92f14518cc43dcaebfb281dfff2fe14b87633cf4 (patch) | |
tree | 786e031052bc8b105a582578efbfd6ac5bfe8ad2 | |
parent | ea776e4932302b965a2800e7905d9fa48c0d9e85 (diff) | |
download | linux-stable-92f14518cc43dcaebfb281dfff2fe14b87633cf4.tar.gz linux-stable-92f14518cc43dcaebfb281dfff2fe14b87633cf4.tar.bz2 linux-stable-92f14518cc43dcaebfb281dfff2fe14b87633cf4.zip |
arm64/signal: Don't redundantly verify FPSIMD magic
We validate that the magic in the struct fpsimd_context is correct in
restore_fpsimd_context() but this is redundant since parse_user_sigframe()
uses this magic to decide to call the function in the first place. Remove
the extra validation.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20221212-arm64-signal-cleanup-v3-1-4545c94b20ff@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm64/kernel/signal.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index ed692284f199..882f6d913508 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -191,15 +191,14 @@ static int preserve_fpsimd_context(struct fpsimd_context __user *ctx) static int restore_fpsimd_context(struct fpsimd_context __user *ctx) { struct user_fpsimd_state fpsimd; - __u32 magic, size; + __u32 size; int err = 0; - /* check the magic/size information */ - __get_user_error(magic, &ctx->head.magic, err); + /* check the size information */ __get_user_error(size, &ctx->head.size, err); if (err) return -EFAULT; - if (magic != FPSIMD_MAGIC || size != sizeof(struct fpsimd_context)) + if (size != sizeof(struct fpsimd_context)) return -EINVAL; /* copy the FP and status/control registers */ |