Bug 113554 - Linux device number bug report
Summary: Linux device number bug report
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kudzu   
(Show other bugs)
Version: 3.0
Hardware: i386 Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
Depends On:
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:
Story Points: ---
Clone Of:
Last Closed: 2004-02-05 01:18:31 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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):

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.