linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] netlink: Bounds-check struct nlmsgerr creation
@ 2022-09-01  3:06 Kees Cook
  2022-09-01  3:06 ` [PATCH 1/2] netlink: Bounds-check nlmsg_len() Kees Cook
  2022-09-01  3:06 ` [PATCH 2/2] netlink: Bounds-check struct nlmsgerr creation Kees Cook
  0 siblings, 2 replies; 8+ messages in thread
From: Kees Cook @ 2022-09-01  3:06 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Kees Cook, Pablo Neira Ayuso, David S. Miller, Eric Dumazet,
	Paolo Abeni, Jozsef Kadlecsik, Florian Westphal, syzbot,
	Yajun Deng, Oliver Hartkopp, Harshit Mogalapalli, linux-kernel,
	netdev, netfilter-devel, coreteam, linux-hardening

Hi,

In order to avoid triggering the coming runtime memcpy() bounds checking,
the length of the destination needs to be "visible" to the compiler in
some way. However, netlink is constructed in a rather hidden fashion,
and my attempts to wrangle it have resulted in this series, which perform
explicit bounds checking before using unsafe_memcpy().

-Kees

Kees Cook (2):
  netlink: Bounds-check nlmsg_len()
  netlink: Bounds-check struct nlmsgerr creation

 include/net/netlink.h             | 10 ++++++-
 net/netfilter/ipset/ip_set_core.c | 10 +++++--
 net/netlink/af_netlink.c          | 49 +++++++++++++++++++++----------
 3 files changed, 49 insertions(+), 20 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-09-01 20:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-01  3:06 [PATCH 0/2] netlink: Bounds-check struct nlmsgerr creation Kees Cook
2022-09-01  3:06 ` [PATCH 1/2] netlink: Bounds-check nlmsg_len() Kees Cook
2022-09-01  3:18   ` Jakub Kicinski
2022-09-01  6:27     ` Kees Cook
2022-09-01 19:49       ` Jakub Kicinski
2022-09-01 20:54         ` Eric Dumazet
2022-09-01  3:06 ` [PATCH 2/2] netlink: Bounds-check struct nlmsgerr creation Kees Cook
2022-09-01  3:20   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).