From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 0/5] Collected vdso/vsyscall fixes for 3.1 Date: Wed, 27 Jul 2011 10:57:45 -0400 Message-ID: <20110727145745.GA11872@dumpdata.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Andy Lutomirski Cc: x86@kernel.org, Linux Kernel Mailing List , jeremy@goop.org, keir.xen@gmail.com, xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org List-Id: xen-devel@lists.xenproject.org On Tue, Jul 26, 2011 at 11:20:34PM -0400, Andy Lutomirski wrote: > This fixes various problems that cropped up with the vdso patches. >=20 > - Patch 1 fixes an information leak to userspace. > - Patches 2 and 3 fix the kernel build on gold. > - Patches 4 and 5 fix Xen (I hope). >=20 > Konrad, could you could test these on Xen and run 'test_vsyscall test= ' [1]? They boot 64-bit guest succesfully. But I doesn't compile under 32-bit: home/konrad/ssd/linux/arch/x86/xen/enlighten.c:953: error: unknown fiel= d =E2=80=98extra_user_64bit_cs=E2=80=99 specified in initializer /home/konrad/ssd/linux/arch/x86/xen/enlighten.c:953: error: =E2=80=98FL= AT_USER_CS64=E2=80=99 undeclared here (not in a function) Looks like it needs some #ifdef CONFIG_X86_64 magic.. and after applying that magic dust it compiles and it also boots as 32-bit (no surprise there). > I don't have a usable Xen setup. It is pretty easy to setup. Google for PVops Wiki and you will find wea= lth of information. FYI: I am gone next week so won't be able to test these patches. >=20 > Also, I'd appreciate a review of patches 4 and 5 from some Xen/paravi= rt > people. >=20 > [1] https://gitorious.org/linux-test-utils/linux-clock-tests Grrrrr.. g++ -o test_vsyscall -std=3Dgnu++0x -lrt -ldl -O2 -Wall -mavx -g test_v= syscall.cc test_vsyscall.cc: In function =E2=80=98int bench(int, char**)=E2=80=99: test_vsyscall.cc:205: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:205: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:206: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:206: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:207: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:207: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:211: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:211: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:213: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:213: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:214: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:214: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:218: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:218: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:219: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:219: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:222: error: expected primary-expression before =E2=80=98= [=E2=80=99 token test_vsyscall.cc:222: error: expected primary-expression before =E2=80=98= ]=E2=80=99 token test_vsyscall.cc:203: warning: unused variable =E2=80=98tv=E2=80=99 test_vsyscall.cc:204: warning: unused variable =E2=80=98tz=E2=80=99 test_vsyscall.cc:210: warning: unused variable =E2=80=98t=E2=80=99 test_vsyscall.cc:217: warning: unused variable =E2=80=98cpu=E2=80=99 test_vsyscall.cc:217: warning: unused variable =E2=80=98node=E2=80=99 Is there a specific version of GCC I should be using? I seem to be using: g++ (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) Anyhow, removed the benchmark code and ran it on 64-bit: sh-4.1# /test_vsyscall test Testing gettimeofday... [ 109.552261] test_vsyscall[2462] trap invalid opcode ip:400c8d sp:7ff= f84fab470 error:0 in test_vsyscall[400000+2000] Illegal instruction sh-4.1# /test_vsyscall intcc About to execute int 0xcc from RIP =3D 400959 [ 114.137150] test_vsyscall[2463] illegal int 0xcc (exploit attempt?) = ip:400959 cs:e033 sp:7fff8b328310 ax:2c si:0 di:7fff8b3280f0 Caught SIGSEGV: Segmentation fault (Signal sent by the kernel [(nil)])R= IP =3D 400959 [This is on git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.gi= t #testing, which has todays linus/master and your patchset]