Linux-HyperV List
 help / color / mirror / Atom feed
* [PATCH net-next RFC 0/5] vsock: constify transports
@ 2026-12-03 16:32 Michal Luczaj
  2026-12-03 16:32 ` [PATCH net-next RFC 1/5] vsock/virtio: constify loopback_transport Michal Luczaj
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Michal Luczaj @ 2026-12-03 16:32 UTC (permalink / raw)
  To: Stefan Hajnoczi, Stefano Garzarella, Bobby Eshleman,
	Michael S. Tsirkin, Jason Wang, Eugenio Pérez, Xuan Zhuo,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Willem de Bruijn, Simon Horman, Bryan Tan, Vishnu Dasa,
	Broadcom internal kernel review list, Haiyang Zhang, Wei Liu,
	Dexuan Cui
  Cc: virtualization, kvm, netdev, linux-kernel, linux-hyperv,
	Michal Luczaj

Hardening in the spirit of commit 56130915bbe3 ("VSOCK: constify
vsock_transport structure"), which constified the only vsock transport of
its time, but then effectively got reverted in commit c0cfa2d8a788 ("vsock:
add multi-transports support").

virtio_transport structs are immutable, move them to RO memory. No
functional change. Value added: less .data, fewer options to take over
function pointers [1].

File sizes are essentially unchanged (deltas -8 to +64 bytes, <= +0.01%).
Sizes of .text and .bss are unchanged, only movement being few hundred
bytes of the transport structs relocating from .data to .rodata:

                                      .rodata  .data
vsock.ko                              0        0
vsock_loopback.ko                     +384     -384
vmw_vsock_virtio_transport.ko         +384     -384
vmw_vsock_virtio_transport_common.ko  0        0
vmw_vsock_vmci_transport.ko           +352     -352
hv_sock.ko                            +352     -352
vhost_vsock.ko                        +384     -384

[1] https://www.kernel.org/doc/html/v7.4-rc5/security/self-protection.html#function-pointers-and-sensitive-variables-must-not-be-writable

---
Michal Luczaj (5):
      vsock/virtio: constify loopback_transport
      vsock/virtio: constify virtio_transport
      vsock/virtio: constify vhost_transport
      vsock/vmci: constify vmci_transport
      vsock/hyperv: constify hvs_transport

 drivers/vhost/vsock.c                   | 2 +-
 include/linux/virtio_vsock.h            | 2 +-
 include/net/af_vsock.h                  | 2 +-
 net/vmw_vsock/af_vsock.c                | 2 +-
 net/vmw_vsock/hyperv_transport.c        | 2 +-
 net/vmw_vsock/virtio_transport.c        | 4 ++--
 net/vmw_vsock/virtio_transport_common.c | 4 ++--
 net/vmw_vsock/vmci_transport.c          | 4 ++--
 net/vmw_vsock/vsock_loopback.c          | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)
---
base-commit: ed3135d0881a926de56a7f490dea3d51698ba118
change-id: 20260116-vsock-constify-transports-16f3f5e28bab

Best regards,
--  
Michal Luczaj <mhal@rbox.co>


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

end of thread, other threads:[~2026-12-04 19:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 16:32 [PATCH net-next RFC 0/5] vsock: constify transports Michal Luczaj
2026-12-03 16:32 ` [PATCH net-next RFC 1/5] vsock/virtio: constify loopback_transport Michal Luczaj
2026-12-03 16:32 ` [PATCH net-next RFC 2/5] vsock/virtio: constify virtio_transport Michal Luczaj
2026-12-03 16:32 ` [PATCH net-next RFC 3/5] vsock/virtio: constify vhost_transport Michal Luczaj
2026-12-03 16:32 ` [PATCH net-next RFC 4/5] vsock/vmci: constify vmci_transport Michal Luczaj
2026-12-03 16:32 ` [PATCH net-next RFC 5/5] vsock/hyperv: constify hvs_transport Michal Luczaj
2026-12-03 20:14   ` Hamza Mahfooz
2026-12-04 16:18 ` [PATCH net-next RFC 0/5] vsock: constify transports Bobby Eshleman
2026-12-04 19:06   ` Michal Luczaj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox