Bug 113554 - Linux device number bug report
Summary: Linux device number bug report
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kudzu
Version: 3.0
Hardware: i386
OS: Linux
high
high
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-15 08:05 UTC by ljh
Modified: 2014-03-17 02:41 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-02-05 01:18:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description ljh 2004-01-15 08:05:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2)

Description of problem:
As following, "major" should be 12-bit, and "minor" should be 20-
bit.   mmmm mmmm mmmm MMMM MMMM MMMM mmmm mmmm
But I find that âkudzu-1.1.36-1â uses structure dev_t and the 
operation in file pcmcia.c: 385

       dev = (pcmcia_major<<8) + sock 

If sock is greater than 256, it may has problem. So I suggest useing  
macro makedev (in <include/sys/sysmacros.h>) to create device number.


Version-Release number of selected component (if applicable):
kudzu-1.1.36-1

How reproducible:
Didn't try


Additional info:

Comment 1 Bill Nottingham 2004-02-05 01:18:31 UTC
The code is:

static int open_sock(int sock) {
        dev_t dev = (pcmcia_major<<8) + sock;

It's called as:

                for (ns = 0; ns < 8; ns++) {
                        fd = open_sock(ns);

Ergo, it really can't happen.


Comment 2 ljh 2004-02-06 02:36:08 UTC
But I think that if ns is larger than 256, It may have problem. So I 
suggest useing macro makedev (in <include/sys/sysmacros.h>) to create 
device number.


Comment 3 Bill Nottingham 2004-02-06 02:58:49 UTC
See that code snipped. ns is NEVER anything other than between 0 and 8.


Note You need to log in before you can comment on or make changes to this bug.