login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
15
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem default y
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Xiaotian Feng
Subject:
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem default y
Date: Wednesday, April 14, 2010 - 11:28 pm
On Thu, Apr 15, 2010 at 2:17 PM, wzt wzt <wzt.wzt@gmail.com> wrote:
quoted text
> On Thu, Apr 15, 2010 at 2:12 PM, Xiaotian Feng <xtfeng@gmail.com> wrote: >> On Tue, Apr 13, 2010 at 10:52 AM, <wzt.wzt@gmail.com> wrote: >>> Recently, most company start use >=2.6.31 kernels to replace redhat kernels. >>> But the config "Filter access to /dev/mem" is "default n", that allows kernel >>> rootkit using /dev/mem again. it could access all kernel memory default. Most >>> administrator don't known the "Filter access to /dev/mem" is "defult N", when >>> he compiles the kernel, it's easily to be attacked by rootkit. >> >> Have you ever successfully attack by this way? > > [root@localhost zealot]# ./zealot
so you're running rootkit as a root user?
quoted text
> [+] Found HISTSIZE. [SAFE] > [+] Check md5 values. [SAFE] > [+] eth0 was not set promsic. [SAFE] > [+] Not found raw socket. [SAFE] > system_call addr changed to 0xc04028a0,sys_call_table addr changed to > 0xc0675130,Found dr rootkit!,system call sys_execve addr changed to > 0xc0401582,system call sys_olduname addr changed to 0xc0405989,system > call sys_fork addr changed to 0xc0407bbb > > It's a host ids i wrote, it could search all kernel memory using /dev/mem. ok? > > some of the code here: > static void *kmap(unsigned long off, unsigned long count) > { > int fd; > void *p; > > fd = open(DEV_MEM, O_RDWR); > if (fd < 3) { > DbgPrint("open %s failed.\n", DEV_MEM); > dup2(fd, 3); > close(fd); > fd = 3; > } > > p = mmap(NULL, ALIGNUP(count + 4097), PROT_READ | PROT_WRITE, > MAP_SHARED, fd, ALIGNDOWN(off) & 0x0fffffff); > if (p == MAP_FAILED) > { > mem_support_flag = 1; > fprintf(stdout, "[-] /dev/mem cannot be read or write.\n"); > > DbgPrint("mmap failture, errno %d\n", errno); > close(fd); > return NULL; > } > > close(fd); > return p; > } > >>If CONFIG_STRICT_DEVMEM >> is not set, the /dev/mem access is filtered in pat code. > please point it, thanks. >
Years ago, someone sent the same patch. check
http://lkml.org/lkml/2008/11/7/361
quoted text
>>> >>> Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com> >>> >>> --- >>> arch/x86/Kconfig.debug | 3 ++- >>> arch/x86/configs/i386_defconfig | 2 +- >>> arch/x86/configs/x86_64_defconfig | 2 +- >>> 3 files changed, 4 insertions(+), 3 deletions(-) >>> >>> diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug >>> index bc01e3e..733aea6 100644 >>> --- a/arch/x86/Kconfig.debug >>> +++ b/arch/x86/Kconfig.debug >>> @@ -7,6 +7,7 @@ source "lib/Kconfig.debug" >>> >>> config STRICT_DEVMEM >>> bool "Filter access to /dev/mem" >>> + default y >>> ---help--- >>> If this option is disabled, you allow userspace (root) access to all >>> of memory, including kernel and userspace memory. Accidental >>> @@ -20,7 +21,7 @@ config STRICT_DEVMEM >>> This is sufficient for dosemu and X and all common users of >>> /dev/mem. >>> >>> - If in doubt, say Y. >>> + If in doubt, say N. >>> >>> config X86_VERBOSE_BOOTUP >>> bool "Enable verbose x86 bootup info messages" >>> diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig >>> index d28fad1..95c85a8 100644 >>> --- a/arch/x86/configs/i386_defconfig >>> +++ b/arch/x86/configs/i386_defconfig >>> @@ -2386,7 +2386,7 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y >>> # CONFIG_SAMPLES is not set >>> CONFIG_HAVE_ARCH_KGDB=y >>> # CONFIG_KGDB is not set >>> -# CONFIG_STRICT_DEVMEM is not set >>> +CONFIG_STRICT_DEVMEM=y >>> CONFIG_X86_VERBOSE_BOOTUP=y >>> CONFIG_EARLY_PRINTK=y >>> CONFIG_EARLY_PRINTK_DBGP=y >>> diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig >>> index 6c86acd..659bfe7 100644 >>> --- a/arch/x86/configs/x86_64_defconfig >>> +++ b/arch/x86/configs/x86_64_defconfig >>> @@ -2360,7 +2360,7 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y >>> # CONFIG_SAMPLES is not set >>> CONFIG_HAVE_ARCH_KGDB=y >>> # CONFIG_KGDB is not set >>> -# CONFIG_STRICT_DEVMEM is not set >>> +CONFIG_STRICT_DEVMEM=y >>> CONFIG_X86_VERBOSE_BOOTUP=y >>> CONFIG_EARLY_PRINTK=y >>> CONFIG_EARLY_PRINTK_DBGP=y >>> -- >>> 1.6.5.3 >>> >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >>> the body of a message to
majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>> Please read the FAQ at http://www.tux.org/lkml/ >>> >> >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] Kconfig: Make config Filter access to /dev/mem def ...
, wzt.wzt
, (Mon Apr 12, 7:52 pm)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Xiaotian Feng
, (Wed Apr 14, 11:12 pm)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, wzt wzt
, (Wed Apr 14, 11:17 pm)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Xiaotian Feng
, (Wed Apr 14, 11:28 pm)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Michal Svoboda
, (Wed Apr 14, 11:36 pm)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, wzt wzt
, (Wed Apr 14, 11:39 pm)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Xiaotian Feng
, (Thu Apr 15, 12:12 am)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, wzt wzt
, (Thu Apr 15, 12:37 am)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Jiri Kosina
, (Thu Apr 15, 3:43 am)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Alan Cox
, (Thu Apr 15, 4:00 am)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Michal Svoboda
, (Thu Apr 15, 6:41 am)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Alan Cox
, (Thu Apr 15, 6:59 am)
Re: [PATCH] Kconfig: Make config Filter access to /dev/mem ...
, Pavel Machek
, (Thu Apr 15, 11:03 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate