mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Re: [PATCH] char:misc minor is overflowing
@ 2015-12-14 12:33 Shivnandan Kumar
  0 siblings, 0 replies; only message in thread
From: Shivnandan Kumar @ 2015-12-14 12:33 UTC (permalink / raw)
  To: One Thousand Gnomes, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel
  Cc: Nitin Gupta, Vidushi Koul, Gaurav Kohli, Rajat Suri,
	Shailesh Pandey, shiv.jnumca08

[-- 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¥

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-14 12:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-14 12:33 Re: [PATCH] char:misc minor is overflowing Shivnandan Kumar

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®