Commit df745e2
committed
tpm: Lazily flush the auth session
Move the allocation of chip->auth to tpm2_start_auth_session() so that this
field can be used as flag to tell whether auth session is active or not.
Instead of flushing and reloading the auth session for every transaction
separately, keep the session open unless /dev/tpm0 is used.
Reported-by: Pengyu Ma <[email protected]>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219229
Cc: [email protected] # v6.10+
Fixes: 7ca110f ("tpm: Address !chip->auth in tpm_buf_append_hmac_session*()")
Tested-by: Pengyu Ma <[email protected]>
Tested-by: Stefan Berger <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>1 parent cc7d859 commit df745e2
File tree
4 files changed
+44
-20
lines changed- drivers/char/tpm
4 files changed
+44
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
677 | 687 | | |
678 | 688 | | |
679 | 689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
| 383 | + | |
383 | 384 | | |
384 | | - | |
| 385 | + | |
385 | 386 | | |
| 387 | + | |
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
| |||
484 | 487 | | |
485 | 488 | | |
486 | 489 | | |
487 | | - | |
| 490 | + | |
| 491 | + | |
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
| |||
543 | 547 | | |
544 | 548 | | |
545 | 549 | | |
546 | | - | |
| 550 | + | |
547 | 551 | | |
548 | 552 | | |
549 | 553 | | |
| |||
554 | 558 | | |
555 | 559 | | |
556 | 560 | | |
557 | | - | |
558 | | - | |
| 561 | + | |
559 | 562 | | |
560 | 563 | | |
561 | 564 | | |
| |||
853 | 856 | | |
854 | 857 | | |
855 | 858 | | |
856 | | - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
857 | 862 | | |
858 | 863 | | |
859 | 864 | | |
| |||
881 | 886 | | |
882 | 887 | | |
883 | 888 | | |
884 | | - | |
| 889 | + | |
| 890 | + | |
885 | 891 | | |
886 | 892 | | |
887 | 893 | | |
| |||
962 | 968 | | |
963 | 969 | | |
964 | 970 | | |
| 971 | + | |
965 | 972 | | |
966 | | - | |
967 | | - | |
968 | 973 | | |
| 974 | + | |
969 | 975 | | |
970 | | - | |
971 | | - | |
| 976 | + | |
| 977 | + | |
972 | 978 | | |
973 | 979 | | |
974 | 980 | | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
975 | 985 | | |
976 | 986 | | |
977 | 987 | | |
| |||
992 | 1002 | | |
993 | 1003 | | |
994 | 1004 | | |
995 | | - | |
| 1005 | + | |
996 | 1006 | | |
997 | 1007 | | |
998 | 1008 | | |
| |||
1014 | 1024 | | |
1015 | 1025 | | |
1016 | 1026 | | |
1017 | | - | |
1018 | | - | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1019 | 1031 | | |
1020 | | - | |
| 1032 | + | |
| 1033 | + | |
1021 | 1034 | | |
1022 | 1035 | | |
1023 | 1036 | | |
| |||
1367 | 1380 | | |
1368 | 1381 | | |
1369 | 1382 | | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | 1383 | | |
1375 | 1384 | | |
1376 | 1385 | | |
| |||
0 commit comments