linux-kernelorg-stable/net
Linus Torvalds 1b5dd29869 vfs-6.19-rc1.fd_prepare.fs
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCaSmOZwAKCRCRxhvAZXjc
 op0AAP4oNVJkFyvgKoPos5K2EGFB8M7merGhpYtsOoeg8UK6OwD/UySQErHsXQDR
 sUDDa5uFOhfrkcfM8REtAN4wF8p5qAc=
 =QgFD
 -----END PGP SIGNATURE-----

Merge tag 'vfs-6.19-rc1.fd_prepare.fs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull fd prepare updates from Christian Brauner:
 "This adds the FD_ADD() and FD_PREPARE() primitive. They simplify the
  common pattern of get_unused_fd_flags() + create file + fd_install()
  that is used extensively throughout the kernel and currently requires
  cumbersome cleanup paths.

  FD_ADD() - For simple cases where a file is installed immediately:

      fd = FD_ADD(O_CLOEXEC, vfio_device_open_file(device));
      if (fd < 0)
          vfio_device_put_registration(device);
      return fd;

  FD_PREPARE() - For cases requiring access to the fd or file, or
  additional work before publishing:

      FD_PREPARE(fdf, O_CLOEXEC, sync_file->file);
      if (fdf.err) {
          fput(sync_file->file);
          return fdf.err;
      }

      data.fence = fd_prepare_fd(fdf);
      if (copy_to_user((void __user *)arg, &data, sizeof(data)))
          return -EFAULT;

      return fd_publish(fdf);

  The primitives are centered around struct fd_prepare. FD_PREPARE()
  encapsulates all allocation and cleanup logic and must be followed by
  a call to fd_publish() which associates the fd with the file and
  installs it into the caller's fdtable. If fd_publish() isn't called,
  both are deallocated automatically. FD_ADD() is a shorthand that does
  fd_publish() immediately and never exposes the struct to the caller.

  I've implemented this in a way that it's compatible with the cleanup
  infrastructure while also being usable separately. IOW, it's centered
  around struct fd_prepare which is aliased to class_fd_prepare_t and so
  we can make use of all the basica guard infrastructure"

* tag 'vfs-6.19-rc1.fd_prepare.fs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (42 commits)
  io_uring: convert io_create_mock_file() to FD_PREPARE()
  file: convert replace_fd() to FD_PREPARE()
  vfio: convert vfio_group_ioctl_get_device_fd() to FD_ADD()
  tty: convert ptm_open_peer() to FD_ADD()
  ntsync: convert ntsync_obj_get_fd() to FD_PREPARE()
  media: convert media_request_alloc() to FD_PREPARE()
  hv: convert mshv_ioctl_create_partition() to FD_ADD()
  gpio: convert linehandle_create() to FD_PREPARE()
  pseries: port papr_rtas_setup_file_interface() to FD_ADD()
  pseries: convert papr_platform_dump_create_handle() to FD_ADD()
  spufs: convert spufs_gang_open() to FD_PREPARE()
  papr-hvpipe: convert papr_hvpipe_dev_create_handle() to FD_PREPARE()
  spufs: convert spufs_context_open() to FD_PREPARE()
  net/socket: convert __sys_accept4_file() to FD_ADD()
  net/socket: convert sock_map_fd() to FD_ADD()
  net/kcm: convert kcm_ioctl() to FD_PREPARE()
  net/handshake: convert handshake_nl_accept_doit() to FD_PREPARE()
  secretmem: convert memfd_secret() to FD_ADD()
  memfd: convert memfd_create() to FD_ADD()
  bpf: convert bpf_token_create() to FD_PREPARE()
  ...
2025-12-01 17:32:07 -08:00
..
6lowpan
9p
802
8021q
appletalk
atm net: atm: fix incorrect cleanup function call in error path 2025-11-20 18:09:49 -08:00
ax25
batman-adv
bluetooth Bluetooth: SMP: Fix not generating mackey and ltk when repairing 2025-11-20 17:02:07 -05:00
bpf
bridge
caif
can
ceph libceph: prevent potential out-of-bounds writes in handle_auth_session_key() 2025-11-27 09:59:49 +01:00
core namespace-6.19-rc1 2025-12-01 09:47:41 -08:00
dcb
devlink devlink: rate: Unset parent pointer in devl_rate_nodes_destroy 2025-11-18 17:12:21 -08:00
dns_resolver
dsa
ethernet
ethtool
handshake vfs-6.19-rc1.fd_prepare.fs 2025-12-01 17:32:07 -08:00
hsr hsr: Follow standard for HSRv0 supervision frames 2025-11-13 15:55:04 +01:00
ieee802154
ife
ipv4 ipsec-2025-11-18 2025-11-18 17:58:44 -08:00
ipv6
iucv
kcm net/kcm: convert kcm_ioctl() to FD_PREPARE() 2025-11-28 12:42:34 +01:00
key
l2tp l2tp: reset skb control buffer on xmit 2025-11-20 11:52:24 +01:00
l3mdev
lapb
llc
mac80211
mac802154
mctp net: mctp: unconditionally set skb->dev on dst output 2025-11-27 11:39:12 +01:00
mpls
mptcp mptcp: Initialise rcv_mss before calling tcp_send_active_reset() in mptcp_do_fastclose(). 2025-11-27 13:10:16 +01:00
ncsi
netfilter
netlabel
netlink
netrom
nfc
nsh
openvswitch net: openvswitch: remove never-working support for setting nsh fields 2025-11-14 18:13:24 -08:00
packet
phonet
psample
psp
qrtr
rds
rfkill
rose
rxrpc
sched linux-can-fixes-for-6.18-20251126 2025-11-26 19:56:00 -08:00
sctp
shaper
smc
strparser
sunrpc nfsd-6.18 fixes: 2025-11-12 18:41:01 -08:00
switchdev
tipc
tls
unix vfs-6.19-rc1.fd_prepare.fs 2025-12-01 17:32:07 -08:00
vmw_vsock vsock: Ignore signal/timeout on connect() if already established 2025-11-20 07:40:06 -08:00
wireless
x25
xdp xsk: avoid data corruption on cq descriptor number 2025-11-25 19:51:50 -08:00
xfrm ipsec-2025-11-18 2025-11-18 17:58:44 -08:00
Kconfig
Kconfig.debug
Makefile
compat.c
devres.c
socket.c net/socket: convert __sys_accept4_file() to FD_ADD() 2025-11-28 12:42:34 +01:00
sysctl_net.c