Commit 5634c90
printk: nbcon: Add buffer management
In case of hostile takeovers it must be ensured that the previous
owner cannot scribble over the output buffer of the emergency/panic
context. This is achieved by:
- Adding a global output buffer instance for the panic context.
This is the only situation where hostile takeovers can occur and
there is always at most 1 panic context.
- Allocating an output buffer per non-boot console upon console
registration. This buffer is used by the console owner when not
in panic context. (For boot consoles, the existing shared global
legacy output buffer is used instead. Boot console printing will
be synchronized with legacy console printing.)
- Choosing the appropriate buffer is handled in the acquire/release
functions.
Co-developed-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Thomas Gleixner (Intel) <tglx@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20230916192007.608398-5-john.ogness@linutronix.de1 parent d818b56 commit 5634c90
File tree
4 files changed
+99
-15
lines changed- include/linux
- kernel/printk
4 files changed
+99
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| 245 | + | |
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
| |||
271 | 276 | | |
272 | 277 | | |
273 | 278 | | |
| 279 | + | |
274 | 280 | | |
275 | 281 | | |
276 | 282 | | |
| |||
293 | 299 | | |
294 | 300 | | |
295 | 301 | | |
| 302 | + | |
296 | 303 | | |
297 | 304 | | |
298 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
| |||
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| 72 | + | |
66 | 73 | | |
67 | | - | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| 91 | + | |
84 | 92 | | |
85 | | - | |
| 93 | + | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| |||
459 | 464 | | |
460 | 465 | | |
461 | 466 | | |
| 467 | + | |
| 468 | + | |
462 | 469 | | |
463 | 470 | | |
464 | 471 | | |
| |||
473 | 480 | | |
474 | 481 | | |
475 | 482 | | |
| 483 | + | |
476 | 484 | | |
477 | 485 | | |
478 | 486 | | |
| |||
491 | 499 | | |
492 | 500 | | |
493 | 501 | | |
494 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
495 | 514 | | |
496 | 515 | | |
497 | 516 | | |
| |||
530 | 549 | | |
531 | 550 | | |
532 | 551 | | |
533 | | - | |
| 552 | + | |
534 | 553 | | |
535 | 554 | | |
536 | 555 | | |
| |||
542 | 561 | | |
543 | 562 | | |
544 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
545 | 596 | | |
546 | 597 | | |
547 | 598 | | |
548 | 599 | | |
549 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
550 | 604 | | |
551 | 605 | | |
552 | 606 | | |
553 | 607 | | |
554 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
555 | 612 | | |
556 | 613 | | |
557 | 614 | | |
558 | 615 | | |
559 | | - | |
560 | | - | |
| 616 | + | |
| 617 | + | |
561 | 618 | | |
562 | | - | |
| 619 | + | |
563 | 620 | | |
564 | 621 | | |
565 | 622 | | |
566 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
567 | 630 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3331 | 3331 | | |
3332 | 3332 | | |
3333 | 3333 | | |
3334 | | - | |
3335 | | - | |
3336 | | - | |
3337 | | - | |
3338 | | - | |
3339 | | - | |
3340 | 3334 | | |
3341 | 3335 | | |
3342 | 3336 | | |
| |||
3450 | 3444 | | |
3451 | 3445 | | |
3452 | 3446 | | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
3453 | 3456 | | |
3454 | 3457 | | |
3455 | 3458 | | |
| |||
3477 | 3480 | | |
3478 | 3481 | | |
3479 | 3482 | | |
3480 | | - | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
3481 | 3486 | | |
| 3487 | + | |
3482 | 3488 | | |
3483 | 3489 | | |
3484 | 3490 | | |
| |||
3589 | 3595 | | |
3590 | 3596 | | |
3591 | 3597 | | |
3592 | | - | |
| 3598 | + | |
3593 | 3599 | | |
3594 | 3600 | | |
3595 | 3601 | | |
| |||
0 commit comments