Commit 5af0864
fbcon: Fix global-out-of-bounds read in fbcon_get_font()
fbcon_get_font() is reading out-of-bounds. A malicious user may resize
`vc->vc_font.height` to a large value, causing fbcon_get_font() to
read out of `fontdata`.
fbcon_get_font() handles both built-in and user-provided fonts.
Fortunately, recently we have added FONT_EXTRA_WORDS support for built-in
fonts, so fix it by adding range checks using FNTSIZE().
This patch depends on patch "fbdev, newport_con: Move FONT_EXTRA_WORDS
macros into linux/font.h", and patch "Fonts: Support FONT_EXTRA_WORDS
macros for built-in fonts".
Cc: stable@vger.kernel.org
Reported-and-tested-by: syzbot+29d4ed7f3bdedf2aa2fd@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=08b8be45afea11888776f897895aef9ad1c3ecfd
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/b34544687a1a09d6de630659eb7a773f4953238b.1600953813.git.yepeilin.cs@gmail.com1 parent 6735b46 commit 5af0864
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2471 | 2471 | | |
2472 | 2472 | | |
2473 | 2473 | | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
2474 | 2477 | | |
2475 | 2478 | | |
2476 | 2479 | | |
| |||
2479 | 2482 | | |
2480 | 2483 | | |
2481 | 2484 | | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
2482 | 2488 | | |
2483 | 2489 | | |
2484 | 2490 | | |
2485 | 2491 | | |
2486 | 2492 | | |
2487 | 2493 | | |
2488 | 2494 | | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
2489 | 2498 | | |
2490 | 2499 | | |
2491 | 2500 | | |
| |||
2498 | 2507 | | |
2499 | 2508 | | |
2500 | 2509 | | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
2501 | 2513 | | |
2502 | 2514 | | |
2503 | 2515 | | |
| |||
0 commit comments