Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-qy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-qy
  • Repository
  • linux-qy
  • drivers
  • net
  • ethernet
  • mellanox
  • mlx4
  • main.c
Find file BlameHistoryPermalink
  • Jiri Pirko's avatar
    devlink: disallow reload operation during device cleanup · 5a508a25
    Jiri Pirko authored Nov 09, 2019
    
    
    There is a race between driver code that does setup/cleanup of device
    and devlink reload operation that in some drivers works with the same
    code. Use after free could we easily obtained by running:
    
    while true; do
            echo "0000:00:10.0" >/sys/bus/pci/drivers/mlxsw_spectrum2/bind
            devlink dev reload pci/0000:00:10.0 &
            echo "0000:00:10.0" >/sys/bus/pci/drivers/mlxsw_spectrum2/unbind
    done
    
    Fix this by enabling reload only after setup of device is complete and
    disabling it at the beginning of the cleanup process.
    
    Reported-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Fixes: 2d8dc5bb
    
     ("devlink: Add support for reload")
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5a508a25