From: "Bjørn Mork" <bjorn@mork.no>
To: "Emilio López" <emilio.lopez@collabora.co.uk>
Cc: gregkh@linuxfoundation.org, stern@rowland.harvard.edu,
kborer@gmail.com, k.opasiak@samsung.com, reillyg@chromium.org,
keescook@chromium.org, linux-api@vger.kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
jorgelo@chromium.org, dan.carpenter@oracle.com
Subject: Re: [PATCH v2] usb: devio: Add ioctl to disallow detaching kernel USB drivers.
Date: Mon, 25 Jan 2016 09:39:43 +0100 [thread overview]
Message-ID: <87powqrr1s.fsf@nemi.mork.no> (raw)
In-Reply-To: <56A57D0C.6030308@collabora.co.uk> ("Emilio =?utf-8?Q?L=C3=B3?= =?utf-8?Q?pez=22's?= message of "Sun, 24 Jan 2016 22:40:28 -0300")
Emilio López <emilio.lopez@collabora.co.uk> writes:
>>> diff --git a/include/uapi/linux/usbdevice_fs.h b/include/uapi/linux/usbdevice_fs.h
>>> index 019ba1e..9abcb34 100644
>>> --- a/include/uapi/linux/usbdevice_fs.h
>>> +++ b/include/uapi/linux/usbdevice_fs.h
>>> @@ -154,6 +154,10 @@ struct usbdevfs_streams {
>>> unsigned char eps[0];
>>> };
>>>
>>> +struct usbdevfs_drop_privs {
>>> + unsigned long interface_allowed_mask;
>>> +};
>>> +
>>
>> "unsigned long" isn't a very good choice here, is it?
>
> I went with a type matching ifclaimed on struct usb_dev_state to keep
> the limit the same, but I guess it's not the best idea for an ioctl. I
> can switch it to __u32, keeping the runtime check above as is, or use
> __u64. Which one would you prefer?
I don't feel much like an expert here, but I can certainly make up an
opinion anyway :)
Since 64bits kernels allow usb devio with interface numbers up to 63, I
guess you need __u64 to avoid limiting the range? Limiting will create
all sorts of followup problems, so it's definitely easiest to just go
with __u64.
Bjørn
next prev parent reply other threads:[~2016-01-25 8:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 15:45 [PATCH v1 0/1] " Emilio López
2015-11-25 15:45 ` [PATCH v1] usb: devio: Add " Emilio López
2015-11-26 8:59 ` Peter Chen
2015-11-26 9:20 ` Dan Carpenter
2015-11-26 9:19 ` [PATCH v1 0/1] " Krzysztof Opasiak
2015-11-26 17:29 ` Greg KH
2015-11-27 8:44 ` Krzysztof Opasiak
2015-11-28 2:39 ` Greg KH
2015-11-30 9:08 ` Oliver Neukum
2015-11-30 16:16 ` Alan Stern
2015-11-30 17:12 ` Krzysztof Opasiak
2015-11-30 17:20 ` Greg KH
2015-11-30 18:48 ` Krzysztof Opasiak
2016-01-19 16:39 ` Emilio López
2016-01-19 18:07 ` Greg KH
2016-01-21 23:54 ` [PATCH v2] usb: devio: Add " Emilio López
2016-01-22 9:41 ` Bjørn Mork
2016-01-25 1:40 ` Emilio López
2016-01-25 8:39 ` Bjørn Mork [this message]
2016-01-25 15:21 ` Alan Stern
2016-01-25 15:32 ` Bjørn Mork
2016-01-25 15:46 ` Alan Stern
2016-01-22 16:10 ` Alan Stern
2016-01-25 2:01 ` Emilio López
2016-02-04 3:20 ` [PATCH v3] " Emilio López
2016-02-04 3:46 ` Greg KH
2016-02-04 16:27 ` Alan Stern
2016-02-08 1:56 ` Emilio López
2016-02-15 1:41 ` [PATCH v4] " Emilio López
2016-02-18 18:44 ` Alan Stern
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=87powqrr1s.fsf@nemi.mork.no \
--to=bjorn@mork.no \
--cc=dan.carpenter@oracle.com \
--cc=emilio.lopez@collabora.co.uk \
--cc=gregkh@linuxfoundation.org \
--cc=jorgelo@chromium.org \
--cc=k.opasiak@samsung.com \
--cc=kborer@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=reillyg@chromium.org \
--cc=stern@rowland.harvard.edu \
/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
all inboxes | Powered by JetHome®