Fix incorrect /dev/ prefix that breaks network interfaces#110
Open
opsiff wants to merge 1 commit into
Open
Conversation
The commit 7ee5b45 ("PCMCIA IDE devices should now be properly reported") introduced automatic /dev/ prefixing to merge IDE and PCMCIA logical names. However, this caused network interface names to be mangled when character devices with the same name exist in /dev (e.g., vmnet1), leading to failed ioctl calls in scan_ip() and potential modprobe blocking when run as root. Remove overzealous automatic /dev/ prefixing from setLogicalName() and move the /dev/ path handling to specific device scanning code where it's actually appropriate: hw.cc: strip out the problematic auto-prefixing logic ide.cc: explicitly check and set /dev/ paths for IDE block devices pcmcia-legacy.cc: explicitly check and set /dev/ paths for PCMCIA devices PS: modprobe had bug when pread/read some char devices. Link: https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/2069649 Link: https://bbs.deepin.org.cn/post/291466 Reported-by: Qi Xu <xuqi@uniontech.com> Reported-by: lionheartyu <dongshengyuan@uniontech.com> Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
opsiff
added a commit
to opsiff/kmod
that referenced
this pull request
Jan 15, 2026
use lseek SEEK_CUR to get whether it is a regular file, lseek return -ESPIPE when fd is associated with a pipe, socket, or FIFO. commit 883d931 upstream ("modprobe: Allow passing path to module") allow to modprobe a file, but not handle opening a FIFO device such as modprobe /dev/tty1. commit 8d03b6c uptream ("libkmod: Use pread where appropriate") fix some cases, such ad open /dev/tty1, but not for /dev/vmnet0 or /dev/userio etc. Can be reproduced in run lshw in root and install some vm such ad vmware, more about the case are in the Link. Link: lyonel/lshw#110 Link: https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/2069649 Link: https://bbs.deepin.org.cn/post/291466 Reported-by: Qi Xu <xuqi@uniontech.com> Reported-by: lionheartyu <dongshengyuan@uniontech.com> Fixes: 883d931 ("modprobe: Allow passing path to module") Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
opsiff
added a commit
to opsiff/kmod
that referenced
this pull request
Jan 15, 2026
use lseek SEEK_CUR to get whether it is a regular file, lseek return -ESPIPE when fd is associated with a pipe, socket, or FIFO. commit 883d931 upstream ("modprobe: Allow passing path to module") allow to modprobe a file, but not handle opening a FIFO device such as modprobe /dev/tty1. commit 8d03b6c uptream ("libkmod: Use pread where appropriate") fix some cases, such as open /dev/tty1, but not for /dev/vmnet0 or /dev/userio etc. Can be reproduced in run lshw in root and install some vm such ad vmware, more about the case are in the Link. Link: lyonel/lshw#110 Link: https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/2069649 Link: https://bbs.deepin.org.cn/post/291466 Reported-by: Qi Xu <xuqi@uniontech.com> Reported-by: lionheartyu <dongshengyuan@uniontech.com> Fixes: 883d931 ("modprobe: Allow passing path to module") Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
opsiff
added a commit
to opsiff/kmod
that referenced
this pull request
Feb 19, 2026
use lseek SEEK_CUR to get whether it is a regular file, lseek return -ESPIPE when fd is associated with a pipe, socket, or FIFO. commit 883d931 upstream ("modprobe: Allow passing path to module") allow to modprobe a file, but not handle opening a FIFO device such as modprobe /dev/tty1. commit 8d03b6c uptream ("libkmod: Use pread where appropriate") fix some cases, such as open /dev/tty1, but not for /dev/vmnet0 or /dev/userio etc. Can be reproduced in run lshw in root and install some vm such ad vmware, more about the case are in the Link. Reference: lyonel/lshw#110 Closes: https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/2069649 Closes: https://bbs.deepin.org.cn/post/291466 Reported-by: Qi Xu <xuqi@uniontech.com> Reported-by: lionheartyu <dongshengyuan@uniontech.com> Fixes: 883d931 ("modprobe: Allow passing path to module") Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
lucasdemarchi
pushed a commit
to kmod-project/kmod
that referenced
this pull request
Feb 22, 2026
use lseek SEEK_CUR to get whether it is a regular file, lseek return -ESPIPE when fd is associated with a pipe, socket, or FIFO. commit 883d931 upstream ("modprobe: Allow passing path to module") allow to modprobe a file, but not handle opening a FIFO device such as modprobe /dev/tty1. commit 8d03b6c uptream ("libkmod: Use pread where appropriate") fix some cases, such as open /dev/tty1, but not for /dev/vmnet0 or /dev/userio etc. Can be reproduced in run lshw in root and install some vm such ad vmware, more about the case are in the Link. Reference: lyonel/lshw#110 Closes: https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/2069649 Closes: https://bbs.deepin.org.cn/post/291466 Reported-by: Qi Xu <xuqi@uniontech.com> Reported-by: lionheartyu <dongshengyuan@uniontech.com> Fixes: 883d931 ("modprobe: Allow passing path to module") Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Reviewed-by: Lucas De Marchi <demarchi@kernel.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Link: #407 Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The commit 7ee5b45 ("PCMCIA IDE devices should now be properly reported") introduced automatic /dev/ prefixing to merge IDE and PCMCIA logical names. However, this caused network interface names to be mangled when character devices with the same name exist in /dev (e.g., vmnet1), leading to failed ioctl calls in scan_ip() and potential modprobe blocking when run as root.
Remove overzealous automatic /dev/ prefixing from setLogicalName() and move the /dev/ path handling to specific device scanning code where it's actually appropriate:
hw.cc: strip out the problematic auto-prefixing logic ide.cc: explicitly check and set /dev/ paths for IDE block devices pcmcia-legacy.cc: explicitly check and set /dev/ paths for PCMCIA devices
PS: modprobe had bug when pread/read some char devices.
Link: https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/2069649
Link: https://bbs.deepin.org.cn/post/291466
Reported-by: Qi Xu xuqi@uniontech.com
Reported-by: lionheartyu dongshengyuan@uniontech.com