Gentoo Archives: gentoo-hardened

From: "Javier Juan Martínez Cabezón" <tazok.id0@×××××.com>
To: gentoo-hardened@l.g.o
Subject: [gentoo-hardened] Re: probably bug in rsbac_sources
Date: Mon, 15 Jul 2013 01:07:09
Message-Id: CAD98N_E12rqWcX5PqAz+_VXpbsAyjxdFmWsUYq3YBcr1cRD=pw@mail.gmail.com
In Reply to: [gentoo-hardened] probably bug in rsbac_sources by "Javier Juan Martínez Cabezón"
1 I send related PaX .config if you need it:
2
3
4 #
5 # PaX
6 #
7 CONFIG_ARCH_TRACK_EXEC_LIMIT=y
8 CONFIG_PAX_PER_CPU_PGD=y
9 CONFIG_PAX=y
10
11 #
12 # PaX Control
13 #
14 CONFIG_PAX_SOFTMODE=y
15 # CONFIG_PAX_EI_PAX is not set
16 CONFIG_PAX_PT_PAX_FLAGS=y
17 # CONFIG_PAX_XATTR_PAX_FLAGS is not set
18 # CONFIG_PAX_NO_ACL_FLAGS is not set
19 CONFIG_PAX_HAVE_ACL_FLAGS=y
20 # CONFIG_PAX_HOOK_ACL_FLAGS is not set
21
22 #
23 # Non-executable pages
24 #
25 CONFIG_PAX_NOEXEC=y
26 CONFIG_PAX_PAGEEXEC=y
27 # CONFIG_PAX_SEGMEXEC is not set
28 CONFIG_PAX_EMUTRAMP=y
29 CONFIG_PAX_MPROTECT=y
30 # CONFIG_PAX_ELFRELOCS is not set
31 CONFIG_PAX_KERNEXEC=y
32 CONFIG_PAX_KERNEXEC_PLUGIN_METHOD=""
33
34 #
35 # Address Space Layout Randomization
36 #
37 CONFIG_PAX_ASLR=y
38 CONFIG_PAX_RANDKSTACK=y
39 CONFIG_PAX_RANDUSTACK=y
40 CONFIG_PAX_RANDMMAP=y
41
42 #
43 # Miscellaneous hardening features
44 #
45 # CONFIG_PAX_MEMORY_SANITIZE is not set
46 # CONFIG_PAX_MEMORY_STACKLEAK is not set
47 # CONFIG_PAX_MEMORY_UDEREF is not set
48 CONFIG_PAX_REFCOUNT=y
49 # CONFIG_PAX_USERCOPY is not set
50 # CONFIG_PAX_CONSTIFY_PLUGIN is not set
51 # CONFIG_PAX_SIZE_OVERFLOW is not set
52 # CONFIG_KEYS is not set
53 CONFIG_SECURITY_DMESG_RESTRICT=y
54 # CONFIG_SECURITY is not set
55 # CONFIG_SECURITYFS is not set
56 CONFIG_DEFAULT_SECURITY_DAC=y
57 CONFIG_DEFAULT_SECURITY=""
58 CONFIG_XOR_BLOCKS=y
59 CONFIG_ASYNC_CORE=y
60 CONFIG_ASYNC_MEMCPY=y
61 CONFIG_ASYNC_XOR=y
62 CONFIG_ASYNC_PQ=y
63 CONFIG_ASYNC_RAID6_RECOV=y
64 CONFIG_CRYPTO=y
65
66 #
67
68 2013/7/15 Javier Juan Martínez Cabezón <tazok.id0@×××××.com>
69
70 >
71 > Hi all
72 >
73 > I'm with this several months and I still without knowing if it was mistake
74 > from me while patching PaX with rsbac at hand or is a kernel bug, or it's
75 > from VirtualBox (the behaviour is horrible, sorry):
76 >
77 > After the bug hits system guest gets unusable, hard reset is required,
78 > every command executed gets segfaulted from there.
79 >
80 > I can reproduce it easily, using backup_all (a shell script that makes the
81 > sec policy backup (as in this case)) or with ./configure when compiling (as
82 > emerge does something), so emerge usually does seg fault. The EIP is always
83 > at the same, strnlen+0x6/0x18
84 >
85 > Jul 13 22:50:02 orion kernel: BUG: unable to handle kernel paging request
86 > at 00001033
87 > Jul 13 22:50:02 orion kernel: IP: [<001aa8e2>] strnlen+0x6/0x18
88 > Jul 13 22:50:02 orion kernel: *pdpt = 000000000e965001 *pde =
89 > 0000000000000000
90 > Jul 13 22:50:02 orion kernel: Oops: 0000 [#1]
91 > Jul 13 22:50:02 orion kernel:
92 > Jul 13 22:50:02 orion kernel: Pid: 4147, comm: bash Not tainted
93 > 3.4.0-rsbac #9 innotek GmbH VirtualBox
94 > Jul 13 22:50:02 orion kernel: EIP: 0060:[<001aa8e2>] EFLAGS: 00010217 CPU:
95 > 0
96 > Jul 13 22:50:02 orion kernel: EIP is at strnlen+0x6/0x18
97 > Jul 13 22:50:02 orion kernel: EAX: 00001033 EBX: ce9c0069 ECX: 00001033
98 > EDX: 0000000e
99 > Jul 13 22:50:02 orion kernel: ESI: 00001033 EDI: ce9c0069 EBP: ce9c07f5
100 > ESP: c66d3b38
101 > Jul 13 22:50:02 orion kernel: DS: 0068 ES: 0068 FS: 0000 GS: 0000 SS: 0068
102 > Jul 13 22:50:02 orion kernel: CR0: 8005003b CR2: 00001033 CR3: 01415000
103 > CR4: 000006f0
104 > Jul 13 22:50:02 orion kernel: DR0: 00000000 DR1: 00000000 DR2: 00000000
105 > DR3: 00000000
106 > Jul 13 22:50:02 orion kernel: DR6: ffff0ff0 DR7: 00000400
107 > Jul 13 22:50:02 orion kernel: Process bash (pid: 4147, ti=e738ee3c
108 > task=e738ebd0 task.ti=e738ee3c)
109 > Jul 13 22:50:02 orion kernel: Stack:
110 > Jul 13 22:50:02 orion kernel: 001a884b c66d3bb4 c66d3bb0 c66d3bb4 ce9c0069
111 > ce9c0069 001a916e 000fff00
112 > Jul 13 22:50:02 orion kernel: 000fffff 0000000f ce9c07f5 ce9c000b c1514bcb
113 > 000007ea ff0a0004 000fffff
114 > Jul 13 22:50:02 orion kernel: ce9c0000 c66d3bdc c66d3bac c66d3bdc 0004dfc6
115 > c66d3ba8 e702a4c0 c66d3bdc
116 > Jul 13 22:50:02 orion kernel: Call Trace:
117 > Jul 13 22:50:02 orion kernel: [<001a884b>] ? string.isra.1+0x25/0x8c
118 > Jul 13 22:50:02 orion kernel: [<001a916e>] ? vsnprintf+0x139/0x257
119 > Jul 13 22:50:02 orion kernel: [<000fff00>] ? bio_map_user+0x13/0x25
120 > Jul 13 22:50:02 orion kernel: [<000fffff>] ? bio_map_kern+0xb0/0xd9
121 > Jul 13 22:50:02 orion kernel: [<000fffff>] ? bio_map_kern+0xb0/0xd9
122 > Jul 13 22:50:02 orion kernel: [<0004dfc6>] ? rsbac_printk+0x52/0x18e
123 > Jul 13 22:50:02 orion kernel: [<0007d3ee>] ?
124 > rsbac_adf_set_attr_cap+0x680/0x9a6
125 > Jul 13 22:50:02 orion kernel: [<00038a00>] ?
126 > smp_apic_timer_interrupt+0x62/0x6a
127 > Jul 13 22:50:02 orion kernel: [<00407f91>] ? resume_userspace_sig+0x1b/0x2a
128 > Jul 13 22:50:02 orion kernel: [<0007148e>] ?
129 > rsbac_adf_set_attr+0x45f/0x12b3
130 > Jul 13 22:50:02 orion kernel: [<00800001>] ? 0x800000
131 > Jul 13 22:50:02 orion kernel: [<0009fa4f>] ? do_adjtimex+0x2ab/0x550
132 > Jul 13 22:50:02 orion kernel: [<000e85ec>] ? do_path_lookup+0x17/0x4a
133 > Jul 13 22:50:02 orion kernel: [<000e8963>] ? user_path_at_empty+0x4b/0x69
134 > Jul 13 22:50:02 orion kernel: [<000e8963>] ? user_path_at_empty+0x4b/0x69
135 > Jul 13 22:50:02 orion kernel: [<000c6a52>] ? __do_fault+0x357/0x389
136 > Jul 13 22:50:02 orion kernel: [<0002cc9e>] ? free_thread_xstate+0x17/0x23
137 > Jul 13 22:50:02 orion kernel: [<00110c60>] ? load_elf_binary+0xf05/0xfbf
138 > Jul 13 22:50:02 orion kernel: [<00110c60>] ? load_elf_binary+0xf05/0xfbf
139 > Jul 13 22:50:02 orion kernel: [<00030502>] ? x86_pmu_event_init+0x23c/0x2d1
140 > Jul 13 22:50:02 orion kernel: [<000e2f53>] ? do_execve_common+0x363/0x45e
141 > Jul 13 22:50:02 orion kernel: [<00800001>] ? 0x800000
142 > Jul 13 22:50:02 orion kernel: [<0009fa4f>] ? do_adjtimex+0x2ab/0x550
143 > Jul 13 22:50:02 orion kernel: [<000e85ec>] ? do_path_lookup+0x17/0x4a
144 > Jul 13 22:50:02 orion kernel: [<000e8963>] ? user_path_at_empty+0x4b/0x69
145 > Jul 13 22:50:02 orion kernel: [<000e8963>] ? user_path_at_empty+0x4b/0x69
146 > Jul 13 22:50:02 orion kernel: [<000c6a52>] ? __do_fault+0x357/0x389
147 > Jul 13 22:50:02 orion kernel: [<00800001>] ? 0x800000
148 > Jul 13 22:50:02 orion kernel: [<0009fa4f>] ? do_adjtimex+0x2ab/0x550
149 > Jul 13 22:50:02 orion kernel: [<00800001>] ? 0x800000
150 > Jul 13 22:50:02 orion kernel: [<0009fa4f>] ? do_adjtimex+0x2ab/0x550
151 > Jul 13 22:50:02 orion kernel: [<000e85ec>] ? do_path_lookup+0x17/0x4a
152 > Jul 13 22:50:02 orion kernel: [<000e8963>] ? user_path_at_empty+0x4b/0x69
153 > Jul 13 22:50:02 orion kernel: [<000e8963>] ? user_path_at_empty+0x4b/0x69
154 > Jul 13 22:50:02 orion kernel: [<00800001>] ? 0x800000
155 > Jul 13 22:50:02 orion kernel: [<0009fa4f>] ? do_adjtimex+0x2ab/0x550
156 > Jul 13 22:50:02 orion kernel: [<000c6a52>] ? __do_fault+0x357/0x389
157 > Jul 13 22:50:02 orion kernel: [<000e626c>] ? getname_flags+0x1b/0xbf
158 > Jul 13 22:50:02 orion kernel: [<000e3057>] ? do_execve+0x9/0xb
159 > Jul 13 22:50:02 orion kernel: [<0002d0f1>] ? sys_execve+0x2c/0x50
160 > Jul 13 22:50:02 orion kernel: [<004087f2>] ? ptregs_execve+0x12/0x20
161 > Jul 13 22:50:02 orion kernel: [<00408009>] ? syscall_call+0x7/0xb
162 > Jul 13 22:50:02 orion kernel: [<00408024>] ? restore_all_pax+0x7/0x7
163 > Jul 13 22:50:02 orion kernel: [<000290d5>] ? math_state_restore+0x96/0x96
164 > Jul 13 22:50:02 orion kernel: [<00010206>] ?
165 > kvm_arch_vcpu_ioctl_run+0x79a/0xbdc
166 > Jul 13 22:50:02 orion kernel: [<0003c0a9>] ? vmalloc_sync_all+0x1/0x1
167 > Jul 13 22:50:02 orion kernel: [<00408024>] ? restore_all_pax+0x7/0x7
168 > Jul 13 22:50:02 orion kernel: [<0040007b>] ? pcnet32_remove_one+0x22/0xe3
169 > Jul 13 22:50:02 orion kernel: [<0001007b>] ?
170 > kvm_arch_vcpu_ioctl_run+0x60f/0xbdc
171 > Jul 13 22:50:02 orion kernel: [<0003c0a9>] ? vmalloc_sync_all+0x1/0x1
172 > Jul 13 22:50:02 orion kernel: [<00010287>] ?
173 > kvm_arch_vcpu_ioctl_run+0x81b/0xbdc
174 > Jul 13 22:50:02 orion kernel: Code: d0 f2 ae 74 05 bf 01 00 00 00 4f eb 02
175 > 31 ff 89 f8 5f c3 85 c9 57 89 c7 74 07 89 d0 f2 ae 75 01 4f 89 f8 5f c3 89
176 > c1 89 c8 eb 06 <80> 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 c3 90 90 90 57
177 > 83 c9
178 > Jul 13 22:50:02 orion kernel: EIP: [<001aa8e2>] strnlen+0x6/0x18 SS:ESP
179 > 0068:c66d3b38
180 > Jul 13 22:50:02 orion kernel: CR2: 0000000000001033
181 > Jul 13 22:50:02 orion kernel: ---[ end trace 4a7d8fa933a5d5dd ]---
182 >
183 > Jul 13 22:59:01 orion kernel: BUG: unable to handle kernel paging request
184 > at 000010a1
185 > Jul 13 22:59:01 orion kernel: IP: [<001aa8e2>] strnlen+0x6/0x18
186 > Jul 13 22:59:01 orion kernel: *pdpt = 000000000df00001 *pde =
187 > 0000000000000000
188 > Jul 13 22:59:01 orion kernel: Oops: 0000 [#2]
189 > Jul 13 22:59:01 orion kernel:
190 > Jul 13 22:59:01 orion kernel: Pid: 4257, comm: bash Tainted: G D
191 > 3.4.0-rsbac #9 innotek GmbH VirtualBox
192 > Jul 13 22:59:01 orion kernel: EIP: 0060:[<001aa8e2>] EFLAGS: 00010217 CPU:
193 > 0
194 > Jul 13 22:59:01 orion kernel: EIP is at strnlen+0x6/0x18
195 > Jul 13 22:59:01 orion kernel: EAX: 000010a1 EBX: ce9c0869 ECX: 000010a1
196 > EDX: 0000000e
197 > Jul 13 22:59:01 orion kernel: ESI: 000010a1 EDI: ce9c0869 EBP: ce9c0ff5
198 > ESP: c66cfb48
199 > Jul 13 22:59:01 orion kernel: DS: 0068 ES: 0068 FS: 0000 GS: 0000 SS: 0068
200 > Jul 13 22:59:01 orion kernel: CR0: 8005003b CR2: 000010a1 CR3: 01415000
201 > CR4: 000006f0
202 > Jul 13 22:59:01 orion kernel: DR0: 00000000 DR1: 00000000 DR2: 00000000
203 > DR3: 00000000
204 > Jul 13 22:59:01 orion kernel: DR6: ffff0ff0 DR7: 00000400
205 > Jul 13 22:59:01 orion kernel: Process bash (pid: 4257, ti=e738ee3c
206 > task=e738ebd0 task.ti=e738ee3c)
207 >

Replies

Subject Author
Re: [gentoo-hardened] Re: probably bug in rsbac_sources Jens Kasten <jens@××××××××××.de>