]> Git Repo - linux.git/commit
decnet: Use container_of() for struct dn_neigh casts
authorKees Cook <[email protected]>
Sun, 8 May 2022 10:22:17 +0000 (03:22 -0700)
committerPaolo Abeni <[email protected]>
Tue, 10 May 2022 10:21:51 +0000 (12:21 +0200)
commitdc5306a8c0eace6c113aded2e36ae5e15fdca4d7
tree9871932c6b1920bdf99797282deb89d92f2de435
parent1809c30b6e5a83a1de1435fe01aaa4de4d626a7c
decnet: Use container_of() for struct dn_neigh casts

Clang's structure layout randomization feature gets upset when it sees
struct neighbor (which is randomized) cast to struct dn_neigh:

net/decnet/dn_route.c:1123:15: error: casting from randomized structure pointer type 'struct neighbour *' to 'struct dn_neigh *'
gateway = ((struct dn_neigh *)neigh)->addr;
   ^

Update all the open-coded casts to use container_of() to do the conversion
instead of depending on strict member ordering.

Reported-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Cc: "David S. Miller" <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Yajun Deng <[email protected]>
Cc: Zheng Yongjun <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
net/decnet/dn_dev.c
net/decnet/dn_neigh.c
net/decnet/dn_route.c
This page took 0.053499 seconds and 4 git commands to generate.