Skip to content

Commit

Permalink
From patchwork series 383505
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox Snowpatch committed Nov 23, 2023
1 parent 9a15ae6 commit ee8e016
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/powerpc/lib/sstep.c
Expand Up @@ -586,6 +586,8 @@ static int do_fp_load(struct instruction_op *op, unsigned long ea,
} u;

nb = GETSIZE(op->type);
if (nb > sizeof(u))
return -EINVAL;
if (!address_ok(regs, ea, nb))
return -EFAULT;
rn = op->reg;
Expand Down Expand Up @@ -636,6 +638,8 @@ static int do_fp_store(struct instruction_op *op, unsigned long ea,
} u;

nb = GETSIZE(op->type);
if (nb > sizeof(u))
return -EINVAL;
if (!address_ok(regs, ea, nb))
return -EFAULT;
rn = op->reg;
Expand Down Expand Up @@ -680,6 +684,9 @@ static nokprobe_inline int do_vec_load(int rn, unsigned long ea,
u8 b[sizeof(__vector128)];
} u = {};

if (size > sizeof(u))
return -EINVAL;

if (!address_ok(regs, ea & ~0xfUL, 16))
return -EFAULT;
/* align to multiple of size */
Expand Down Expand Up @@ -707,6 +714,9 @@ static nokprobe_inline int do_vec_store(int rn, unsigned long ea,
u8 b[sizeof(__vector128)];
} u;

if (size > sizeof(u))
return -EINVAL;

if (!address_ok(regs, ea & ~0xfUL, 16))
return -EFAULT;
/* align to multiple of size */
Expand Down

0 comments on commit ee8e016

Please sign in to comment.