From: Shivnandan Kumar <shivnandan.k@samsung.com>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Nitin Gupta <nitin.gupta@samsung.com>,
Vidushi Koul <vidushi.koul@samsung.com>,
Gaurav Kohli <gaurav.k6@samsung.com>,
Rajat Suri <rajat.suri@samsung.com>,
Shailesh Pandey <p.shailesh@samsung.com>,
"shiv.jnumca08@gmail.com" <shiv.jnumca08@gmail.com>
Subject: Re: Re: [PATCH] char:misc minor is overflowing
Date: Mon, 14 Dec 2015 12:33:46 +0000 (GMT) [thread overview]
Message-ID: <449107773.668471450096425280.JavaMail.weblogic@epmlwas05c> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 2030 bytes --]
Hi Alan,
Thanks for your reply.
Patch is not intended to increase DYNAMIC_MINORS from 64.
The error hadling in misc_register is not perfect.
Ideally, when misc minor number limit exceed then it should return -EBUSY instead of already
reserved minor number.
For example, in my case value of "i" in function misc_register is 62, so misc_minor becomes 1.
Which should not have happened, in this case it should return -EBUSY, as minor number 1 is reserved for PSMOUSE.
In error handling condition, it should consider already reserved minor numbers also.
This condition seems to be changed/modified.
"if (i >= DYNAMIC_MINORS) {
mutex_unlock(&misc_mtx);
return -EBUSY;
}"
Thanks,
Shivnandan
------- Original Message -------
Sender : One Thousand Gnomes<gnomes@lxorguk.ukuu.org.uk>
Date : Dec 09, 2015 22:35 (GMT+09:00)
Title : Re: [PATCH] char:misc minor is overflowing
On Wed, 09 Dec 2015 12:51:33 +0000 (GMT)
Nitin Gupta wrote:
> Hi,
>
> Is there any modification / improvement needed in this patch ?
>
> ------- Original Message -------
> Sender : Shivnandan Kumar Engineer/SRI-Noida-Advance Solutions - System 1 R&D Group/Samsung Electronics
> Date : Nov 20, 2015 15:35 (GMT+05:30)
> Title : [PATCH] char:misc minor is overflowing
>
> When a driver register as a misc driver and
> it tries to allocate minor number dynamically.
> Then there is a chance of minor number overflow.
> The problem is that 64(DYNAMIC_MINORS) is not enough
If you are allocating more than the odd minor number you shouldn't be
using misc devices in the first place but should be using
cdev_init/cdev_add/register_chrdev_region and friends.
So 64 really should never be "not enough". miscdevice is more historical
than useful and really goes back to the days long before all the region
allocators existed.
Alan
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
reply other threads:[~2015-12-14 12:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=449107773.668471450096425280.JavaMail.weblogic@epmlwas05c \
--to=shivnandan.k@samsung.com \
--cc=arnd@arndb.de \
--cc=gaurav.k6@samsung.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nitin.gupta@samsung.com \
--cc=p.shailesh@samsung.com \
--cc=rajat.suri@samsung.com \
--cc=shiv.jnumca08@gmail.com \
--cc=vidushi.koul@samsung.com \
/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®