Jessica Clarke a34d3ca6ef re: Avoid subobject overread when setting IDRn
IDR0-IDR5 can be read byte-by-byte but must be written to as 4-byte
words. The current code to do this is rather clunky and ends up reading
past the end of the union's eaddr member due to MAC addresses only being
6 bytes. In practice this ends up being fine because the align_dummy
member will pad the union to a multiple of 4 bytes, but this is dodgy,
and on CHERI with subobject bounds enforcement enabled, as is done in
CheriBSD's pure-capability kernel, will trap.

Instead, make the buffer in use the right size, just use an array of
uint32_t's rather than a char buffer that's then cast to uint32_t * to
simplify it in the process, and zero-initialise it first to avoid
reading uninitialised data in the trailing bytes.

Found by:	CHERI
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D33617
2021-12-23 20:19:31 +00:00
..
2021-12-10 11:48:42 +00:00
2021-12-10 11:45:36 +00:00
2020-10-02 18:18:01 +00:00
2021-12-10 12:02:05 +00:00
2021-12-03 23:29:51 -07:00
2021-12-14 14:59:09 +00:00
2021-09-03 13:51:08 -04:00
2021-11-18 23:05:32 -07:00
2020-02-03 17:35:11 +00:00
2021-04-27 19:07:33 +02:00
2021-01-13 18:43:51 +01:00
2021-09-16 16:47:45 +02:00
2021-12-09 16:37:26 +00:00
2021-10-02 10:43:41 +02:00
2021-12-06 11:28:01 +01:00
2021-11-25 11:25:11 +00:00
2020-07-01 00:33:16 +00:00
2020-02-03 17:35:11 +00:00
2021-12-04 11:07:04 -07:00
2021-11-25 00:45:12 -07:00
2021-11-23 14:09:29 -08:00
2021-12-16 13:23:30 +00:00
2021-12-09 20:21:16 +00:00
2021-11-24 11:54:08 -08:00
2020-08-31 15:03:23 +00:00
2020-09-18 16:48:08 +00:00
2020-02-07 19:53:07 +00:00
2019-10-21 18:07:11 +00:00
2020-11-19 03:59:21 +00:00
2021-12-09 17:04:57 -07:00
2021-11-29 17:02:01 +01:00
2021-08-10 20:44:27 -04:00
2021-12-03 11:06:58 +01:00
2021-12-10 11:53:38 +00:00
2021-12-18 23:43:00 +01:00
2021-01-07 17:05:30 -07:00
2021-11-18 23:05:32 -07:00
2021-12-14 14:24:21 +00:00
2020-10-05 19:58:55 +00:00
2021-12-14 14:08:35 +00:00
2019-10-21 18:07:40 +00:00
2021-12-14 14:31:10 +00:00
2021-12-14 14:08:17 +00:00
2021-12-06 11:27:59 +01:00
2021-08-16 06:28:33 +02:00
2021-09-30 14:16:19 -06:00
2021-09-02 22:25:16 -04:00
2021-12-14 14:12:35 +00:00
2021-10-02 10:47:21 +02:00
2021-12-06 11:28:03 +01:00