sysfs_unbre...e_protection(9)
okay bestie, welcome to the Kernel API Manual page for sysfs_unbreak_active_protection(9) πβ¨ this one is short but the safety note is lowkey important.
π NAME π
sysfs_unbreak_active_protectionβ restore "active" protection π
β¨ SYNOPSIS β¨
void sysfs_unbreak_active_protection (struct kernfs_node *kn );
πΈ ARGUMENTS πΈ
knβ the pointer returned bysysfs_break_active_protection. That's it, that's the argument π«Ά
π¦ DESCRIPTION π¦
okay so this function literally undoes the effects of sysfs_break_active_protection π. Since this function calls kernfs_put on the kernfs node that corresponds to the 'attr' argument passed to sysfs_break_active_protection, that attribute may have been removed between the sysfs_break_active_protection and sysfs_unbreak_active_protection calls.
so fr fr: it is not safe to access kn after this function has returned. no cap, don't do it ππ
π SEE ALSO π
these are the references, periodt:
- Kernel file
./fs/sysfs/file.c sysfs_create_file_ns(9)sysfs_add_file_to_group(9)sysfs_chmod_file(9)sysfs_break_active_protection(9)sysfs_remove_file_ns(9)sysfs_remove_file_self(9)sysfs_remove_file_from_group(9)sysfs_create_bin_file(9)sysfs_remove_bin_file(9)sysfs_link_change_owner(9)sysfs_file_change_owner(9)sysfs_change_owner(9)sysfs_emit(9)sysfs_emit_at(9)sysfs_bin_attr_simple_read(9)
okay bye bestie!! source/version: ./fs/sysfs Β· date: October 2026 Β· footer title: sysfs_unbre...e_protection(9) ππβ¨
π¦ 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