linux-kernelorg-stable/net
Casey Schaufler 6fba89813c lsm: ensure the correct LSM context releaser
Add a new lsm_context data structure to hold all the information about a
"security context", including the string, its size and which LSM allocated
the string. The allocation information is necessary because LSMs have
different policies regarding the lifecycle of these strings. SELinux
allocates and destroys them on each use, whereas Smack provides a pointer
to an entry in a list that never goes away.

Update security_release_secctx() to use the lsm_context instead of a
(char *, len) pair. Change its callers to do likewise.  The LSMs
supporting this hook have had comments added to remind the developer
that there is more work to be done.

The BPF security module provides all LSM hooks. While there has yet to
be a known instance of a BPF configuration that uses security contexts,
the possibility is real. In the existing implementation there is
potential for multiple frees in that case.

Cc: linux-integrity@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: audit@vger.kernel.org
Cc: netfilter-devel@vger.kernel.org
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: linux-nfs@vger.kernel.org
Cc: Todd Kjos <tkjos@google.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
[PM: subject tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
2024-12-04 10:46:26 -05:00
..
6lowpan
9p net/9p/usbg: allow building as standalone module 2024-11-22 23:48:14 +09:00
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth Bluetooth: SCO: remove the redundant sco_conn_put 2024-11-26 11:07:28 -05:00
bpf
bridge ndo_fdb_del: Add a parameter to report whether notification was sent 2024-11-15 16:39:18 -08:00
caif
can
ceph libceph: Remove unused ceph_crypto_key_encode 2024-11-18 17:34:35 +01:00
core rtnetlink: fix rtnl_dump_ifinfo() error path 2024-11-24 16:43:13 -08:00
dcb
dccp
devlink
dns_resolver
dsa
ethernet
ethtool Revert "net: ethtool: Avoid thousands of -Wflex-array-member-not-at-end warnings" 2024-11-18 18:52:11 -08:00
handshake
hsr net: hsr: fix hsr_init_sk() vs network/transport headers. 2024-11-26 12:45:53 +01:00
ieee802154
ife
ipv4 lsm: ensure the correct LSM context releaser 2024-12-04 10:46:26 -05:00
ipv6 ipmr: fix build with clang and DEBUG_NET disabled. 2024-11-28 17:40:54 +01:00
iucv s390/iucv: MSG_PEEK causes memory leak in iucv_sock_destruct() 2024-11-26 10:02:53 +01:00
kcm
key
l2tp net/l2tp: fix warning in l2tp_exit_net found by syzbot 2024-11-26 09:27:07 +01:00
l3mdev
lapb
llc llc: Improve setsockopt() handling of malformed user input 2024-11-28 08:57:42 +01:00
mac80211 wireless-next patches for v6.13 2024-11-13 18:35:19 -08:00
mac802154
mctp
mpls
mptcp mptcp: pm: avoid code duplication to lookup endp 2024-11-18 18:50:13 -08:00
ncsi
netfilter lsm: ensure the correct LSM context releaser 2024-12-04 10:46:26 -05:00
netlabel lsm: ensure the correct LSM context releaser 2024-12-04 10:46:26 -05:00
netlink netlink: fix false positive warning in extack during dumps 2024-11-24 16:58:07 -08:00
netrom
nfc
nsh
openvswitch
packet
phonet
psample
qrtr
rds
rfkill net: rfkill: gpio: Add check for clk_enable() 2024-11-12 13:30:31 +01:00
rose
rxrpc rxrpc: Improve setsockopt() handling of malformed user input 2024-11-28 08:57:42 +01:00
sched net_sched: sch_fq: don't follow the fast path if Tx is behind now 2024-11-28 10:11:59 +01:00
sctp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-11-14 11:29:15 -08:00
shaper
smc
strparser
sunrpc NFS client updates for Linux 6.13 2024-11-30 10:17:53 -08:00
switchdev
tipc
tls
unix
vmw_vsock Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-11-14 11:29:15 -08:00
wireless wireless-next patches for v6.13 2024-11-13 18:35:19 -08:00
x25
xdp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-11-19 13:56:02 +01:00
xfrm ipsec-next-2024-11-15 2024-11-18 11:52:49 +00:00
Kconfig
Kconfig.debug
Makefile
compat.c
devres.c
socket.c Networking changes for 6.13. 2024-11-21 08:28:08 -08:00
sysctl_net.c