Commit 3bfbf5f
crypto: krb5enc - fix async decrypt skipping hash verification
krb5enc_dispatch_decrypt() sets req->base.complete as the skcipher
callback, which is the caller's own completion handler. When the
skcipher completes asynchronously, this signals "done" to the caller
without executing krb5enc_dispatch_decrypt_hash(), completely bypassing
the integrity verification (hash check).
Compare with the encrypt path which correctly uses
krb5enc_encrypt_done as an intermediate callback to chain into the
hash computation on async completion.
Fix by adding krb5enc_decrypt_done as an intermediate callback that
chains into krb5enc_dispatch_decrypt_hash() upon async skcipher
completion, matching the encrypt path's callback pattern.
Also fix EBUSY/EINPROGRESS handling throughout: remove
krb5enc_request_complete() which incorrectly swallowed EINPROGRESS
notifications that must be passed up to callers waiting on backlogged
requests, and add missing EBUSY checks in krb5enc_encrypt_ahash_done
for the dispatch_encrypt return value.
Fixes: d1775a1 ("crypto: Add 'krb5enc' hash and cipher AEAD algorithm")
Signed-off-by: Dudu Lu <phx0fer@gmail.com>
Unset MAY_BACKLOG on the async completion path so the user won't
see back-to-back EINPROGRESS notifications.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>1 parent 5aa58c3 commit 3bfbf5f
1 file changed
Lines changed: 31 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 42 | | |
49 | 43 | | |
50 | 44 | | |
| |||
127 | 121 | | |
128 | 122 | | |
129 | 123 | | |
130 | | - | |
| 124 | + | |
131 | 125 | | |
132 | 126 | | |
133 | 127 | | |
| |||
188 | 182 | | |
189 | 183 | | |
190 | 184 | | |
191 | | - | |
| 185 | + | |
192 | 186 | | |
193 | 187 | | |
194 | 188 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
199 | 195 | | |
200 | 196 | | |
201 | 197 | | |
| |||
265 | 261 | | |
266 | 262 | | |
267 | 263 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
273 | 267 | | |
274 | 268 | | |
275 | 269 | | |
276 | 270 | | |
277 | 271 | | |
278 | | - | |
| 272 | + | |
| 273 | + | |
279 | 274 | | |
280 | 275 | | |
281 | 276 | | |
| |||
291 | 286 | | |
292 | 287 | | |
293 | 288 | | |
294 | | - | |
| 289 | + | |
295 | 290 | | |
296 | 291 | | |
297 | 292 | | |
| |||
301 | 296 | | |
302 | 297 | | |
303 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
304 | 314 | | |
305 | 315 | | |
306 | 316 | | |
| |||
324 | 334 | | |
325 | 335 | | |
326 | 336 | | |
327 | | - | |
| 337 | + | |
328 | 338 | | |
329 | 339 | | |
330 | 340 | | |
| |||
339 | 349 | | |
340 | 350 | | |
341 | 351 | | |
342 | | - | |
| 352 | + | |
343 | 353 | | |
344 | 354 | | |
345 | 355 | | |
| |||
0 commit comments