linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] insmod: do support -f
@ 2015-10-07 15:36 philippedeswert
  2015-10-11 18:59 ` Lucas De Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: philippedeswert @ 2015-10-07 15:36 UTC (permalink / raw)
  To: linux-modules

From: Philippe De Swert <philippe.deswert@jollamobile.com>

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>
---
 tools/insmod.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/insmod.c b/tools/insmod.c
index 8e72e11..045fd2c 100644
--- a/tools/insmod.c
+++ b/tools/insmod.c
@@ -71,6 +71,7 @@ static int do_insmod(int argc, char *argv[])
 	size_t optslen = 0;
 	int i, err;
 	const char *null_config = NULL;
+	unsigned int flags = 0;
 
 	for (;;) {
 		int c, idx = 0;
@@ -81,7 +82,8 @@ static int do_insmod(int argc, char *argv[])
 		case 'p':
 		case 's':
 		case 'f':
-			/* ignored, for compatibility only */
+			flags |= KMOD_PROBE_FORCE_MODVERSION;
+			flags |= KMOD_PROBE_FORCE_VERMAGIC;
 			break;
 		case 'h':
 			help();
@@ -142,7 +144,7 @@ static int do_insmod(int argc, char *argv[])
 		goto end;
 	}
 
-	err = kmod_module_insert_module(mod, 0, opts);
+	err = kmod_module_insert_module(mod, flags, opts);
 	if (err < 0) {
 		ERR("could not insert module %s: %s\n", filename,
 		    mod_strerror(-err));
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] insmod: do support -f
  2015-10-07 15:36 [PATCH] insmod: do support -f philippedeswert
@ 2015-10-11 18:59 ` Lucas De Marchi
  2015-10-16 12:04   ` Philippe De Swert
  0 siblings, 1 reply; 5+ messages in thread
From: Lucas De Marchi @ 2015-10-11 18:59 UTC (permalink / raw)
  To: philippedeswert; +Cc: linux-modules

Hi Philippe

On Wed, Oct 7, 2015 at 12:36 PM,  <philippedeswert@gmail.com> wrote:
> From: Philippe De Swert <philippe.deswert@jollamobile.com>
>
> 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.

I'd encourage people for actually *not* using -f.

I have mixed feelings here because this is disabled in insmod since
forever (it's already on the first git commit from module-init-tools).
If anyone knows the reason it would be nice... at least to include in
the commit message.

Lucas De Marchi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] insmod: do support -f
  2015-10-11 18:59 ` Lucas De Marchi
@ 2015-10-16 12:04   ` Philippe De Swert
  2015-10-25 15:58     ` Lucas De Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: Philippe De Swert @ 2015-10-16 12:04 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

Hi Lucas,

On 11/10/15 21:59, Lucas De Marchi wrote:
> Hi Pom: Philippe De Swert <philippe.deswert@jollamobile.com>
>
> 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.
> I'd encourage people for actually *not* using -f.

Well unfortunately we still do not live in a perfect world yet. Reality 
is that I had to yet again
deal with a mystery module from the deep...
> I have mixed feelings here because this is disabled in insmod since
> forever (it's already on the first git commit from module-init-tools).
> If anyone knows the reason it would be nice... at least to include in
> the commit message.

Well the weirdest thing is that it is ignored without warning. With as a 
result it lets you wonder why it
did not work. I wasted quite some time checking if the last -f fix 
actually did what it was supposed to do.
As making -f work was not that hard I quickly did it. Another option 
would at least let the user of it know
that it won't work. However imho insmod -f is the first command you will 
use trying to insert a mystery module
as it will most likely also not be visible to modprobe as the location 
of it can be arbitrary.

Regards,

Philippe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] insmod: do support -f
  2015-10-16 12:04   ` Philippe De Swert
@ 2015-10-25 15:58     ` Lucas De Marchi
  2015-10-26 10:28       ` Philippe De Swert
  0 siblings, 1 reply; 5+ messages in thread
From: Lucas De Marchi @ 2015-10-25 15:58 UTC (permalink / raw)
  To: Philippe De Swert; +Cc: linux-modules

On Fri, Oct 16, 2015 at 9:04 AM, Philippe De Swert
<philippedeswert@gmail.com> wrote:
> Hi Lucas,
>
> On 11/10/15 21:59, Lucas De Marchi wrote:
>>
>> Hi Pom: Philippe De Swert <philippe.deswert@jollamobile.com>
>>
>> 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.
>> I'd encourage people for actually *not* using -f.
>
>
> Well unfortunately we still do not live in a perfect world yet. Reality is
> that I had to yet again
> deal with a mystery module from the deep...
>>
>> I have mixed feelings here because this is disabled in insmod since
>> forever (it's already on the first git commit from module-init-tools).
>> If anyone knows the reason it would be nice... at least to include in
>> the commit message.
>
>
> Well the weirdest thing is that it is ignored without warning. With as a
> result it lets you wonder why it
> did not work. I wasted quite some time checking if the last -f fix actually
> did what it was supposed to do.
> As making -f work was not that hard I quickly did it. Another option would
> at least let the user of it know
> that it won't work. However imho insmod -f is the first command you will use
> trying to insert a mystery module
> as it will most likely also not be visible to modprobe as the location of it
> can be arbitrary.

Agreed.  I applied this patch. If things go bad we can rollback.

thanks

Lucas De Marchi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] insmod: do support -f
  2015-10-25 15:58     ` Lucas De Marchi
@ 2015-10-26 10:28       ` Philippe De Swert
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe De Swert @ 2015-10-26 10:28 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

Hi Lucas,

On 25/10/15 17:58, Lucas De Marchi wrote:
>
> I have mixed feelings here because this is disabled in insmod since
> forever (it's already on the first git commit from module-init-tools).
> If anyone knows the reason it would be nice... at least to include in
> the commit message.

Well that is still something I would like to know too ;)
> Agreed.  I applied this patch. If things go bad we can rollback.
>
>
Thanks!

Philippe

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-26 10:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-07 15:36 [PATCH] insmod: do support -f philippedeswert
2015-10-11 18:59 ` Lucas De Marchi
2015-10-16 12:04   ` Philippe De Swert
2015-10-25 15:58     ` Lucas De Marchi
2015-10-26 10:28       ` Philippe De Swert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).