is_access_to_paths_allowed(9)
okay bestie, welcome to is_access_to_paths_allowed(9) from the Kernel API Manual β the function that checks accesses for requests with a common path. she's giving serious kernel-helper main character energy, and we're obsessed. π
β¨
πΈ NAME πΈ
is_access_to_paths_allowedβ check accesses for requests with a common path. that's the whole gig. π
β¨ SYNOPSIS β¨
here's the signature, exactly as she ships:
bool is_access_to_paths_allowed (const struct landlock_domain *const
domain , const struct path *const path , const access_mask_t
access_request_parent1 , struct layer_masks *layer_masks_parent1 ,
struct landlock_request *const log_request_parent1 , struct dentry
*const dentry_child1 , const access_mask_t access_request_parent2 ,
struct layer_masks *layer_masks_parent2 , struct landlock_request *const
log_request_parent2 , struct dentry *const dentry_child2 );
π«Ά ARGUMENTS π«Ά
okay, argument-by-argument, because every single one matters:
domainβ the domain to check against. πpathβ the file hierarchy to walk through. for refer checks, this would be the common mountpoint. π¦access_request_parent1β the accesses to check, oncelayer_masks_parent1is equal tolayer_masks_parent2(if any). this is tied to the unique requested path for most actions, or the source in case of a refer action (i.e. rename or link), or the source and destination in case ofRENAME_EXCHANGE. love that for us. πlayer_masks_parent1β pointer to a matrix of layer masks per access masks, identifying the layers that forbid a specific access. bits from this matrix can be unset according to the path walk. an empty matrix means thatdomainallows all possible Landlock accesses (i.e. not only those identified byaccess_request_parent1). this matrix can initially refer to domain layer masks and, when the accesses for the destination and source are the same, to requested layer masks. β¨log_request_parent1β audit request to fill if the related access is denied. πdentry_child1β dentry to the initial child of the parent1 path. this pointer must beNULLfor non-refer actions (i.e. not link nor rename). π¨ so please don't play with that one.access_request_parent2β similar toaccess_request_parent1but for a request involving a source and a destination. this refers to the destination, except in case ofRENAME_EXCHANGEwhere it also refers to the source. must be set to0when using a simple path request. π₯layer_masks_parent2β similar tolayer_masks_parent1but for a refer action. this must beNULLotherwise. π«Άlog_request_parent2β audit request to fill if the related access is denied. πdentry_child2β dentry to the initial child of the parent2 path. this pointer is only set forRENAME_EXCHANGEactions and must beNULLotherwise. π¨
π¦ DESCRIPTION π¦
so the tea β: this helper first checks that the destination has a superset of restrictions compared to the source (if any) for a common path. because of RENAME_EXCHANGE actions, source and destinations may be swapped. then it checks that the collected accesses and the remaining ones are enough to allow the request. that's the whole arc. periodt. π
π RETURN π
True if the access request is granted, false otherwise. simple, iconic, no notes. β
π SEE ALSO π
- Kernel file
./security/landlock/fs.calso points atis_masked_device_ioctl(9),get_inode_id(9),collect_domain_accesses(9),current_check_refer_path(9),unmask_scoped_access(9), andget_required_file_open_access(9). iykyk π§
mwah π β this lil page comes from ./security/landlock, dated October 2026, and it's all about is_access_to_paths_allowed(9). take care of her! π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms