Skip to contentSkip to conversation

Restrictions on module loading

RFC PATCH Bodo Eggert 2 participants 2 messages Nov 8, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines · Dan Rosenberg

The below patch replaces the existing "modules_disable" sysctl with a finer-grained "modules_restrict" sysctl. By default, this is set at 0, which results in no deviation from normal module loading behavior. When set to 1, unprivileged users cannot trigger the automatic loading of modules. This behavior is based on grsecurity's GRKERNSEC_MODHARDEN setting. The current check is against current_uid(), since several distributions explicitly remove CAP_SYS_MODULE from root processes, some of which incidentally cause (and rely on) the automatic loading of modules. I expect this to be a point of discussion.

- Why don't you offer both?

- What about task switches or work queues?

- It might be more like the expected behavior if you'd used:
0: off, 1: modules completely disabled, 2: CAP_SYS_MODULE, 3: uid==0

Many users will forget to look into the documentation or find the current, stale documentation or just assume a boolean value.

#2 lore raw
Quoted 2 lines · Bodo Eggert

- What about task switches or work queues?

That's indeed a problem. All request_module()s would need auditing and if there's any triggered from a workqueue a new interface that passes the credentials around.

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.