Commit f8024f1
committed
io_uring/kbuf: don't allow registered buffer rings on highmem pages
syzbot reports that registering a mapped buffer ring on arm32 can
trigger an OOPS. Registered buffer rings have two modes, one of them
is the application passing in the memory that the buffer ring should
reside in. Once those pages are mapped, we use page_address() to get
a virtual address. This will obviously fail on highmem pages, which
aren't mapped.
Add a check if we have any highmem pages after mapping, and fail the
attempt to register a provided buffer ring if we do. This will return
the same error as kernels that don't support provided buffer rings to
begin with.
Link: https://lore.kernel.org/io-uring/[email protected]/
Fixes: c56e022 ("io_uring: add support for user mapped provided buffer ring")
Cc: [email protected]
Reported-by: [email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent a52d4f6 commit f8024f1
1 file changed
+19
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
| 480 | + | |
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
488 | 499 | | |
489 | 500 | | |
490 | 501 | | |
| |||
496 | 507 | | |
497 | 508 | | |
498 | 509 | | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
| 510 | + | |
| 511 | + | |
506 | 512 | | |
507 | 513 | | |
508 | 514 | | |
509 | 515 | | |
510 | 516 | | |
511 | 517 | | |
512 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
513 | 524 | | |
514 | 525 | | |
515 | 526 | | |
| |||
0 commit comments