Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux kernel how to check whether the sticky bit is set

Tags:

c

linux

kernel

I am working on a linux kernel project whose intent is to modify the kernel to require that certain designated files (such as important system files or system configuration files) are validated before being executed (in case of a binary) or opened for read and write access.

Inside the kernel, we'll only provide validation for files whose sticky bit is set. So anyone knows how to check whether the sticky bit of a file is set inside the kernel?

I searched through the website and only see answers about how to do that in user-land.

like image 244
ppsun Avatar asked Feb 03 '26 11:02

ppsun


1 Answers

See the check_sticky function in fs/namei.c.

like image 80
Michael Foukarakis Avatar answered Feb 05 '26 02:02

Michael Foukarakis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!