Commit a745dda
crypto: bcm - Verify GCM/CCM key length in setkey
commit 10a2f0b upstream.
The setkey function for GCM/CCM algorithms didn't verify the key
length before copying the key and subtracting the salt length.
This patch delays the copying of the key til after the verification
has been done. It also adds checks on the key length to ensure
that it's at least as long as the salt.
Fixes: 9d12ba8 ("crypto: brcm - Add Broadcom SPU driver")
Cc: <stable@vger.kernel.org>
Reported-by: kiyin(尹亮) <kiyin@tencent.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent ffdf9f8 commit a745dda
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2930 | 2930 | | |
2931 | 2931 | | |
2932 | 2932 | | |
2933 | | - | |
2934 | 2933 | | |
2935 | 2934 | | |
2936 | 2935 | | |
| |||
2946 | 2945 | | |
2947 | 2946 | | |
2948 | 2947 | | |
| 2948 | + | |
| 2949 | + | |
2949 | 2950 | | |
2950 | 2951 | | |
2951 | 2952 | | |
| |||
3000 | 3001 | | |
3001 | 3002 | | |
3002 | 3003 | | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
3003 | 3008 | | |
3004 | 3009 | | |
3005 | 3010 | | |
| |||
3028 | 3033 | | |
3029 | 3034 | | |
3030 | 3035 | | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
3031 | 3040 | | |
3032 | 3041 | | |
3033 | 3042 | | |
| |||
3057 | 3066 | | |
3058 | 3067 | | |
3059 | 3068 | | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
3060 | 3073 | | |
3061 | 3074 | | |
3062 | 3075 | | |
| |||
0 commit comments