Bug 113554 - Linux device number bug report
Linux device number bug report
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kudzu (Show other bugs)
i386 Linux
high Severity high
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2004-01-15 03:05 EST by ljh
Modified: 2014-03-16 22:41 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-02-04 20:18:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description ljh 2004-01-15 03:05:47 EST
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):

How reproducible:
Didn't try

Additional info:
Comment 1 Bill Nottingham 2004-02-04 20:18:31 EST
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-05 21:36:08 EST
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-05 21:58:49 EST
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.