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
  • kernel
  • user.c
Find file BlameHistoryPermalink
  • Jason Gunthorpe's avatar
    kernel/user: Allow user_struct::locked_vm to be usable for iommufd · ce5a23c8
    Jason Gunthorpe authored Nov 29, 2022
    Following the pattern of io_uring, perf, skb, and bpf, iommfd will use
    user->locked_vm for accounting pinned pages. Ensure the value is included
    in the struct and export free_uid() as iommufd is modular.
    
    user->locked_vm is the good accounting to use for ulimit because it is
    per-user, and the security sandboxing of locked pages is not supposed to
    be per-process. Other places (vfio, vdpa and infiniband) have used
    mm->pinned_vm and/or mm->locked_vm for accounting pinned pages, but this
    is only per-process and inconsistent with the new FOLL_LONGTERM users in
    the kernel.
    
    Concurrent work is underway to try to put this in a cgroup, so everything
    can be consistent and the kernel can provide a FOLL_LONGTERM limit that
    actually provides security.
    
    Link: https://lore.kernel.org/r/7-v6-a196d26f289e+11787-iommufd_jgg@nvidia.com
    
    
    Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
    Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
    Tested-by: default avatarNicolin Chen <nicolinc@nvidia.com>
    Tested-by: default avatarYi Liu <yi.l.liu@intel.com>
    Tested-by: default avatarLixiao Yang <lixiao.yang@intel.com>
    Tested-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    ce5a23c8
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7