linux_old1/include
Daniel Borkmann 037b0b86ec tcp, ulp: add alias for all ulp modules
Lets not turn the TCP ULP lookup into an arbitrary module loader as
we only intend to load ULP modules through this mechanism, not other
unrelated kernel modules:

  [root@bar]# cat foo.c
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <linux/tcp.h>
  #include <linux/in.h>

  int main(void)
  {
      int sock = socket(PF_INET, SOCK_STREAM, 0);
      setsockopt(sock, IPPROTO_TCP, TCP_ULP, "sctp", sizeof("sctp"));
      return 0;
  }

  [root@bar]# gcc foo.c -O2 -Wall
  [root@bar]# lsmod | grep sctp
  [root@bar]# ./a.out
  [root@bar]# lsmod | grep sctp
  sctp                 1077248  4
  libcrc32c              16384  3 nf_conntrack,nf_nat,sctp
  [root@bar]#

Fix it by adding module alias to TCP ULP modules, so probing module
via request_module() will be limited to tcp-ulp-[name]. The existing
modules like kTLS will load fine given tcp-ulp-tls alias, but others
will fail to load:

  [root@bar]# lsmod | grep sctp
  [root@bar]# ./a.out
  [root@bar]# lsmod | grep sctp
  [root@bar]#

Sockmap is not affected from this since it's either built-in or not.

Fixes: 734942cc4e ("tcp: ULP infrastructure")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2018-08-16 14:58:07 -07:00
..
acpi Merge branches 'acpi-x86', 'acpi-bus', 'acpi-ec' and 'acpi-apei' 2018-08-14 10:06:45 +02:00
asm-generic Merge branch 'l1tf-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-08-14 09:46:06 -07:00
clocksource
crypto Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL 2018-06-28 10:40:47 -07:00
drm ALSA: hda: Make audio component support more generic 2018-07-17 22:25:48 +02:00
dt-bindings Power management updates for 4.19-rc1 2018-08-14 13:12:24 -07:00
keys docs: Fix some broken references 2018-06-15 18:10:01 -03:00
kvm
linux Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-08-15 15:04:25 -07:00
math-emu
media
memory
misc
net tcp, ulp: add alias for all ulp modules 2018-08-16 14:58:07 -07:00
pcmcia
ras
rdma 4.18-rc 2018-06-21 07:22:30 +09:00
scsi scsi: Check sense buffer size at build time 2018-08-02 15:23:51 -06:00
soc drivers: qcom: rpmh: add support for batch RPMH request 2018-07-21 13:33:36 -05:00
sound ASoC: Updates for v4.19 2018-08-13 12:12:31 +02:00
target
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-08-15 15:04:25 -07:00
uapi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-08-15 15:04:25 -07:00
video fbdev changes for v4.18: 2018-06-17 05:00:24 +09:00
xen xen/grant-table: Allow allocating buffers suitable for DMA 2018-07-26 23:05:14 -04:00