From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: <hpa@zytor.com>, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, x86l <x86@kernel.org>,
Dominik Brodowski <linux@dominikbrodowski.net>,
Andy Lutomirski <luto@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Cc: <yaomin2@huawei.com>
Subject: Re: Is this a kernel BUG? ///Re: [Question] Can we use SIGRTMIN when vdso disabled on X86?
Date: Thu, 7 Jun 2018 09:45:15 +0800 [thread overview]
Message-ID: <5B188E2B.7040700@huawei.com> (raw)
In-Reply-To: <B2D1D0A5-D35B-435C-9548-1FB5964F61BA@zytor.com>
On 2018/6/7 1:48, hpa@zytor.com wrote:
> On June 6, 2018 2:17:42 AM PDT, "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com> wrote:
>> I found that glibc has already dealt with this case. So this issue must
>> have been met before, should it be maintained by libc/user?
>>
>> if (GLRO(dl_sysinfo_dso) == NULL)
>> {
>> kact.sa_flags |= SA_RESTORER;
>>
>> kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
>> ? &restore_rt : &restore);
>> }
>>
>>
>> On 2018/6/6 15:52, Leizhen (ThunderTown) wrote:
>>>
>>>
>>> On 2018/6/5 19:24, Leizhen (ThunderTown) wrote:
>>>> After I executed "echo 0 > /proc/sys/abi/vsyscall32" to disable
>> vdso, the rt_sigaction01 test case from ltp_2015 failed.
>>>> The test case source code please refer to the attachment, and the
>> output as blow:
>>>>
>>>> -----------------
>>>> ./rt_sigaction01
>>>> rt_sigaction01 0 TINFO : signal: 34
>>>> rt_sigaction01 1 TPASS : rt_sigaction call succeeded: result =
>> 0
>>>> rt_sigaction01 0 TINFO : sa.sa_flags = SA_RESETHAND|SA_SIGINFO
>>>> rt_sigaction01 0 TINFO : Signal Handler Called with signal
>> number 34
>>>>
>>>> Segmentation fault
>>>> ------------------
>>>>
>>>>
>>>> Is this the desired result? In function ia32_setup_rt_frame, I found
>> below code:
>>>>
>>>> if (ksig->ka.sa.sa_flags & SA_RESTORER)
>>>> restorer = ksig->ka.sa.sa_restorer;
>>>> else
>>>> restorer = current->mm->context.vdso +
>>>> vdso_image_32.sym___kernel_rt_sigreturn;
>>>> put_user_ex(ptr_to_compat(restorer), &frame->pretcode);
>>>>
>>>> Because the vdso is disabled, so current->mm->context.vdso is NULL,
>> which cause the result of frame->pretcode invalid.
>>>>
>>>> I'm not sure whether this is a kernel bug or just an error of test
>> case itself. Can anyone help me?
>>>>
>>>
>
> The use of signals without SA_RESTORER is considered obsolete, but it's somewhat surprising that the vdso isn't there; it should be mapped even for static binaries esp. on i386 since it is the preferred way to do system calls (you don't need to parse the ELF for that.) Are you explicitly disabling the VDSO? If so, Don't Do That.
Yes, the vdso was explicitly disabled by the tester. Thanks.
>
--
Thanks!
BestRegards
next prev parent reply other threads:[~2018-06-07 1:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 11:24 [Question] Can we use SIGRTMIN when vdso disabled on X86? Leizhen (ThunderTown)
2018-06-06 7:52 ` Is this a kernel BUG? ///Re: " Leizhen (ThunderTown)
2018-06-06 9:17 ` Leizhen (ThunderTown)
2018-06-06 17:01 ` Andy Lutomirski
2018-06-07 2:05 ` Leizhen (ThunderTown)
2018-06-07 2:39 ` Andy Lutomirski
2018-06-07 3:10 ` Leizhen (ThunderTown)
2018-06-06 17:48 ` hpa
2018-06-07 1:45 ` Leizhen (ThunderTown) [this message]
2018-06-07 21:05 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5B188E2B.7040700@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yaomin2@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox