@@ -191,15 +191,12 @@ enum aarch32_map {
191
191
#ifdef CONFIG_COMPAT_VDSO
192
192
AA32_MAP_VVAR ,
193
193
AA32_MAP_VDSO ,
194
- #else
195
- AA32_MAP_SIGPAGE
196
194
#endif
195
+ AA32_MAP_SIGPAGE
197
196
};
198
197
199
198
static struct page * aarch32_vectors_page __ro_after_init ;
200
- #ifndef CONFIG_COMPAT_VDSO
201
199
static struct page * aarch32_sig_page __ro_after_init ;
202
- #endif
203
200
204
201
static struct vm_special_mapping aarch32_vdso_maps [] = {
205
202
[AA32_MAP_VECTORS ] = {
@@ -214,12 +211,11 @@ static struct vm_special_mapping aarch32_vdso_maps[] = {
214
211
.name = "[vdso]" ,
215
212
.mremap = aarch32_vdso_mremap ,
216
213
},
217
- #else
214
+ #endif /* CONFIG_COMPAT_VDSO */
218
215
[AA32_MAP_SIGPAGE ] = {
219
216
.name = "[sigpage]" , /* ABI */
220
217
.pages = & aarch32_sig_page ,
221
218
},
222
- #endif /* CONFIG_COMPAT_VDSO */
223
219
};
224
220
225
221
static int aarch32_alloc_kuser_vdso_page (void )
@@ -242,27 +238,11 @@ static int aarch32_alloc_kuser_vdso_page(void)
242
238
return 0 ;
243
239
}
244
240
245
- #ifdef CONFIG_COMPAT_VDSO
246
- static int __aarch32_alloc_vdso_pages (void )
247
- {
248
- int ret ;
249
-
250
- vdso_info [VDSO_ABI_AA32 ].dm = & aarch32_vdso_maps [AA32_MAP_VVAR ];
251
- vdso_info [VDSO_ABI_AA32 ].cm = & aarch32_vdso_maps [AA32_MAP_VDSO ];
252
-
253
- ret = __vdso_init (VDSO_ABI_AA32 );
254
- if (ret )
255
- return ret ;
256
-
257
- return aarch32_alloc_kuser_vdso_page ();
258
- }
259
- #else
260
- static int __aarch32_alloc_vdso_pages (void )
241
+ static int aarch32_alloc_sigpage (void )
261
242
{
262
243
extern char __aarch32_sigret_code_start [], __aarch32_sigret_code_end [];
263
244
int sigret_sz = __aarch32_sigret_code_end - __aarch32_sigret_code_start ;
264
245
unsigned long sigpage ;
265
- int ret ;
266
246
267
247
sigpage = get_zeroed_page (GFP_ATOMIC );
268
248
if (!sigpage )
@@ -271,18 +251,34 @@ static int __aarch32_alloc_vdso_pages(void)
271
251
memcpy ((void * )sigpage , __aarch32_sigret_code_start , sigret_sz );
272
252
aarch32_sig_page = virt_to_page (sigpage );
273
253
flush_dcache_page (aarch32_sig_page );
254
+ return 0 ;
255
+ }
274
256
275
- ret = aarch32_alloc_kuser_vdso_page ();
276
- if (ret )
277
- free_page (sigpage );
257
+ #ifdef CONFIG_COMPAT_VDSO
258
+ static int __aarch32_alloc_vdso_pages (void )
259
+ {
260
+ vdso_info [VDSO_ABI_AA32 ].dm = & aarch32_vdso_maps [AA32_MAP_VVAR ];
261
+ vdso_info [VDSO_ABI_AA32 ].cm = & aarch32_vdso_maps [AA32_MAP_VDSO ];
278
262
279
- return ret ;
263
+ return __vdso_init ( VDSO_ABI_AA32 ) ;
280
264
}
281
265
#endif /* CONFIG_COMPAT_VDSO */
282
266
283
267
static int __init aarch32_alloc_vdso_pages (void )
284
268
{
285
- return __aarch32_alloc_vdso_pages ();
269
+ int ret ;
270
+
271
+ #ifdef CONFIG_COMPAT_VDSO
272
+ ret = __aarch32_alloc_vdso_pages ();
273
+ if (ret )
274
+ return ret ;
275
+ #endif
276
+
277
+ ret = aarch32_alloc_sigpage ();
278
+ if (ret )
279
+ return ret ;
280
+
281
+ return aarch32_alloc_kuser_vdso_page ();
286
282
}
287
283
arch_initcall (aarch32_alloc_vdso_pages );
288
284
@@ -305,7 +301,6 @@ static int aarch32_kuser_helpers_setup(struct mm_struct *mm)
305
301
return PTR_ERR_OR_ZERO (ret );
306
302
}
307
303
308
- #ifndef CONFIG_COMPAT_VDSO
309
304
static int aarch32_sigreturn_setup (struct mm_struct * mm )
310
305
{
311
306
unsigned long addr ;
@@ -328,12 +323,11 @@ static int aarch32_sigreturn_setup(struct mm_struct *mm)
328
323
if (IS_ERR (ret ))
329
324
goto out ;
330
325
331
- mm -> context .vdso = (void * )addr ;
326
+ mm -> context .sigpage = (void * )addr ;
332
327
333
328
out :
334
329
return PTR_ERR_OR_ZERO (ret );
335
330
}
336
- #endif /* !CONFIG_COMPAT_VDSO */
337
331
338
332
int aarch32_setup_additional_pages (struct linux_binprm * bprm , int uses_interp )
339
333
{
@@ -352,10 +346,11 @@ int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
352
346
mm ,
353
347
bprm ,
354
348
uses_interp );
355
- #else
356
- ret = aarch32_sigreturn_setup ( mm ) ;
349
+ if ( ret )
350
+ goto out ;
357
351
#endif /* CONFIG_COMPAT_VDSO */
358
352
353
+ ret = aarch32_sigreturn_setup (mm );
359
354
out :
360
355
mmap_write_unlock (mm );
361
356
return ret ;
0 commit comments