Messages in this thread | | | From | Aleksandr Nogikh <> | Date | Tue, 10 Nov 2020 21:35:02 +0300 | Subject | Re: [PATCH v3 1/2] security: add fault injection capability |
| |
On Tue, Nov 10, 2020 at 7:43 AM Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote: > [...] > > By the way, fail_lsm_hooks.retval is "signed int" but debugfs_create_u32() handles "unsigned int". > Do we want to allow lsm_hooks_inject_fail() to inject arbitrary !IS_ERR_VALUE() values?
Thanks for pointing it out. Technically, now it's possible to set a negative value - internally, the kernel will process negative integers anyway, and after casting the unsigned value to a signed one, retval will contain exactly what the user provided. However, if the user retrieves the attribute value, they won't get the exact value that was set (if it was negative).
I'll change debugfs_create_u32 to something else in v4, so that it'll be more explicit and so that it'll be possible to read negative values normally.
| |