Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • T tails
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,015
    • Issues 1,015
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • tails
  • tails
  • Issues
  • #17784
Closed
Open
Issue created Jun 25, 2020 by geb@gebReporter

MAC spoofing failure handling code tries to reads unexisting files and may not be able to find interface name

Hi,

While working on #17779 (closed), I noticed that mac spoofing (or more precisely tails-shell-library/hardware.sh's get_name_of_nic try to read files that may not exists, I believe depending of the driver and its status (the one I tested with, r8188eu, is in staging).

with bash -x :

++ get_module_used_by_nic wlan1
+++ readlink /sys/class/net/wlan1/device/driver/module
++ basename ../../../../module/r8188eu
+ module=r8188eu
++ get_name_of_nic wlan1
+++ sed 's/^0x\(.*\)$/\1/' /sys/class/net/wlan1/device/vendor
sed: can't read /sys/class/net/wlan1/device/vendor: No such file or directory
++ vendor=
+++ sed 's/^0x\(.*\)$/\1/' /sys/class/net/wlan1/device/device
sed: can't read /sys/class/net/wlan1/device/device: No such file or directory
++ device=
++ lspci -nn
++ sed -n 's/^\S\+\s\+[^:]\+:\s\+\(.*\)\s\+\[:\].*$/\1/p'
+ nic_name=
+ nic_exists wlan1
+ '[' -e /sys/class/net/wlan1 ']'

It makes the parsing of lspci fragile and seems error prone as it could ends with more unset or empty variables.

Additionally, it rely solely on lspci, and would obviously not find USB adapters, that are quite common.

Parent Task: #14534

Related to: #16707 (closed), #11941 (closed), #16260

Edited Jun 26, 2020 by intrigeri
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking