Skip to content

Commit 92f1451

Browse files
brooniectmarinas
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent ea776e4 commit 92f1451

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/arm64/kernel/signal.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,14 @@ static int preserve_fpsimd_context(struct fpsimd_context __user *ctx)
191191
static int restore_fpsimd_context(struct fpsimd_context __user *ctx)
192192
{
193193
struct user_fpsimd_state fpsimd;
194-
__u32 magic, size;
194+
__u32 size;
195195
int err = 0;
196196

197-
/* check the magic/size information */
198-
__get_user_error(magic, &ctx->head.magic, err);
197+
/* check the size information */
199198
__get_user_error(size, &ctx->head.size, err);
200199
if (err)
201200
return -EFAULT;
202-
if (magic != FPSIMD_MAGIC || size != sizeof(struct fpsimd_context))
201+
if (size != sizeof(struct fpsimd_context))
203202
return -EINVAL;
204203

205204
/* copy the FP and status/control registers */

0 commit comments

Comments
 (0)