summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* kmod 24v24Lucas De Marchi2017-02-233-2/+20
|
* build: update autogenLucas De Marchi2017-02-231-16/+50
| | | | Bring new options from systemd and other projects.
* depmod: fix leak on error pathLucas De Marchi2017-02-231-1/+2
|
* man: make error message clearer for missing xstlprocLucas De Marchi2017-02-231-7/+7
| | | | | | | | | | | | | | | We can't do at configure phase since we actually ship the built man pages with dist, so it's fine not having xsltproc if building from dist. If building from the repository, it's better to have have a better message saying xsltproc was not found than trying to execute the argument to xsltproc. Now message is: XSLT depmod.d.5 /bin/sh: line 1: xsltproc: command not found Instead of: XSLT depmod.d.5 /bin/sh: --nonet: command not found
* build: add missing headerLucas De Marchi2017-02-231-0/+1
| | | | Fix failing distcheck
* depmod: handle nested loopsYauheni Kaliuta2017-02-221-84/+211
| | | | | | | | | | | | | | | | | | This is a rework of depmod report cycles logic to make it tolerant to more complex loops. The patch tries to remember own path for vertexes which makes it possible to handle configurations with common edges and non-cyclic modules. It assumes that the previous dependency calculations can not give as input something like mod_a -> mod_b -> <loop>, but <loop> -> mod_a -> mod_b should be fine. Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
* testsuite: depmod: check netsted loops reportingYauheni Kaliuta2017-02-2213-2/+124
| | | | | | | | | | | | | | | | | | | | | | | | | The patch adds nested loops configuration for the loop test: mod-loop-h -> mod-loop-i -> mod-loop-j -> mod-loop-k ^ | | --------------------------- | | | ------------------------------------------- making 2 loops with common edges: mod-loop-h -> mod-loop-i -> mod-loop-j -> mod-loop-h mod-loop-h -> mod-loop-i -> mod-loop-j -> mod-loop-k -> mod-loop-h The actual output for the loops is: depmod: ERROR: Cycle detected: mod_loop_h -> mod_loop_h depmod: ERROR: Cycle detected: mod_loop_i -> mod_loop_j -> mod_loop_k -> mod_loop_h -> mod_loop_i (the order in the second doesn't matter, but the first one is incorrect) Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
* libkmod-config: fix parsing quoted kernel cmdline on paramsLucas De Marchi2017-02-162-1/+15
| | | | We can only accept quoted values, not module names or parameter names.
* libkmod-config: replace 0/1 with boolLucas De Marchi2017-02-161-4/+4
|
* module: fix a memory leakBartosz Golaszewski2017-02-161-4/+6
| | | | | | | | | | | When a module is removed and re-inserted without unrefing, the kmod_file is unconditionally re-opened. This results in a memory and file descriptor leak. Fix it by checking if the file is already open in kmod_module_insert_module(). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
* testsuite: add test for kernel cmdline with quotesLucas De Marchi2017-01-233-0/+32
| | | | | | Add some tests in which we quotes in kernel cmdline and also spaces inside quotes. This doesn't yet cover the case in which quotes are used for module name, wihch should be forbidden.
* testsuite: fix typo in descriptionLucas De Marchi2017-01-231-1/+1
|
* libkmod: Fix handling of quotes in kernel command lineJames Minor2017-01-231-0/+7
| | | | | | | | If a module parameter on the command line contains quotes, any spaces inside those quotes should be included as part of the parameter. Signed-off-by: James Minor <james.minor@ni.com>
* build: fix build with disabled test modulesLucas De Marchi2016-11-103-0/+2
| | | | | | | | | | | | | | install: cannot stat 'testsuite/module-playground/mod-loop-f.ko': No such file or directory Makefile:2881: recipe for target 'rootfs' failed make[1]: *** [rootfs] Error 1 make[1]: *** Waiting for unfinished jobs.... Makefile:2101: recipe for target 'check-recursive' failed We need to ship pre-compiled binaries so it's possible to run "make check" on servers without kernel headers. Also add them to EXTRA_DIST as other sources.
* shared: make scratchbuf_str staticYauheni Kaliuta2016-11-101-1/+1
| | | | | | | | | | | It fixes linking problem tools/depmod.o: In function `output_symbols_bin': depmod.c:(.text.output_symbols_bin+0x135): undefined reference to `scratchbuf_str' for -O0 build, where gcc doesn't actually inline it. Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
* depmod: ignore related modules in depmod_report_cyclesMian Yousaf Kaukab2016-11-082-2/+13
| | | | | | | | | | | | | | | Only print actual cyclic dependencies. Print count of all the modules in cyclic dependency at the end of the function so that dependent modules which are not in cyclic chain can be ignored. Printing dependent modules which are not in cyclic chain causes buffer overflow as m->modnamesz is not included in buffer size calculations (loop == m is never true). This buffer overflow causes kmod to crash. Update depmod test to reflect the change as well. Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
* testsuite: depmod: add module dependency outside cyclic chainMian Yousaf Kaukab2016-11-087-1/+61
| | | | | | | | | | | | | | | | | | | | | | Check that depmod do not report modules outside cyclic chain Two modules f and g are added which do not have any dependency. modules a and b are made dependent on f and g. Here is the output of loop dependency check test after adding this patch: TESTSUITE: ERR: wrong: depmod: ERROR: Found 7 modules in dependency cycles! depmod: ERROR: Cycle detected: mod_loop_d -> mod_loop_e -> mod_loop_d depmod: ERROR: Cycle detected: mod_loop_b -> mod_loop_c -> mod_loop_a -> mod_loop_b depmod: ERROR: Cycle detected: mod_loop_b -> mod_loop_c -> mod_loop_a -> mod_loop_g depmod: ERROR: Cycle detected: mod_loop_b -> mod_loop_c -> mod_loop_a -> mod_loop_f Buffer overflow occurs in the loop when last two lines are printed. 43 bytes buffer is allocated and 53 bytes are used. Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
* testsuite: fix test_array_sort pointers inderectionYauheni Kaliuta2016-11-081-1/+8
| | | | | | | | | | | | | | The array elements in the tests are strings, what means "char *" in С. The comparation funtion takes pointers to the elements, so the arguments become "char **". It means, that strcmp() cannot be used directrly. The patch creates a wrapper on strcmp() which perfoms dereferencing of the "char **" to supply the actual strings to strcmp(), and uses the wrapper as a comparation function for the qsort() call. Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
* depmod: fix string overflowLucas De Marchi2016-08-151-2/+19
| | | | | Use scratchbuf to fix issue with strcpy that may overflow the buffer we declared in the stack.
* Add scratchbuf implementationLucas De Marchi2016-08-155-0/+188
| | | | | | | This should fill the requirements for "we need to loop over a lot of strings that usually are small enough to remain on stack, but we want to protect ourselves against huge strings not fitting in the static buffer we estimated as sufficient"
* testsuite: include stdio.hLucas De Marchi2016-08-151-0/+1
| | | | It's used in the log macros so include it.
* util: fix warning of equal values on logical ORLucas De Marchi2016-08-102-5/+5
| | | | | | | | | | | | | | | shared/util.c: In function ‘read_str_safe’: shared/util.c:211:24: warning: logical ‘or’ of equal expressions [-Wlogical-op] if (errno == EAGAIN || errno == EWOULDBLOCK || ^~ shared/util.c: In function ‘write_str_safe’: shared/util.c:237:24: warning: logical ‘or’ of equal expressions [-Wlogical-op] if (errno == EAGAIN || errno == EWOULDBLOCK || ^~ This is because EAGAIN and EWOULDBLOCK have the same value. Prefer EAGAIN, but add a static assert to catch if it's not the same in another architecture.
* libkmod: fix use of strcpyLucas De Marchi2016-08-081-6/+11
| | | | We were not checking if there was sufficient space in the buffer.
* kmod 23v23Lucas De Marchi2016-07-202-2/+2
|
* NEWS: add items for kmod 23Lucas De Marchi2016-06-281-0/+29
|
* libkmod: fix integration with gtk-docLucas De Marchi2016-06-281-1/+3
| | | | | | | | | | | It was failing to generate doc with recent version of gtk-doc [kmod]$ ./bootstrap libkmod/docs/gtk-doc.make:33: error: EXTRA_DIST must be set with '=' before using '+=' libkmod/docs/Makefile.am:29: 'libkmod/docs/gtk-doc.make' included from here autoreconf: automake failed with exit status: 1 Just add an empty EXTRA_DIST so it works.
* libkmod-module: modinfo: print signature idLucas De Marchi2016-06-271-1/+7
| | | | This way it's possible to give at least the signature type for PKCS#7.
* libkmod-signature: handle PKCS#7Lucas De Marchi2016-06-271-0/+2
|
* libkmod-module: do not crash modinfo on 0 key id lenLucas De Marchi2016-06-271-15/+23
|
* libkmod: Handle long lines in /proc/modulesMichal Marek2016-06-211-2/+10
| | | | | | | | | | | | | | | kmod_module_new_from_loaded() calls fgets with a 4k buffer. When a module such as usbcore is used by too many modules, the rest of the line is considered a beginning of another lines and we eventually get errors like these from lsmod: libkmod: kmod_module_get_holders: could not open '/sys/module/100,/holders': No such file or directory together with bogus entries in the output. In kmod_module_get_size, the problem does not affect functionality, but the line numbers in error messages will be wrong. Signed-off-by: Michal Marek <mmarek@suse.com>
* depmod: Ignore PowerPC64 ABIv2 .TOC. symbolAnton Blanchard2016-06-111-0/+2
| | | | | | | | The .TOC. symbol on the PowerPC64 ABIv2 identifies the GOT pointer, similar to how other architectures use _GLOBAL_OFFSET_TABLE_. This is not a symbol that needs relocation, and should be ignored by depmod.
* README: add link to patchworkLucas De Marchi2016-05-241-0/+3
|
* kmod: compiling with old sed version (!ERE support)Héctor Orón Martínez2016-05-211-1/+1
| | | | | | | | | Makefile.am uses `sed -E', which it is found on BSD sed; however a replacement on GNU sed would be `sed -r'. Both intend to use extended regular expressions (ERE). However I have a system that does not support those, in benefit for portability could you consider replacing ERE by BRE. Signed-off-by: Héctor Orón Martínez <hector.oron@gmail.com>
* kmod_module_get_refcnt: fix documentationPeter Wu2016-05-211-1/+1
|
* travis: workaround bug in environment setupLucas De Marchi2016-01-111-0/+1
| | | | | | Travis is poluting the environment, particularly PYTHON_CFLAGS which makes the build to fail. Just unset the variable since we don't want to override these cflags.
* depmod: Don't insert comment in modules.devname if otherwise emptyJosh Triplett2016-01-111-4/+8
| | | | | This allows tools to detect the file as empty, such as via systemd's ConditionFileNotEmpty.
* insmod: fix wron fallthrough of -fMarc-Antoine Perennou2015-11-201-0/+2
| | | | Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
* kmod 22v22Lucas De Marchi2015-11-173-4/+25
|
* insmod: do support -fPhilippe De Swert2015-10-251-2/+4
| | | | | | | | | The -f switch is accepted by insmod, but silently ignored. This causes the user to wonder why things don't work. As insmod is most often used with "evil" modules, -f is almost default and thus needs to work. Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
* libkmod: export new kmod_get_dirname() functionLucas De Marchi2015-09-302-1/+14
| | | | Make sure it gets exported and add documentation.
* depmod: Don't fall back to uname on bad versionLaura Abbott2015-09-301-1/+5
| | | | | | | Currently, if a value that doesn't match a kernel version ("%u.%u") is passed in, depmod silently falls back to using uname. Rather than try and work around the caller passing bad data, just exit out instead.
* depmod: Remove unprinted debug messagesLaura Abbott2015-09-301-4/+1
| | | | | | | In between the start of the program and the call to log_setup_kmod_log, the only messages that will be printed are the ones at or above the global default level. Debug messages in this range will never be printed so remove them.
* Change default log levelLaura Abbott2015-09-301-1/+1
| | | | | | | | The default log level is currently LOG_ERR. Tools can override this default but there is a non-trivial amount of setup that needs to happen before the log level can be changed. Since tools may want to use the warn level for things such as deprecated flags, change the default to LOG_WARNING to ensure messages get printed.
* modprobe: Update error message when path is missingLaura Abbott2015-09-303-6/+4
| | | | | | | | | | | | | | | Currently, modprobe fails with no output by default if the search paths it tries are missing: $ modprobe -S notakernel dm-crypt $ $ modprobe -S notakernel lkjjweiojo $ This is fairly cryptic and not at all obvious there is a problem unless the error code is checked or verbose flags are used. Update the error message to indicate a problem and print out the directory that failed.
* README: Indicate cython requirementsLaura Abbott2015-09-301-1/+2
| | | | | The recommended flags require cython be installed to compile successfully. Note this in the documentation.
* build: let sed use posix ERE instead of GNU extensionNatanael Copa2015-06-221-1/+1
| | | | | | | | | Use POSIX Extended Regular Expression (ERE) instead of the GNU extension \| in the install-exec-hook. This makes it create the symlink properly with busybox sed built with musl libc. It will silently create a broken symlink otherwise. Lucas De Marchi: fix up added newline.
* libkmod-module: fix return code in error pathLucas De Marchi2015-06-131-1/+1
| | | | | | | | | | | | ENOSYS is the wrong errno to return when we don't find a module in kmod_module_insert_module(). Why is it there in the first place? This goes back to kmod v1 when we couldn't load modules by names, but we should give a path instead. 708624a ("ELF: initial support for modinfo and strip of modversions and vermagic.") changed that so we do a lazy-search by the module path in this function. Later f304afe ("Change error message to reflect reality") fixed the log message but the return coded remained the same.
* Add README.md file with build detailsLucas De Marchi2015-06-112-0/+9
| | | | | Add the badges from semaphoreci and coverity and point people to the README file with more information.
* kmod 21v21Lucas De Marchi2015-06-093-2/+23
|
* build: add cache to distributed filesLucas De Marchi2015-06-091-0/+1
| | | | We were missing the cache directory on the distributed files.