Commit 6735b46
Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts
syzbot has reported an issue in the framebuffer layer, where a malicious
user may overflow our built-in font data buffers.
In order to perform a reliable range check, subsystems need to know
`FONTDATAMAX` for each built-in font. Unfortunately, our font descriptor,
`struct console_font` does not contain `FONTDATAMAX`, and is part of the
UAPI, making it infeasible to modify it.
For user-provided fonts, the framebuffer layer resolves this issue by
reserving four extra words at the beginning of data buffers. Later,
whenever a function needs to access them, it simply uses the following
macros:
Recently we have gathered all the above macros to <linux/font.h>. Let us
do the same thing for built-in fonts, prepend four extra words (including
`FONTDATAMAX`) to their data buffers, so that subsystems can use these
macros for all fonts, no matter built-in or user-provided.
This patch depends on patch "fbdev, newport_con: Move FONT_EXTRA_WORDS
macros into linux/font.h".
Cc: stable@vger.kernel.org
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/ef18af00c35fb3cc826048a5f70924ed6ddce95b.1600953813.git.yepeilin.cs@gmail.com1 parent bb0890b commit 6735b46
13 files changed
Lines changed: 56 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
5129 | 5129 | | |
5130 | 5130 | | |
5131 | 5131 | | |
5132 | | - | |
5133 | | - | |
| 5132 | + | |
5134 | 5133 | | |
5135 | 5134 | | |
5136 | 5135 | | |
5137 | 5136 | | |
5138 | 5137 | | |
5139 | 5138 | | |
5140 | 5139 | | |
5141 | | - | |
| 5140 | + | |
5142 | 5141 | | |
5143 | 5142 | | |
5144 | 5143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
3074 | 3076 | | |
3075 | 3077 | | |
3076 | 3078 | | |
3077 | | - | |
3078 | | - | |
| 3079 | + | |
3079 | 3080 | | |
3080 | 3081 | | |
3081 | 3082 | | |
3082 | 3083 | | |
3083 | 3084 | | |
3084 | 3085 | | |
3085 | | - | |
| 3086 | + | |
3086 | 3087 | | |
3087 | 3088 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
3338 | 3338 | | |
3339 | 3339 | | |
3340 | 3340 | | |
3341 | | - | |
3342 | | - | |
| 3341 | + | |
3343 | 3342 | | |
3344 | 3343 | | |
3345 | 3344 | | |
3346 | 3345 | | |
3347 | 3346 | | |
3348 | 3347 | | |
3349 | 3348 | | |
3350 | | - | |
| 3349 | + | |
3351 | 3350 | | |
3352 | 3351 | | |
3353 | 3352 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
4105 | 4105 | | |
4106 | 4106 | | |
4107 | 4107 | | |
4108 | | - | |
4109 | | - | |
| 4108 | + | |
4110 | 4109 | | |
4111 | 4110 | | |
4112 | 4111 | | |
4113 | 4112 | | |
4114 | 4113 | | |
4115 | 4114 | | |
4116 | 4115 | | |
4117 | | - | |
| 4116 | + | |
4118 | 4117 | | |
4119 | 4118 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
4619 | 4619 | | |
4620 | 4620 | | |
4621 | 4621 | | |
4622 | | - | |
4623 | | - | |
| 4622 | + | |
4624 | 4623 | | |
4625 | 4624 | | |
4626 | 4625 | | |
4627 | 4626 | | |
4628 | 4627 | | |
4629 | 4628 | | |
4630 | 4629 | | |
4631 | | - | |
| 4630 | + | |
4632 | 4631 | | |
4633 | 4632 | | |
4634 | 4633 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
2570 | 2570 | | |
2571 | 2571 | | |
2572 | 2572 | | |
2573 | | - | |
2574 | | - | |
| 2573 | + | |
2575 | 2574 | | |
2576 | 2575 | | |
2577 | 2576 | | |
2578 | 2577 | | |
2579 | 2578 | | |
2580 | 2579 | | |
2581 | 2580 | | |
2582 | | - | |
| 2581 | + | |
2583 | 2582 | | |
2584 | 2583 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
260 | 263 | | |
261 | 264 | | |
262 | 265 | | |
263 | | - | |
| 266 | + | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
270 | | - | |
| 273 | + | |
271 | 274 | | |
272 | 275 | | |
273 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
2145 | 2145 | | |
2146 | 2146 | | |
2147 | 2147 | | |
2148 | | - | |
| 2148 | + | |
2149 | 2149 | | |
2150 | 2150 | | |
2151 | 2151 | | |
2152 | 2152 | | |
2153 | 2153 | | |
2154 | 2154 | | |
2155 | | - | |
| 2155 | + | |
2156 | 2156 | | |
2157 | 2157 | | |
2158 | 2158 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
2575 | 2575 | | |
2576 | 2576 | | |
2577 | 2577 | | |
2578 | | - | |
2579 | | - | |
| 2578 | + | |
2580 | 2579 | | |
2581 | 2580 | | |
2582 | 2581 | | |
2583 | 2582 | | |
2584 | 2583 | | |
2585 | 2584 | | |
2586 | | - | |
| 2585 | + | |
2587 | 2586 | | |
2588 | 2587 | | |
0 commit comments