mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-01 20:28:26 +07:00
[POWERPC] powerpc oprofile __user annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
ed2bfcd2de
commit
62034f0338
@ -11,6 +11,7 @@
|
|||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
||||||
|
#include <asm/compat.h>
|
||||||
|
|
||||||
#define STACK_SP(STACK) *(STACK)
|
#define STACK_SP(STACK) *(STACK)
|
||||||
|
|
||||||
@ -26,8 +27,9 @@
|
|||||||
static unsigned int user_getsp32(unsigned int sp, int is_first)
|
static unsigned int user_getsp32(unsigned int sp, int is_first)
|
||||||
{
|
{
|
||||||
unsigned int stack_frame[2];
|
unsigned int stack_frame[2];
|
||||||
|
void __user *p = compat_ptr(sp);
|
||||||
|
|
||||||
if (!access_ok(VERIFY_READ, sp, sizeof(stack_frame)))
|
if (!access_ok(VERIFY_READ, p, sizeof(stack_frame)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -35,8 +37,7 @@ static unsigned int user_getsp32(unsigned int sp, int is_first)
|
|||||||
* which means that we've done all that we can do from
|
* which means that we've done all that we can do from
|
||||||
* interrupt context.
|
* interrupt context.
|
||||||
*/
|
*/
|
||||||
if (__copy_from_user_inatomic(stack_frame, (void *)(long)sp,
|
if (__copy_from_user_inatomic(stack_frame, p, sizeof(stack_frame)))
|
||||||
sizeof(stack_frame)))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!is_first)
|
if (!is_first)
|
||||||
@ -54,10 +55,10 @@ static unsigned long user_getsp64(unsigned long sp, int is_first)
|
|||||||
{
|
{
|
||||||
unsigned long stack_frame[3];
|
unsigned long stack_frame[3];
|
||||||
|
|
||||||
if (!access_ok(VERIFY_READ, sp, sizeof(stack_frame)))
|
if (!access_ok(VERIFY_READ, (void __user *)sp, sizeof(stack_frame)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (__copy_from_user_inatomic(stack_frame, (void *)sp,
|
if (__copy_from_user_inatomic(stack_frame, (void __user *)sp,
|
||||||
sizeof(stack_frame)))
|
sizeof(stack_frame)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user