[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220520121921.4b0f2a5d@hermes.local>
Date: Fri, 20 May 2022 12:19:21 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Warnings build iproute2 with gcc-12 in xfrm
Iproute2 now gets warning in xfrm code with Gcc-12
In function ‘xfrm_algo_parse’,
inlined from ‘xfrm_state_modify.constprop’ at xfrm_state.c:573:5:
xfrm_state.c:162:32: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
162 | buf[j] = val;
| ~~~~~~~^~~~~
Fixing it properly would be hard since buf points to element in alg union which can be from xfrm.h.
I.e:
struct xfrm_algo {
char alg_name[64];
unsigned int alg_key_len; /* in bits */
char alg_key[0];
};
Looks like use of legacy zero sized arrays in uapi is the underlying root cause.
Any good suggestions on best fix here?
Powered by blists - more mailing lists