Skip to contentSkip to conversation

mm: add devmem_is_allowed() for STRICT_DEVMEM checking

S390 Dave Jones 2 participants 2 messages Nov 17, 2010 – Nov 18, 2010 1 message not in the archive

lore
Share & tools
lore

Dave Jones

author
#1 lore raw
In reply to a message not in the archive
Quoted 8 lines · Linux Kernel
Gitweb:     http://git.kernel.org/linus/ec6743bb06510c7b629603ce35713d6ae9273579
Commit:     ec6743bb06510c7b629603ce35713d6ae9273579
Parent:     ca768b663131ca644689fcadc9ca092dcc96a758
Author:     Hendrik Brueckner <[email protected]>
AuthorDate: Wed Nov 10 10:05:55 2010 +0100
Committer:  Martin Schwidefsky <[email protected]>
CommitDate: Wed Nov 10 10:05:54 2010 +0100
Quoted 8 lines

[S390] mm: add devmem_is_allowed() for STRICT_DEVMEM checking

Provide the devmem_is_allowed() routine to restrict access to kernel memory from userspace.
Set the CONFIG_STRICT_DEVMEM config option to switch on checking.

[snip add kconfig]

...

Review

Quoted 4 lines
(quoted diff) +4 -0
+static inline int devmem_is_allowed(unsigned long pfn)
+{
+	return 0;
+}

So you add the config option that promises security, but then you always allow the access. This seems pointless ? Why bother having the option at all?

Dave

#2 lore raw
Quoted 22 lines · On Wed, 17 Nov 2010 13:03:21 -0500 Dave Jones <[email protected]> wrote:
Quoted 8 lines · Linux Kernel
Gitweb:     http://git.kernel.org/linus/ec6743bb06510c7b629603ce35713d6ae9273579
Commit:     ec6743bb06510c7b629603ce35713d6ae9273579
Parent:     ca768b663131ca644689fcadc9ca092dcc96a758
Author:     Hendrik Brueckner <[email protected]>
AuthorDate: Wed Nov 10 10:05:55 2010 +0100
Committer:  Martin Schwidefsky <[email protected]>
CommitDate: Wed Nov 10 10:05:54 2010 +0100
Quoted 8 lines

[S390] mm: add devmem_is_allowed() for STRICT_DEVMEM checking

Provide the devmem_is_allowed() routine to restrict access to kernel memory from userspace.
Set the CONFIG_STRICT_DEVMEM config option to switch on checking.

[snip add kconfig]

...

Quoted 7 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+static inline int devmem_is_allowed(unsigned long pfn)
+{
+	return 0;
+}

So you add the config option that promises security, but then you always allow the access. This seems pointless ? Why bother having the option at all?

It is the other way around, access is always disallowed. So it is very secure, access via /dev/mem is disabled if STRICT_DEVMEM=y.

Signature · 4 lines
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.