Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH -next 0/2] Fix call security_backing_file_free second time
@ 2026-06-26  1:17 Cai Xinchen
  2026-06-26  1:17 ` [PATCH -next 1/2] security: Some cleanup code Cai Xinchen
  2026-06-26  1:17 ` [PATCH -next 2/2] security: Fix call security_backing_file_free second time Cai Xinchen
  0 siblings, 2 replies; 5+ messages in thread
From: Cai Xinchen @ 2026-06-26  1:17 UTC (permalink / raw)
  To: paul, jmorris, serge, stephen.smalley.work, omosnace, amir73il,
	brauner
  Cc: linux-security-module, linux-kernel, selinux, caixinchen1,
	lujialin4

I found the following path:

alloc_empty_backing-file
    init_file(&ff->file, xxx)
        -> file_ref_init(&f->f_ref, 1); // only 1
    error = init_backing_file
        -> security_backing_file_alloc
        -> rc = call_int_hook(backing_file_alloc, ...)
           if (unlikely(rc))
                security_backing_file_free(backing_file); // first call
    if (unlikely(error)) {
        fput(&ff->file);
         -> if (unlikely(file_ref_put(&file->f_ref))) // zero
                __fput_deferred(file);
                 -> ____fput -> __fput -> file_free(file);
                 -> backing_file_free(backing_file(f));
                 -> security_backing_file_free(&ff->file); // second call

Cai Xinchen (2):
  security: Some cleanup code
  security: Fix call security_backing_file_free second time

 security/lsm_init.c      | 1 -
 security/security.c      | 5 +----
 security/selinux/hooks.c | 1 -
 3 files changed, 1 insertion(+), 6 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-02 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26  1:17 [PATCH -next 0/2] Fix call security_backing_file_free second time Cai Xinchen
2026-06-26  1:17 ` [PATCH -next 1/2] security: Some cleanup code Cai Xinchen
2026-07-02 21:09   ` [PATCH " Paul Moore
2026-06-26  1:17 ` [PATCH -next 2/2] security: Fix call security_backing_file_free second time Cai Xinchen
2026-07-02 21:09   ` [PATCH " Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox