kernel_optimize_test/net
Martin KaFai Lau 8e7ae2518f bpf: Sanitize the bpf_struct_ops tcp-cc name
The bpf_struct_ops tcp-cc name should be sanitized in order to
avoid problematic chars (e.g. whitespaces).

This patch reuses the bpf_obj_name_cpy() for accepting the same set
of characters in order to keep a consistent bpf programming experience.
A "size" param is added.  Also, the strlen is returned on success so
that the caller (like the bpf_tcp_ca here) can error out on empty name.
The existing callers of the bpf_obj_name_cpy() only need to change the
testing statement to "if (err < 0)".  For all these existing callers,
the err will be overwritten later, so no extra change is needed
for the new strlen return value.

v3:
  - reverse xmas tree style
v2:
  - Save the orig_src to avoid "end - size" (Andrii)

Fixes: 0baf26b0fc ("bpf: tcp: Support tcp_congestion_ops in bpf")
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200314010209.1131542-1-kafai@fb.com
2020-03-17 20:40:19 +01:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth
bpf
bpfilter net/bpfilter: fix dprintf usage for /dev/kmsg 2020-03-14 20:58:10 -07:00
bridge
caif net: caif: Add lockdep expression to RCU traversal primitive 2020-03-11 22:55:25 -07:00
can
ceph
core Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2020-03-13 11:13:45 -07:00
dcb
dccp
decnet
dns_resolver
dsa net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed 2020-03-11 23:46:11 -07:00
ethernet
ethtool ethtool: reject unrecognized request flags 2020-03-16 02:04:24 -07:00
hsr hsr: set .netnsok flag 2020-03-16 01:46:09 -07:00
ieee802154 nl802154: add missing attribute validation for dev_type 2020-03-03 13:28:48 -08:00
ife
ipv4 bpf: Sanitize the bpf_struct_ops tcp-cc name 2020-03-17 20:40:19 +01:00
ipv6 seg6: fix SRv6 L2 tunnels to use IANA-assigned protocol number 2020-03-11 23:49:30 -07:00
iucv
kcm
key
l2tp
l3mdev
lapb
llc
mac80211 mac80211: Do not send mesh HWMP PREQ if HWMP is disabled 2020-03-11 09:04:14 +01:00
mac802154
mpls
mptcp mptcp: always include dack if possible. 2020-03-05 21:34:42 -08:00
ncsi
netfilter netfilter: nft_chain_nat: inet family is missing module ownership 2020-03-06 18:00:43 +01:00
netlabel
netlink netlink: allow extack cookie also for error messages 2020-03-16 02:04:24 -07:00
netrom
nfc net: nfc: fix bounds checking bugs on "pipe" 2020-03-05 21:32:42 -08:00
nsh
openvswitch openvswitch: add missing attribute validation for hash 2020-03-03 13:28:48 -08:00
packet net/packet: tpacket_rcv: avoid a producer race condition 2020-03-15 00:25:25 -07:00
phonet
psample
qrtr
rds
rfkill
rose
rxrpc
sched net_sched: cls_route: remove the right filter from hashtable 2020-03-16 01:59:32 -07:00
sctp inet_diag: return classid for all socket types 2020-03-08 21:57:48 -07:00
smc net/smc: cancel event worker during device removal 2020-03-10 15:40:33 -07:00
strparser
sunrpc
switchdev
tipc tipc: add missing attribute validation for MTU property 2020-03-03 13:28:49 -08:00
tls
unix
vmw_vsock
wimax
wireless nl80211: add missing attribute validation for channel switch 2020-03-11 08:58:39 +01:00
x25
xdp
xfrm
compat.c
Kconfig
Makefile
socket.c
sysctl_net.c