linux/security/apparmor
Al Viro eb028c3345 d_make_discardable(): warn if given a non-persistent dentry
At this point there are very few call chains that might lead to
d_make_discardable() on a dentry that hadn't been made persistent:
calls of simple_unlink() and simple_rmdir() in configfs and
apparmorfs.

Both filesystems do pin (part of) their contents in dcache, but
they are currently playing very unusual games with that.  Converting
them to more usual patterns might be possible, but it's definitely
going to be a long series of changes in both cases.

For now the easiest solution is to have both stop using simple_unlink()
and simple_rmdir() - that allows to make d_make_discardable() warn
when given a non-persistent dentry.

Rather than giving them full-blown private copies (with calls of
d_make_discardable() replaced with dput()), let's pull the parts of
simple_unlink() and simple_rmdir() that deal with timestamps and link
counts into separate helpers (__simple_unlink() and __simple_rmdir()
resp.) and have those used by configfs and apparmorfs.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2025-11-17 23:59:27 -05:00
..
include + Features 2025-08-04 08:17:28 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Kconfig Revert "apparmor: use SHA-256 library API instead of crypto_shash API" 2025-07-15 22:39:22 -07:00
Makefile apparmor: make all generated string array headers const char *const 2025-05-25 20:15:01 -07:00
af_unix.c apparmor/af_unix: constify struct path * arguments 2025-09-15 21:17:10 -04:00
apparmorfs.c d_make_discardable(): warn if given a non-persistent dentry 2025-11-17 23:59:27 -05:00
audit.c apparmor: add support for profiles to define the kill signal 2025-01-18 06:47:12 -08:00
capability.c apparmor: transition from a list of rules to a vector of rules 2025-07-20 02:31:06 -07:00
crypto.c Revert "apparmor: use SHA-256 library API instead of crypto_shash API" 2025-07-15 22:39:22 -07:00
domain.c apparmor: transition from a list of rules to a vector of rules 2025-07-20 02:31:06 -07:00
file.c + Features 2025-08-04 08:17:28 -07:00
ipc.c apparmor: transition from a list of rules to a vector of rules 2025-07-20 02:31:06 -07:00
label.c apparmor: fix typos and spelling errors 2025-02-10 11:17:49 -08:00
lib.c apparmor: fix documentation mismatches in val_mask_to_str and socket functions 2025-07-20 02:19:28 -07:00
lsm.c audit/stable-6.18 PR 20250926 2025-09-30 08:22:16 -07:00
match.c apparmor: fix loop detection used in conflicting attachment resolution 2025-05-25 20:14:53 -07:00
mount.c apparmor: transition from a list of rules to a vector of rules 2025-07-20 02:31:06 -07:00
net.c apparmor: transition from a list of rules to a vector of rules 2025-07-20 02:31:06 -07:00
nulldfa.in
path.c apparmor: Use IS_ERR_OR_NULL() helper function 2024-11-26 19:21:05 -08:00
policy.c apparmor: fix: oops when trying to free null ruleset 2025-08-04 01:14:56 -07:00
policy_compat.c apparmor: add additional flags to extended permission. 2025-01-18 06:47:12 -08:00
policy_ns.c apparmor: Improve debug print infrastructure 2025-01-18 06:47:11 -08:00
policy_unpack.c apparmor: fix: accept2 being specifie even when permission table is presnt 2025-07-20 02:31:13 -07:00
policy_unpack_test.c + Features 2025-08-04 08:17:28 -07:00
procattr.c apparmor: Improve debug print infrastructure 2025-01-18 06:47:11 -08:00
resource.c apparmor: transition from a list of rules to a vector of rules 2025-07-20 02:31:06 -07:00
secid.c lsm: secctx provider check on release 2024-12-04 14:59:57 -05:00
stacksplitdfa.in
task.c apparmor: transition from a list of rules to a vector of rules 2025-07-20 02:31:06 -07:00