From: Jason Yan <yanaijie@huawei.com>
To: Kees Cook <keescook@chromium.org>, Jann Horn <jannh@google.com>
Cc: Kernel Hardening <kernel-hardening@lists.openwall.com>,
zhaohongjiang@huawei.com, miaoxie@huawei.com,
Li Bin <huawei.libin@huawei.com>,
Wei Yongjun <weiyongjun1@huawei.com>
Subject: Re: [PATCH] usercopy: skip the check if not a real usercopy
Date: Wed, 9 Jan 2019 10:38:35 +0800 [thread overview]
Message-ID: <5C355EAB.7080008@huawei.com> (raw)
In-Reply-To: <5C355BD6.2010608@huawei.com>
On 2019/1/9 10:26, Jason Yan wrote:
> Hi all,
>
> On 2019/1/9 7:54, Kees Cook wrote:
>> I would think we'd still want to be performing bounds-checking even in
>> the kernel-to-kernel case. It seems like there is some other issue
>> here? Why would the check stall?
>>
>> Can you find out from your build what your top-of-dump line this
>> resolves to? (My various kernel version builds don't share the same
>> function size, so this doesn't resolve for me...)
>>
>> $ ./scripts/faddr2line vmlinux __check_object_size+0x1f1/0x460
>>
>> Maybe it's getting stuck in loop doing stack frame walking? I'd expect
>> that to show up in the backtrace though (since it's noinline).
>
>
> It's very easy to reproduce in qemu using my config with v4.20. Please
> refer to the attachment.
>
> I did some debug and found that check_object_size() did not stuck but
> check_object_size() sometimes takes more than 30 milliseconds, and
> ftrace will call __probe_kernel_write() thousands of times, which makes
> the whole process stuck for more than 20 seconds.
And I tried kernel v5.0-rc1,the system directly reboot and didn't print
any thing.
[root@localhost ~]#
[root@localhost ~]# cat functiontracer.sh
ping 127.0.0.1 -i 0.01 > /dev/null &
sleep 1
echo function > /sys/kernel/debug/tracing/current_tracer
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# sh functiontracer.sh
[ 43.972860] hrtimer: interrupt took 3515386 ns
[ 0.000000] Linux version 5.0.0-rc1-514.55.6.9.x86_64 (yanaijie@138)
(gcc version 7.3.1 20180712 (Red Hat 7.3.1-6) (GCC)) #72 SMP Wed Jan 9
09:25:31 CST 2019
[ 0.000000] Command line: console=ttyS0 IP=192.168.25.187
root=/dev/vda rw
[ 0.000000] x86/fpu: x87 FPU will use FXSAVE
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff]
reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff]
reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000bffddfff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000bffde000-0x00000000bfffffff]
reserved
[ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff]
reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff]
reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000013fffffff] usable
next prev parent reply other threads:[~2019-01-09 2:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 9:31 [PATCH] usercopy: skip the check if not a real usercopy Jason Yan
2019-01-02 16:11 ` Casey Schaufler
2019-01-03 9:36 ` Jann Horn
2019-01-08 23:54 ` Kees Cook
2019-01-09 2:26 ` Jason Yan
2019-01-09 2:38 ` Jason Yan [this message]
2019-01-09 22:59 ` Kees Cook
2019-01-11 1:52 ` Jason Yan
2019-01-09 0:48 ` Jann Horn
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=5C355EAB.7080008@huawei.com \
--to=yanaijie@huawei.com \
--cc=huawei.libin@huawei.com \
--cc=jannh@google.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=miaoxie@huawei.com \
--cc=weiyongjun1@huawei.com \
--cc=zhaohongjiang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.