linux-stable/net
Florian Westphal 109539c9ba netfilter: nf_tables: fix null deref due to zeroed list head
commit 580077855a upstream.

In nf_tables_updtable, if nf_tables_table_enable returns an error,
nft_trans_destroy is called to free the transaction object.

nft_trans_destroy() calls list_del(), but the transaction was never
placed on a list -- the list head is all zeroes, this results in
a null dereference:

BUG: KASAN: null-ptr-deref in nft_trans_destroy+0x26/0x59
Call Trace:
 nft_trans_destroy+0x26/0x59
 nf_tables_newtable+0x4bc/0x9bc
 [..]

Its sane to assume that nft_trans_destroy() can be called
on the transaction object returned by nft_trans_alloc(), so
make sure the list head is initialised.

Fixes: 55dd6f9307 ("netfilter: nf_tables: use new transaction infrastructure to handle table")
Reported-by: mingi cho <mgcho.minic@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-17 15:13:59 +02:00
..
6lowpan
9p xen: switch gnttab_end_foreign_access() to take a struct page pointer 2022-05-27 11:05:29 +02:00
802
8021q vlan: fix memory leak in vlan_newlink() 2022-07-09 12:26:59 +01:00
appletalk
atm
ax25 net: ax25: Fix deadlock caused by skb_recv_datagram in ax25_recvmsg 2022-06-15 13:00:22 +01:00
batman-adv net: wrap the wireless pointers in struct net_device in an ifdef 2022-05-22 21:51:54 +01:00
bluetooth Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put 2022-07-26 13:35:24 -07:00
bpf Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-05-23 16:07:14 -07:00
bpfilter
bridge bridge: Do not send empty IFLA_AF_SPEC attribute 2022-07-26 15:35:53 +02:00
caif caif: Fix bitmap data type in "struct caifsock" 2022-07-22 12:51:45 +01:00
can can: bcm: use call_rcu() instead of costly synchronize_rcu() 2022-07-04 10:33:39 +02:00
ceph libceph: use swap() macro instead of taking tmp variable 2022-05-25 20:45:13 +02:00
core tcp: Fix data-races around sysctl knobs related to SYN option. 2022-07-20 10:14:49 +01:00
dcb
dccp Revert "net: Add a second bind table hashed by port and address" 2022-06-16 11:07:59 -07:00
decnet net: Fix data-races around sysctl_[rw]mem(_offset)?. 2022-07-25 12:42:09 +01:00
dns_resolver
dsa net: dsa: fix reference counting for LAG FDBs 2022-07-25 19:37:06 -07:00
ethernet
ethtool ethtool: Fix get module eeprom fallback 2022-06-17 20:22:16 -07:00
hsr
ieee802154
ife
ipv4 tcp: md5: fix IPv4-mapped support 2022-07-27 10:18:21 -07:00
ipv6 net: ping6: Fix memleak in ipv6_renew_options(). 2022-07-28 10:42:08 -07:00
iucv
kcm
key Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec 2022-06-01 17:44:04 -07:00
l2tp ipv6: Fix signed integer overflow in l2tp_ip6_sendmsg 2022-06-08 10:56:43 -07:00
l3mdev
lapb
llc
mac80211 wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop() 2022-07-26 13:23:05 -07:00
mac802154
mctp Networking changes for 5.19. 2022-05-25 12:22:58 -07:00
mpls
mptcp mptcp: Do not return EINPROGRESS when subflow creation succeeds 2022-07-26 19:57:55 -07:00
ncsi net/ncsi: use proper "mellanox" DT vendor prefix 2022-06-23 20:51:06 -07:00
netfilter netfilter: nf_tables: fix null deref due to zeroed list head 2022-08-17 15:13:59 +02:00
netlabel
netlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-12 16:15:30 -07:00
netrom
nfc net: nfc: Directly use ida_alloc()/free() 2022-05-28 15:28:47 +01:00
nsh
openvswitch net: openvswitch: fix parsing of nw_proto for IPv6 fragments 2022-06-23 11:44:01 +02:00
packet net/af_packet: make sure to pull mac header 2022-06-02 10:15:05 -07:00
phonet
psample
qrtr
rds Linux 5.18 2022-05-24 12:40:28 -03:00
rfkill
rose net: rose: fix UAF bug caused by rose_t0timer_expiry 2022-07-06 19:49:11 -07:00
rxrpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-23 21:19:17 -07:00
sched net/sched: cls_api: Fix flow action initialization 2022-07-20 10:54:27 +01:00
sctp sctp: leave the err path free in sctp_stream_init to sctp_stream_free 2022-07-27 18:23:22 -07:00
smc tcp: Fix data-races around keepalive sysctl knobs. 2022-07-18 12:21:54 +01:00
strparser
sunrpc Notable regression fixes: 2022-07-02 11:20:56 -07:00
switchdev
tipc net: Fix data-races around sysctl_[rw]mem(_offset)?. 2022-07-25 12:42:09 +01:00
tls net/tls: Remove the context from the list in tls_device_down 2022-07-24 21:40:56 +01:00
unix af_unix: Fix a data-race in unix_dgram_peer_wake_me(). 2022-06-07 12:07:46 +02:00
vmw_vsock hyperv-next for 5.19 2022-05-28 11:39:01 -07:00
wireless wifi: cfg80211: Allow P2P client interface to indicate port authorization 2022-06-29 11:43:15 +02:00
x25
xdp xsk: Clear page contiguity bit when unmapping pool 2022-06-28 22:49:04 +02:00
xfrm Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec 2022-07-20 10:11:58 +01:00
compat.c
devres.c
Kconfig
Kconfig.debug net: CONFIG_DEBUG_NET depends on CONFIG_NET 2022-06-02 10:15:05 -07:00
Makefile
socket.c net: clear msg_get_inq in __sys_recvfrom() and __copy_msghdr_from_user() 2022-06-23 20:56:23 -07:00
sysctl_net.c