Skip to contentSkip to conversation

another kconfig target for building monolithic kernel (for security) ?

DISCUSSION [email protected] 1 participant 1 message Apr 30, 2006

lore
Share & tools
lore
#0 lore raw

hello !

thanks for help - i found that there seems another way for securing /dev/{k}mem (at least in recent kernels) - the docomentation for the "BSD Secure Levels Linux Security Module" (at Documentation/seclvl.txt) tells:

Level 1 (Default):
- /dev/mem and /dev/kmem are read-only
- IMMUTABLE and APPEND extended attributes, if set, may not be unset
- Cannot load or unload kernel modules
- Cannot write directly to a mounted block device
- Cannot perform raw I/O operations
- Cannot perform network administrative tasks
- Cannot setuid any file

so - no need for compiling a static/monolithic kernel anymore !?

regards
roland

Quoted 35 lines

-----Ursprüngliche Nachricht-----
Von: Nix <[email protected]>
Gesendet: 30.04.06 12:57:49
An: Arjan van de Ven <[email protected]>
CC: [email protected], [email protected]
Betreff: Re: another kconfig target for building monolithic kernel (for security) ?

On 29 Apr 2006, Arjan van de Ven prattled cheerily:

Quoted 9 lines · Dave Jones
Quoted 6 lines · On Sat, Apr 29, 2006 at 03:03:55PM +0200, [email protected] wrote:
Quoted 2 lines

i want to harden a linux system (dedicated root server on the internet) by recompiling the kernel without support for lkm (to prevent installation of lkm based rootkits etc)

Loading modules via /dev/kmem is trivial thanks to a bunch of tutorials and examples on the web, so this alone doesn't make life that much more difficult for attackers.

/dev/kmem should be a config option too though

Yeah, but in practice this should work (somewhat old patch, should still apply):

diff -durN 2.6.14-seal-orig/include/linux/capability.h 2.6.14-seal/include/linux/capability.h

include/linux/capability.h +1 -1
@@ -311,7 +311,7 @@
 
 #define CAP_EMPTY_SET       to_cap_t(0)
 #define CAP_FULL_SET        to_cap_t(~0)
-#define CAP_INIT_EFF_SET    to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP))
+#define CAP_INIT_EFF_SET    to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP) & ~CAP_TO_MASK(CAP_SYS_RAWIO))
 #define CAP_INIT_INH_SET    to_cap_t(0)
 
 #define CAP_TO_MASK(x) (1 << (x))
Quoted 8 lines
Quoted 1 line

(and /dev/mem should get the filter patch that fedora has ;-)

Agreed.

Signature · 3 lines
`On a scale of 1-10, X's "brokenness rating" is 1.1, but that's only
 because bringing Windows into the picture rescaled "brokenness" by
 a factor of 10.' --- Peter da Silva

_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192