Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • net
  • socket.c
Find file BlameHistoryPermalink
  • Johannes Berg's avatar
    socket: fix struct ifreq size in compat ioctl · 1cebf8f1
    Johannes Berg authored Sep 13, 2018
    As reported by Reobert O'Callahan, since Viro's commit to kill
    dev_ifsioc() we attempt to copy too much data in compat mode,
    which may lead to EFAULT when the 32-bit version of struct ifreq
    sits at/near the end of a page boundary, and the next page isn't
    mapped.
    
    Fix this by passing the approprate compat/non-compat size to copy
    and using that, as before the dev_ifsioc() removal. This works
    because only the embedded "struct ifmap" has different size, and
    this is only used in SIOCGIFMAP/SIOCSIFMAP which has a different
    handler. All other parts of the union are naturally compatible.
    
    This fixes https://bugzilla.kernel.org/show_bug.cgi?id=199469.
    
    Fixes: bf440573
    
     ("kill dev_ifsioc()")
    Reported-by: default avatarRobert O'Callahan <robert@ocallahan.org>
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1cebf8f1
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7