Page MenuHomeFreeBSD

LinuxKPI: Add linux/capability.h header
ClosedPublic

Authored by wulf on Dec 19 2021, 11:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 4, 8:52 AM
Unknown Object (File)
Tue, Aug 13, 5:39 AM
Unknown Object (File)
Jul 26 2024, 7:08 PM
Unknown Object (File)
Jul 13 2024, 5:27 PM
Unknown Object (File)
Jun 30 2024, 3:48 AM
Unknown Object (File)
May 12 2024, 1:49 PM
Unknown Object (File)
May 11 2024, 6:45 AM
Unknown Object (File)
May 10 2024, 11:50 PM

Details

Summary

Required by drm-kmod.

Obtained from: DragonflyBSD
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wulf requested review of this revision.Dec 19 2021, 11:22 AM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/capability.h
35

This line you can remove. Doesn't say anything useful.

This revision is now accepted and ready to land.Dec 19 2021, 11:27 AM
sys/compat/linuxkpi/common/include/linux/capability.h
46

Currently in drm-kmod for CAP_SYS_NICE we check PRIV_DRIVER too. But I'm not familiar with this subsystem to check if this one is better.

sys/compat/linuxkpi/common/include/linux/capability.h
46

Currently in drm-kmod for CAP_SYS_NICE we check PRIV_DRIVER too. But I'm not familiar with this subsystem to check if this one is better.

Here is comments of CAP_SYS_NICE and PRIV_SCHED_SETPRIORITY collected in code and docs:

Linux capabilities(7): CAP_SYS_NICE Lower the process nice value
FreeBSD sys/priv.h: #define PRIV_SCHED_SETPRIORITY 201 /* Can set lower nice value for proc. */
drm-kmod include/uapi/drm/amdgpu_drm.h: * When used in struct drm_amdgpu_ctx_in, a priority above NORMAL requires CAP_SYS_NICE
drm-kmod i915 code:

if (priority > I915_CONTEXT_DEFAULT_PRIORITY &&
    !capable(CAP_SYS_NICE))
        return -EPERM;

It looks that PRIV_SCHED_SETPRIORITY matches CAP_SYS_NICE better than PRIV_DRIVER

manu added inline comments.
sys/compat/linuxkpi/common/include/linux/capability.h
46

Fine by me then.

This revision was automatically updated to reflect the committed changes.