Commit b13c190
s390/uaccess: Initialize code pages executed with non-default access key
cmpxchg_user_key() may be executed with a non-zero key; if then the storage
key of the page which belongs to the cmpxchg_user_key() code contains a key
with fetch-protection enabled the result is a protection exception:
Unable to handle kernel pointer dereference in virtual kernel address space
Failing address: 0000000000000000 TEID: 000000000000080b
Fault in home space mode while using kernel ASCE.
AS:0000000002528007 R3:00000001ffffc007 S:00000001ffffb801 P:000000000000013d
Oops: 0004 ilc:1 [#1]SMP
Modules linked in:
CPU: 3 UID: 0 PID: 791 Comm: memop Not tainted 6.16.0-rc1-00006-g3b568201d0a6-dirty #11 NONE
Hardware name: IBM 3931 A01 704 (z/VM 7.4.0)
Krnl PSW : 0794f00180000000 000003ffe0f4d91e (__cmpxchg_user_key1+0xbe/0x190)
R:0 T:1 IO:1 EX:1 Key:9 M:1 W:0 P:0 AS:3 CC:3 PM:0 RI:0 EA:3
Krnl GPRS: 070003ffdfbf6af0 0000000000070000 0000000095b5a300 0000000000000000
00000000f1000000 0000000000000000 0000000000000090 0000000000000000
0000000000000040 0000000000000018 000003ff9b23d000 0000037fe0ef7bd8
000003ffdfbf7500 00000000962e4000 0000037f00ffffff 0000037fe0ef7aa0
Krnl Code: 000003ffe0f4d912: ad03f0a0 stosm 160(%r15),3
000003ffe0f4d916: a7780000 lhi %r7,0
#000003ffe0f4d91a: b20a6000 spka 0(%r6)
>000003ffe0f4d91e: b2790100 sacf 256
000003ffe0f4d922: a56f0080 llill %r6,128
000003ffe0f4d926: 5810a000 l %r1,0(%r10)
000003ffe0f4d92a: 141e nr %r1,%r14
000003ffe0f4d92c: c0e7ffffffff xilf %r14,4294967295
Call Trace:
[<000003ffe0f4d91e>] __cmpxchg_user_key1+0xbe/0x190
[<000003ffe0189c6e>] cmpxchg_guest_abs_with_key+0x2fe/0x370
[<000003ffe016d28e>] kvm_s390_vm_mem_op_cmpxchg+0x17e/0x350
[<000003ffe0173284>] kvm_arch_vm_ioctl+0x354/0x6f0
[<000003ffe015fedc>] kvm_vm_ioctl+0x2cc/0x6e0
[<000003ffe05348ae>] vfs_ioctl+0x2e/0x70
[<000003ffe0535e70>] __s390x_sys_ioctl+0xe0/0x100
[<000003ffe0f40f06>] __do_syscall+0x136/0x340
[<000003ffe0f4cb2e>] system_call+0x6e/0x90
Last Breaking-Event-Address:
[<000003ffe0f4d896>] __cmpxchg_user_key1+0x36/0x190
Fix this by defining all code ranges within cmpxchg_user_key() functions
which may be executed with a non-default key and explicitly initialize
storage keys by calling skey_regions_initialize().
Reviewed-by: Claudio Imbrenda <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Alexander Gordeev <[email protected]>1 parent ee417a8 commit b13c190
1 file changed
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | | - | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
| 186 | + | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
| 191 | + | |
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
| |||
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
| 219 | + | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
221 | 226 | | |
222 | | - | |
| 227 | + | |
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
| |||
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
| 245 | + | |
240 | 246 | | |
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
| 250 | + | |
244 | 251 | | |
245 | 252 | | |
246 | 253 | | |
| |||
267 | 274 | | |
268 | 275 | | |
269 | 276 | | |
| 277 | + | |
270 | 278 | | |
271 | 279 | | |
272 | | - | |
| 280 | + | |
273 | 281 | | |
274 | 282 | | |
275 | 283 | | |
276 | 284 | | |
| 285 | + | |
277 | 286 | | |
278 | 287 | | |
| 288 | + | |
279 | 289 | | |
280 | 290 | | |
281 | 291 | | |
| |||
296 | 306 | | |
297 | 307 | | |
298 | 308 | | |
| 309 | + | |
299 | 310 | | |
300 | 311 | | |
301 | | - | |
| 312 | + | |
302 | 313 | | |
303 | 314 | | |
304 | 315 | | |
305 | 316 | | |
| 317 | + | |
306 | 318 | | |
307 | 319 | | |
| 320 | + | |
308 | 321 | | |
309 | 322 | | |
310 | 323 | | |
| |||
325 | 338 | | |
326 | 339 | | |
327 | 340 | | |
| 341 | + | |
328 | 342 | | |
329 | 343 | | |
330 | | - | |
| 344 | + | |
331 | 345 | | |
332 | 346 | | |
333 | 347 | | |
334 | 348 | | |
| 349 | + | |
335 | 350 | | |
336 | 351 | | |
| 352 | + | |
337 | 353 | | |
338 | 354 | | |
339 | 355 | | |
| |||
0 commit comments