Andreas Rheinhardt
73930e4f93
avutil/aes: Don't use misaligned pointers
...
The AES code uses av_aes_block, a union consisting of
uint64_t[2], uint32_t[4], uint8_t[4][4] and uint8_t[16].
subshift() performs byte-wise manipulations of two av_aes_blocks,
but when encrypting, it does so with a shift of two bytes;
more precisely, it uses
"av_aes_block *s1 = (av_aes_block *) (s0[0].u8 - s)"
and lateron uses the uint8_t[16] member to access s0.
Yet av_aes_block requires to be suitably aligned for
the uint64_t[2] member, which s0[0].u8 - 2 is certainly
not. This is in violation of 6.3.2.3 (7) of C11. UBSan
reports this in the aes_ctr, mov-3elist-encrypted,
mov-frag-encrypted, mov-tenc-only-encrypted and srtp
tests.
Furthermore, there is another issue here: The pointer points
outside of s0; this works, because all the accesses lateron
use an index >= 3. (Clang-)UBSan reports this as
"runtime error: index -2 out of bounds for type 'uint8_t[16]'".
This commit fixes both of these issues: The latter issue
is fixed by applying an offset of "+ 3" during the cast
and subtracting this from the indices used lateron.
The former issue is solved by not casting to av_aes_block*
at all; instead simply cast to unsigned char*.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 16:28:14 +02:00
..
2022-10-11 09:12:02 +02:00
2022-09-03 23:54:05 +03:00
2022-09-14 14:09:26 +02:00
2021-07-28 23:31:48 +02:00
2022-06-25 12:16:51 +02:00
2022-10-13 10:17:38 +02:00
2022-09-30 14:33:08 +02:00
2022-10-04 10:56:12 +02:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:56:47 +02:00
2022-10-24 16:28:14 +02:00
2022-10-17 09:56:47 +02:00
2022-10-10 13:43:59 +02:00
2022-03-16 12:29:37 -03:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:56:47 +02:00
2022-05-23 13:52:26 +03:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:55:19 +02:00
2022-09-13 16:50:43 -03:00
2022-02-24 12:56:49 +01:00
2022-08-10 18:49:35 +02:00
2021-09-17 13:28:09 -03:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:55:19 +02:00
2022-02-24 12:56:49 +01:00
2022-07-04 14:04:54 -03:00
2022-10-17 09:55:19 +02:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-09-27 13:19:52 +02:00
2022-10-05 08:26:19 +02:00
2022-10-05 08:26:19 +02:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:56:47 +02:00
2022-06-01 13:52:38 -04:00
2022-10-17 09:55:19 +02:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:56:47 +02:00
2021-10-08 10:11:59 +08:00
2022-10-17 09:56:47 +02:00
2022-09-03 15:41:44 +02:00
2022-09-19 23:39:58 +02:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:55:19 +02:00
2022-01-04 11:59:02 +01:00
2022-01-04 11:59:02 +01:00
2021-09-20 01:03:52 +02:00
2022-02-24 12:56:49 +01:00
2021-07-29 22:02:05 +02:00
2022-10-17 09:56:47 +02:00
2022-02-24 12:56:49 +01:00
2022-09-05 08:59:36 +02:00
2022-09-03 15:41:44 +02:00
2022-09-03 15:41:44 +02:00
2022-09-03 15:42:40 +02:00
2022-10-17 09:56:47 +02:00
2021-08-24 09:58:52 -03:00
2022-10-04 10:56:12 +02:00
2022-09-27 13:19:52 +02:00
2022-08-19 22:09:36 +02:00
2022-08-19 22:09:36 +02:00
2022-09-27 13:19:52 +02:00
2022-09-27 13:19:52 +02:00
2022-08-02 10:44:37 +02:00
2022-10-17 09:56:47 +02:00
2022-06-21 13:27:46 +03:00
2022-08-19 22:09:36 +02:00
2022-08-19 22:09:36 +02:00
2022-03-01 09:08:43 +08:00
2022-03-01 09:08:43 +08:00
2021-11-22 23:03:21 +01:00
2022-08-13 15:21:59 +02:00
2021-09-08 17:48:02 -03:00
2021-11-13 19:22:57 +01:00
2022-01-05 11:56:58 +08:00
2022-08-12 10:43:39 +08:00
2022-10-10 09:31:34 +08:00
2022-08-12 10:43:39 +08:00
2022-07-05 15:20:08 +02:00
2022-10-23 20:51:42 +02:00
2022-04-29 17:27:37 +08:00
2022-08-08 11:08:55 +08:00
2022-09-03 16:19:40 -07:00
2021-12-10 17:04:22 +01:00
2022-02-17 11:05:44 +01:00
2022-10-17 09:56:47 +02:00
2021-08-14 00:27:43 +02:00
2022-10-17 09:56:47 +02:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-09-30 14:33:08 +02:00
2022-09-13 16:50:43 -03:00
2022-10-17 09:56:47 +02:00
2022-06-15 04:56:37 +02:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2021-07-29 22:02:05 +02:00
2022-08-13 14:42:36 +02:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:51:47 +02:00
2021-10-02 17:13:57 +02:00
2022-08-24 03:43:52 +02:00
2022-07-06 22:53:15 +02:00
2022-10-17 09:51:47 +02:00
2021-12-18 11:55:47 -08:00
2022-08-03 21:09:24 +02:00
2022-03-15 09:42:29 -03:00
2022-01-12 13:42:26 +08:00
2022-10-17 09:56:47 +02:00
2022-09-30 14:33:08 +02:00
2022-09-26 03:02:25 +02:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-10-11 16:31:15 -03:00
2022-02-24 12:56:49 +01:00
2022-09-03 15:41:44 +02:00
2022-10-17 09:51:47 +02:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:56:47 +02:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:56:47 +02:00
2022-02-24 12:56:49 +01:00
2022-02-24 12:56:49 +01:00
2022-09-06 18:46:44 +03:00
2022-10-17 09:55:19 +02:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:55:19 +02:00
2022-02-24 12:56:49 +01:00
2022-10-24 02:00:31 +02:00
2022-02-24 12:56:49 +01:00
2022-04-22 22:54:58 +02:00
2022-09-13 16:50:43 -03:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:51:47 +02:00
2022-09-23 12:35:28 +02:00
2022-09-23 12:35:27 +02:00
2022-09-23 12:35:28 +02:00
2022-02-11 19:38:41 +01:00
2022-05-10 06:49:32 +02:00
2022-06-12 18:34:28 +10:00
2022-10-17 09:56:47 +02:00
2022-03-17 11:11:17 +02:00
2022-05-10 06:49:32 +02:00
2022-10-11 16:31:15 -03:00
2022-02-24 12:56:49 +01:00
2022-01-27 10:27:09 +01:00
2021-11-19 16:47:48 +01:00
2021-11-18 06:40:52 +01:00
2021-11-19 16:47:30 +01:00
2022-02-22 06:30:12 +01:00
2021-11-19 16:47:28 +01:00
2022-06-28 10:59:31 +02:00
2022-02-24 12:56:49 +01:00