From 73c38454383e0daeb72d08b990e49bf4bd42ba87 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 18 Dec 2019 14:44:12 +0100 Subject: pkg/compiler: fix incorrect alignment calculation for padding We assumed that for ConstType alignment is equal to size, which is perfectly reasonable for normal int8/16/32/64/ptr. However, padding is also represented by ConstType of arbitrary size, so if we added 157 bytes of padding that becomes alignment of the padding field and as the result of the whole struct. This affects very few structs, but quite radically and quite important structs. Discovered thanks to syz-check. Update #590 --- sys/linux/socket_rose.txt.warn | 4 ---- 1 file changed, 4 deletions(-) (limited to 'sys/linux/socket_rose.txt.warn') diff --git a/sys/linux/socket_rose.txt.warn b/sys/linux/socket_rose.txt.warn index b7cc9d57d..af32e96c4 100644 --- a/sys/linux/socket_rose.txt.warn +++ b/sys/linux/socket_rose.txt.warn @@ -1,7 +1,3 @@ struct rose_address: bad number of fields: syz=2 kernel=1 struct rose_address_remote: no corresponding struct in kernel struct rose_address_dev: no corresponding struct in kernel -struct rose_route_struct: bad size: syz=108 kernel=88 -field rose_route_struct.device: bad offset: syz=24 kernel=15 -field rose_route_struct.ndigis: bad offset: syz=40 kernel=31 -field rose_route_struct.digipeaters: bad offset: syz=41 kernel=32 -- cgit mrf-deployment