Commit b43088f
s390/zcrypt: fix warning about field-spanning write
This patch fixes the warning
memcpy: detected field-spanning write (size 60) of single field "to" at drivers/s390/crypto/zcrypt_api.h:173 (size 2)
WARNING: CPU: 1 PID: 2114 at drivers/s390/crypto/zcrypt_api.h:173 prep_ep11_ap_msg+0x2c6/0x2e0 [zcrypt]
The code has been rewritten to use a union in combination
with a flex array to clearly state which part of the buffer
the payload is to be copied in via z_copy_from_user
function (which may call memcpy() in case of in-kernel calls).
Signed-off-by: Harald Freudenberger <[email protected]>
Suggested-by: Jürgen Christ <[email protected]>
Reviewed-by: Jürgen Christ <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>1 parent e38de48 commit b43088f
1 file changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
346 | 349 | | |
347 | 350 | | |
348 | 351 | | |
| |||
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
406 | | - | |
| 409 | + | |
| 410 | + | |
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| |||
469 | 473 | | |
470 | 474 | | |
471 | 475 | | |
472 | | - | |
473 | | - | |
474 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
475 | 484 | | |
476 | 485 | | |
477 | 486 | | |
| |||
500 | 509 | | |
501 | 510 | | |
502 | 511 | | |
503 | | - | |
| 512 | + | |
504 | 513 | | |
505 | 514 | | |
506 | 515 | | |
| |||
0 commit comments