Commit 3ac2939
crypto: s390/phmac - Do not modify the req->nbytes value
The phmac implementation used the req->nbytes field on combined
operations (finup, digest) to track the state:
with req->nbytes > 0 the update needs to be processed,
while req->nbytes == 0 means to do the final operation. For
this purpose the req->nbytes field was set to 0 after successful
update operation. However, aead uses the req->nbytes field after a
successful hash operation to determine the amount of data to
en/decrypt. So an implementation must not modify the nbytes field.
Fixed by a slight rework on the phmac implementation. There is
now a new field async_op in the request context which tracks
the (asynch) operation to process. So the 'state' via req->nbytes
is not needed any more and now this field is untouched and may
be evaluated even after a request is processed by the phmac
implementation.
Fixes: cbbc675 ("crypto: s390 - New s390 specific protected key hash phmac")
Reported-by: Ingo Franzki <[email protected]>
Signed-off-by: Harald Freudenberger <[email protected]>
Tested-by: Ingo Franzki <[email protected]>
Reviewed-by: Ingo Franzki <[email protected]>
Reviewed-by: Holger Dengler <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>1 parent 3a86608 commit 3ac2939
1 file changed
Lines changed: 34 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
176 | | - | |
| 183 | + | |
177 | 184 | | |
178 | 185 | | |
179 | 186 | | |
| |||
610 | 617 | | |
611 | 618 | | |
612 | 619 | | |
| 620 | + | |
613 | 621 | | |
614 | 622 | | |
615 | 623 | | |
| |||
647 | 655 | | |
648 | 656 | | |
649 | 657 | | |
650 | | - | |
651 | | - | |
| 658 | + | |
652 | 659 | | |
653 | 660 | | |
654 | 661 | | |
| |||
676 | 683 | | |
677 | 684 | | |
678 | 685 | | |
| 686 | + | |
| 687 | + | |
679 | 688 | | |
680 | 689 | | |
681 | 690 | | |
682 | 691 | | |
683 | | - | |
| 692 | + | |
684 | 693 | | |
685 | | - | |
| 694 | + | |
| 695 | + | |
686 | 696 | | |
687 | 697 | | |
688 | 698 | | |
| |||
694 | 704 | | |
695 | 705 | | |
696 | 706 | | |
697 | | - | |
| 707 | + | |
698 | 708 | | |
699 | 709 | | |
700 | 710 | | |
| |||
855 | 865 | | |
856 | 866 | | |
857 | 867 | | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
864 | 873 | | |
865 | 874 | | |
866 | | - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
867 | 878 | | |
868 | 879 | | |
869 | 880 | | |
| |||
880 | 891 | | |
881 | 892 | | |
882 | 893 | | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
887 | 899 | | |
888 | 900 | | |
889 | 901 | | |
| |||
897 | 909 | | |
898 | 910 | | |
899 | 911 | | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
900 | 916 | | |
901 | 917 | | |
902 | 918 | | |
903 | | - | |
| 919 | + | |
904 | 920 | | |
905 | 921 | | |
906 | 922 | | |
| |||
0 commit comments