Commit d550448
crypto: ensure algif_hash does not pass a zero-sized state
If the algorithm passed a zero statesize, do not pass a valid pointer
into the export/import functions. Passing a valid pointer covers up
bugs in driver code which then go on to smash the kernel stack.
Instead, pass NULL, which will cause any attempt to write to the
pointer to fail.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>1 parent 479e880 commit d550448
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
| 468 | + | |
| 469 | + | |
469 | 470 | | |
470 | 471 | | |
471 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
592 | | - | |
| 592 | + | |
| 593 | + | |
593 | 594 | | |
594 | 595 | | |
595 | 596 | | |
| |||
0 commit comments