Browse code

Check for LEGACY_VSYSCALL_* options

Chosing LEGACY_VSYSCALL_NONE (over NATIVE or EMULATE) will mean that binaries
using eglibc <= 2.13 will not run (segfault).

Fixes #28705.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
(cherry picked from commit 163db04452fe399fec940a926733915e7cf90062)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>

Ian Campbell authored on 2016/11/24 20:39:05
Showing 1 changed files
... ...
@@ -222,6 +222,23 @@ echo 'Optional Features:'
222 222
 		echo "    $(wrap_color '(note that cgroup swap accounting is not enabled in your kernel config, you can enable it by setting boot option "swapaccount=1")' bold black)"
223 223
 	fi
224 224
 }
225
+{
226
+	if is_set LEGACY_VSYSCALL_NATIVE; then
227
+		echo -n "- "; wrap_good "CONFIG_LEGACY_VSYSCALL_NATIVE" 'enabled'
228
+	elif is_set LEGACY_VSYSCALL_EMULATE; then
229
+		echo -n "- "; wrap_good "CONFIG_LEGACY_VSYSCALL_EMULATE" 'enabled'
230
+	elif is_set LEGACY_VSYSCALL_NONE; then
231
+		echo -n "- "; wrap_bad "CONFIG_LEGACY_VSYSCALL_NONE" 'enabled'
232
+		echo "    $(wrap_color '(containers using eglibc <= 2.13 will not work. Switch to' bold black)"
233
+		echo "    $(wrap_color ' "CONFIG_VSYSCALL_[NATIVE|EMULATE]" or use "vsyscall=[native|emulate]"' bold black)"
234
+		echo "    $(wrap_color ' on kernel command line. Note that this will disable ASLR for the,' bold black)"
235
+		echo "    $(wrap_color ' VDSO which may assist in exploiting security vulnerabilities.)' bold black)"
236
+	# else Older kernels (prior to 3dc33bd30f3e, released in v4.40-rc1) do
237
+	#      not have these LEGACY_VSYSCALL options and are effectively
238
+	#      LEGACY_VSYSCALL_EMULATE. Even older kernels are presumably
239
+	#      effectively LEGACY_VSYSCALL_NATIVE.
240
+	fi
241
+}
225 242
 
226 243
 if [ "$kernelMajor" -lt 4 ] || [ "$kernelMajor" -eq 4 -a "$kernelMinor" -le 5 ]; then
227 244
 	check_flags MEMCG_KMEM