From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-hotplug@vger.kernel.org
Subject: Re: file2alias - incorrect? aliases for USB
Date: Mon, 17 Nov 2003 03:09:32 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-106904930222797@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-106840503223499@msgid-missing>
In message <20031110093703.GA5449@kroah.com> you write:
> Hm, but that's no good either, because the visor driver trips over that
> with its entry:
> MODULE_ALIAS("usb:v*p*dl*dh*dc*dsc*dp*ic*isc*ip*");
> and the improper module is loaded. That needs to be fixed up...
>
> Rusty, any reason why the module alias code is turning an empty
> MODULE_PARAM structure, as is declared in drivers/usb/serial/visor.c
> with the line:
> { }, /* optional parameter entry */
>
> Into the above MODULE_ALIAS? I don't think that's correct.
Sorry for the delay, was away and am catching up on mail.
Thanks to Andrey for the fix. Greg, did you want to add something
else? Either way, please forward to Linus.
Andrey: the reason everything is in there is I didn't know what Greg
wanted. He OK'd it, but I'm happy for them to be trimmed, too.
Subject: [PATCH][2.6.0-test9] prevent catch-all USB aliases in modules.alias
From: Andrey Borzenkov
Date: 2003-11-03 16:45:03
visor.c defines one empty slot in USB ids table that can be filled in at
runtime using module parameters. file2alias generates catch-all alias for it:
alias usb:v*p*dl*dh*dc*dsc*dp*ic*isc*ip* visor
patch adds the same sanity check as in depmod to scripts/file2alias.
regards
-andrey
*["2.6.0-test9-file2alias_visor.patch" (text/x-diff)]*
--- ../tmp/linux-2.6.0-test9/scripts/file2alias.c 2003-07-27 22:29:49.000000000 +0400
+++ linux-2.6.0-test9/scripts/file2alias.c 2003-11-03 19:40:47.744746456 +0300
@@ -52,6 +52,13 @@ static int do_usb_entry(const char *file
id->bcdDevice_lo = TO_NATIVE(id->bcdDevice_lo);
id->bcdDevice_hi = TO_NATIVE(id->bcdDevice_hi);
+ /*
+ * Some modules (visor) have empty slots as placeholder for
+ * run-time specification that results in catch-all alias
+ */
+ if (!(id->idVendor | id->bDeviceClass | id->bInterfaceClass))
+ return 1;
+
strcpy(alias, "usb:");
ADD(alias, "v", id->match_flags&USB_DEVICE_ID_MATCH_VENDOR,
id->idVendor);
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2003-11-17 3:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-09 18:55 file2alias - incorrect? aliases for USB Andrey Borzenkov
2003-11-10 9:37 ` Greg KH
2003-11-14 1:02 ` Greg KH
2003-11-17 3:09 ` Rusty Russell [this message]
2003-11-17 18:11 ` Andrey Borzenkov
2003-12-11 9:29 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2003-11-17 6:24 "Andrey Borzenkov"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-hotplug-106904930222797@msgid-missing \
--to=rusty@rustcorp.com.au \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).