]> git.baikalelectronics.ru Git - kernel.git/commit
net: don't unnecessarily load kernel modules in dev_ioctl()
authorPaul Moore <paul@paul-moore.com>
Tue, 6 Mar 2018 22:27:44 +0000 (17:27 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Mar 2018 20:12:58 +0000 (15:12 -0500)
commit1c6420f79cae6665de4f420cd58fc0a51ac4566a
treebf2eda1c6a1704c23e357249dc55b98777ad8d7c
parentb178dc36d4bed04293906030157c996f37921114
net: don't unnecessarily load kernel modules in dev_ioctl()

Starting with v4.16-rc1 we've been seeing a higher than usual number
of requests for the kernel to load networking modules, even on events
which shouldn't trigger a module load (e.g. ioctl(TCGETS)).  Stephen
Smalley suggested the problem may lie in commit e1079cb6ce0b
("dev_ioctl(): move copyin/copyout to callers") which moves changes
the network dev_ioctl() function to always call dev_load(),
regardless of the requested ioctl.

This patch moves the dev_load() calls back into the individual ioctls
while preserving the rest of the original patch.

Reported-by: Dominick Grift <dac.override@gmail.com>
Suggested-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev_ioctl.c