| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
memory leaks and missing NULL checks.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
|
|
|
|
|
| |
Both cppcheck and gcc's -fanalyzer complain here that realloc is being
used improperly.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the following compilation warning:
kmodloader.c: In function 'main_loader':
kmodloader.c:1027:41: error: ignoring return value of 'asprintf' declared with attribute 'warn_unused_result' [-Werror=unused-result]
make[1]: *** [package/Makefile:116: package/system/ubox/compile] Error 1
1027 | asprintf(&m->opts, "%s %s", prev, opts);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While at it rework the function to not duplicate too much code with the
error handling.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|
|
|
|
|
| |
This has the same format as /etc/modules.d on a regular linux system
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
|
|
|
|
|
|
|
| |
-a treats all non-op trailing arguments as module names
and attempts to load all of them. This behaviour mirrors the behaviour
of the respective -a in /tools/modprobe.c from https://git.kernel.org.
This is primarily to satiate the multiple modules passed by
docker/libnetwork.
Signed-off-by: Gerard Ryan <G.M0N3Y.2503@gmail.com>
|
|
|
|
|
|
|
|
| |
Do not just silently fail when kernel modules are nowhere to be
found. This is essential for diagnosing mismatched kernel version
failures.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
|
|
|
|
| |
This is primarily to satiate the usage by docker/libnetwork.
Signed-off-by: Gerard Ryan <G.M0N3Y.2503@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When DEF_MOD_PATH (10 bytes), s (max 255 bytes) and ver.release (max 64
bytes) are all written into path, 256 bytes will not fit, increase the
available size. All given sizes are given without terminating NULL byte
and we add one byte to store the NULL byte.
GCC 9.1 warns about this condition and we treat warnings as errors in
ubox.
Reported-by: Joseph Benden <joe@benden.us>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Restore functionality which was lost in commit 876c7f5b.
Again at boot time kmodloader can load all modules (/etc/modules.d/*)
even if dependency information is completely missing.
This functionality is important in case of hidden dependency (not symbol dependency).
For example, in kernel 4.4.60 is hidden dependency between nf_nat_ipv6 and nf_conntrack_ipv6.
We can't load nf_nat_ipv6 before nf_conntrack_ipv6 and modinfo do not show this dependency.
Two sequential load attempts of nf_nat_ipv6 may not be enough (in my case it's definitely not enough).
nf_nat_ipv4 has a similar problem.
2) Reduce count of attempts to load failed modules.
Now kmodloader try to load failed modules after all others are loaded.
main_loader: Count of failed and successful attempts to load nf_nat_ipv6.ko (kernel 4.4.60) depend on ubox version:
COMMIT FAILED SUCCESSFUL TOTAL
128bc35f 53 1 54
876c7f5b 2 0 2
this 1 1 2
Signed-off-by: Pavel Merzlyakov <pavel.merzlyakov@gmail.com>
Acked-by: Jo-Philipp Wich <jo@mein.io>
|
|
|
|
|
|
| |
Otherwise modules with long names, e.g. lttng (>32 chars) can't be loaded.
Signed-off-by: Sergiy Kibrik <sakib@darkstar.site>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loop in load_modprobe causes dmesg to be flooded with errors when a
module fails to load; e.g.:
- gpio-nct5104d: Unsupported device 0xffff (246 times on x86 in Qemu)
- jitterentropy: Initialization failed with host not compliant with
requirements: 2 (229 times on brcm2708/bcm2708)
On brcm2708/bcm2708 this also causes vmalloc allocation failures with
kernel 4.14 when running headless. If kmod-drm-vc4 and
kmod-video-bcm2835 are included in the image, they will be loaded before
brcmfmac, and brcmfmac will fail to load:
kmodloader: vmalloc: allocation failure: 249856 bytes,
mode:0x14000c0(GFP_KERNEL), nodemask=(null)
Break the loop after 2 failed attempts to fix these issues.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
|
|
|
|
|
|
| |
Log "out of memory" error message in case of OOM
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
kmodloader has a restriction of storing only 32 aliases for a given
module; as modules can have easily more than 32 aliases let's remove
the restriction by using a dynamic allocation mechanism when retrieving
the aliases.
While at it also check the get_module_info return value setting an error
code in case NULL is returned.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
|
|
| |
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Use __BYTE_ORDER macro to check system endianess as the macro's
__LITTLE_ENDIAN, __BIG_ENDIAN are defined irrespective of the
sytem endianess leading to an endianess check failure on big
endian systems.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Acked-by: John Crispin <john@phrozen.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we manage to accidentally get a module installed that does not match
the system endianess (there is currently nothing preventing that in
OpenWrt/LEDE) we will hit a segmentation fault when doing this:
sh = (Elf32_Shdr *) (map + e->e_shoff);
because e->e_shoff will be wrongly encoded and this most likely will
result in an invalid offset to de-reference from.
Update elf_find_section() to check that the build time endianess of
kmodloader matches that of the module, otherwise nothing would work
really.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
|
|
|
|
|
|
|
| |
Even when the callee looks onto the length is a good idea to zero
the points.
Found-by: Coverity Scan #1412541
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
|
|
|
|
|
| |
Found-by: Coverity Scan #1412469
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
|
|
|
|
|
| |
Found-by: Coverity Scan #1412291
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
|
|
|
|
|
|
|
|
|
|
|
| |
This is the default behaviour with modprobe from kmod package [1] unless
it is explicitly told that the module is to be loaded for --first-time
[1] http://www.kernel.org/pub/linux/utils/kernel/kmod/
Fixes FS#433
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This also fixes FS#544 as the possible address alignment issue should
now disappear
function old new delta
alloc_module 398 245 -153
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-153) Total: -153 bytes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
kmodloader is using slightly different criteria for ordering the AVL tree
versus what it uses to traverse it. This sometimes results in not being
able to find some modules.
Reference: https://bugs.lede-project.org/index.php?do=details&task_id=443
Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
|
|
|
|
|
|
|
|
|
|
| |
The kernel opportunistically attempts to load modules in advanced with
'predicted' module names. Often these modules don't exist and hence
kmodloader produces lots of logfile noise. The kernel commandline to
modprobe from kworker proceses is '-q -- modulename' where '-q' means
quiet. Support suppressing that noise.
Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
|
|
|
|
|
|
|
|
|
|
|
|
| |
To fix spurious error messages in the following situation
1. scan loaded modules
2. load wireguard.ko and the module itself will request xt_hashlimit to
be loaded
3. xt_hashlimit is still in PROBE state here so we also try to load it,
but init_module() returns EEXIST
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To achieve this, the following changes are made
- scan module folders before scaning loaded modules
- struct module was splited into struct module_node for the avl tree
and struct module for storing actual info about modules
The other minor fix is that module.opts is now freed in free_modules()
when appliable
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes output of "modinfo nf_conntrack_ipv4"
module: /lib/modules/4.4.40/nf_conntrack_ipv4.ko
license: GPL
alias: ip_conntrack
alias: nf_conntrack-2
depends: nf_conntrack,nf_defrag_ipv4
src: %pI4 dst=%pI4
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
|
|
|
|
| |
The kernel may invocate user mode modprobe with the following scheme
modprobe -q -- <module_name>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
|
|
| |
syslog may not be ready yet before PREINIT
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
| |
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
|
|
| |
Avoids leaking memory when exiting early.
Signed-off by: Rosen <rosenp@gmail.com>
|
|
|
|
| |
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
|
|
|
| |
Signed-off-by: John Crispin <john@phrozen.org>
|
|
|
|
|
|
|
| |
Without this patch only the first dependency is shown, with this patch
all module dependencies are show.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
|
|
| |
Observed on an invalid module
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
|
|
| |
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
|
|
|
|
|
| |
Fixes kmodloader on systems without stdio and prevents fd leaks in case
descriptor zero is opened.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
|
|
| |
Signed-off-by: Christian Mehlis <christian@m3hlis.de>
|
|
|
|
|
|
|
| |
Fixes a segmentation fault in 'insmod' operation mode, due to uninitialized
path list.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
|
|
| |
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
|
|
|
|
|
|
| |
When LD_LIBRARY_PATH is set, then scan for kmods in each directory pointed to
by it. This is mainly useful for early boot invocations of kmodloader, e.g.
during the extroot setup phase.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
|
|
|
|
|
|
|
| |
Ubox logs various messages during OpenWRT boot which are not
very interesting, such as the number of iterations made. This
fix implements several loglevels for debug/info/error so that
more useful messages are shown.
Signed-off-by: Michel Stam <m.stam@fugro.nl>
|
|
|
|
|
|
| |
with musl
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
|
|
|
|
| |
https://dev.openwrt.org/ticket/14659
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The module .ko file might be called differently than the name used
by the kernel internally, e.g. "nls_iso8859-1.ko" is called
"nls_iso8859_1" in lsmmod. The print_modinfo() procedure expects the
filename spelling in order to successfully resolve the full module path.
After this change, "modinfo" supports printing module info even if the
user gives the kernel internal spelling instead of the file name one,
so that e.g. "modinfo "nls_iso8859_1" and "modinfo nls_iso8859-1.ko" will
both succeed.
|