netdevsim: fix a several bugs in netdevsim module
Subsystems (2)
cover netdevsim: fix a several bugs in netdevsim module
This patchset fixes several bugs in netdevsim module.
1. The first patch fixes a race condition in netdevsim module. netdevsim operation is called by sysfs and these operations use netdevsim global resource but there is only a lock for protect list, not the whole resource. So, panic occurs.
2. The second patch fixes stack-out-of-bound in nsim_dev_debugfs_init(). nsim_dev_debugfs_init() provides only 16bytes for name pointer. But, there are some case the name length is over 16bytes. So, stack-out-of-bound occurs.
3. The third patch avoid debugfs warning message.
When module is being removed, it couldn't be held by try_module_get(). debugfs's open function internally tries to hold file_operation->owner if .owner is set.
If holding owner operation is failed, it prints a warning message.
4. The fourth patch uses IS_ERR instead of IS_ERR_OR_NULL. debugfs_create_{dir/file} doesn't return NULL. So, IS_ERR() is more correct.
5. The fifth patch avoids kmalloc warning.
When too large memory allocation is requested by user-space, kmalloc internally prints warning message.
That warning message is not necessary.
In order to avoid that, it adds __GFP_NOWARN.
Taehee Yoo (5):
netdevsim: fix a race condition in netdevsim operations
netdevsim: fix stack-out-of-bounds in nsim_dev_debugfs_init()
netdevsim: avoid debugfs warning message when module is remove
netdevsim: use IS_ERR instead of IS_ERR_OR_NULL for debugfs
netdevsim: use __GFP_NOWARN to avoid memalloc warning
drivers/net/netdevsim/bpf.c | 21 +++++++--- drivers/net/netdevsim/bus.c | 66 ++++++++++++++++++++++++------- drivers/net/netdevsim/dev.c | 38 +++++++++++++----- drivers/net/netdevsim/health.c | 6 +-- drivers/net/netdevsim/ipsec.c | 1 - drivers/net/netdevsim/netdevsim.h | 2 + 6 files changed, 100 insertions(+), 34 deletions(-)
Signature · 1 line
2.17.1