@@ -82,9 +82,10 @@ static int copy_sc_from_user(struct pt_regs *regs,
82
82
#undef GETREG
83
83
84
84
#ifdef CONFIG_X86_32
85
- from_fp64 = ((void * )sc .fpstate ) + offsetof(struct _fpstate_32 , _fxsr_env );
85
+ from_fp64 = ((void __user * )sc .fpstate ) +
86
+ offsetof(struct _fpstate_32 , _fxsr_env );
86
87
#else
87
- from_fp64 = (void * )sc .fpstate ;
88
+ from_fp64 = (void __user * )sc .fpstate ;
88
89
#endif
89
90
90
91
err = copy_from_user (regs -> regs .fp , from_fp64 , host_fp_size );
@@ -97,7 +98,7 @@ static int copy_sc_from_user(struct pt_regs *regs,
97
98
task_user_regset_view (current ),
98
99
REGSET_FP_LEGACY , 0 ,
99
100
sizeof (struct user_i387_struct ),
100
- (void * )sc .fpstate );
101
+ (void __user * )sc .fpstate );
101
102
if (err < 0 )
102
103
return err ;
103
104
#endif
@@ -173,7 +174,8 @@ static int copy_sc_to_user(struct sigcontext __user *to,
173
174
BUILD_BUG_ON (offsetof(struct _xstate , xstate_hdr ) !=
174
175
offsetof(struct _xstate_64 , xstate_hdr ) +
175
176
offsetof(struct _fpstate_32 , _fxsr_env ));
176
- to_fp64 = (void * )to_fp + offsetof(struct _fpstate_32 , _fxsr_env );
177
+ to_fp64 = (void __user * )to_fp +
178
+ offsetof(struct _fpstate_32 , _fxsr_env );
177
179
#else
178
180
to_fp64 = to_fp ;
179
181
#endif /* CONFIG_X86_32 */
@@ -198,7 +200,8 @@ static int copy_sc_to_user(struct sigcontext __user *to,
198
200
__put_user (host_fp_size , & to_fp64 -> fpstate .sw_reserved .xstate_size );
199
201
200
202
__put_user (FP_XSTATE_MAGIC1 , & to_fp64 -> fpstate .sw_reserved .magic1 );
201
- __put_user (FP_XSTATE_MAGIC2 , (int * )((void * )to_fp64 + host_fp_size ));
203
+ __put_user (FP_XSTATE_MAGIC2 ,
204
+ (int __user * )((void __user * )to_fp64 + host_fp_size ));
202
205
203
206
return 0 ;
204
207
}
0 commit comments