From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CB9FC388F7 for ; Fri, 23 Oct 2020 00:16:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9BA8724631 for ; Fri, 23 Oct 2020 00:16:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ddTlNlNR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BA8724631 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 997D06B005D; Thu, 22 Oct 2020 20:16:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 922CB6B0062; Thu, 22 Oct 2020 20:16:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 811306B0068; Thu, 22 Oct 2020 20:16:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 5249D6B005D for ; Thu, 22 Oct 2020 20:16:37 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D7B45362C for ; Fri, 23 Oct 2020 00:16:36 +0000 (UTC) X-FDA: 77401273992.20.fang38_0f11b6727255 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id B373F180C07A3 for ; Fri, 23 Oct 2020 00:16:36 +0000 (UTC) X-HE-Tag: fang38_0f11b6727255 X-Filterd-Recvd-Size: 6722 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Fri, 23 Oct 2020 00:16:36 +0000 (UTC) Received: by mail-ed1-f43.google.com with SMTP id dg9so3530151edb.12 for ; Thu, 22 Oct 2020 17:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XLY21JX5I5QFlC2bkVrjYFHPFnXicdIVDS29HVXeTok=; b=ddTlNlNRb6Gcq+pCD2VGDDviUyFdWgS4SI2rZqCTe7qisSD40rk3KGt9veIrursLjL d9JYYxPwhKyRBZiDDXgH7+i9ioZ8pfkB5+In9+v4mNHAG0/A90ekmx23hwMClIRCkpK1 XSJMBceXPy08U1FnD050q7PGqsmjLolxNxCak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XLY21JX5I5QFlC2bkVrjYFHPFnXicdIVDS29HVXeTok=; b=K+YqinHFj1qZy0oxELcoFU0LvNmiZAqqnhM+lCK3oZxS4ibb6uIr5b+kFo8ey7Vf6u ajVp6QiHxOFyockipPiiRpo2XTLDC26YJqKjug7mwcJQdue30df3e4UMeuKXOUHw3wro ZkL+aqi6/snedgcMplsb0asyGCpPEF3ix6jpcDcZFYyQyQeWmLy+RheRg13Ev61iQfCY L+8b4cKK1meSDpo5XUmO3IWiwKqNf7ZLCRyNBqtX0VjdoSoO/CXxcJU42q1Cf9elWW0Z 30Y84sAFIRfI6SvsrPQgJvGQE8Ahz/bGo+32QGp1Nz5QvLa4QucHTHCxytM5/HuOsIhF JCCw== X-Gm-Message-State: AOAM531C6I1c0u8K3D0hq16ctDplG4mD9vQ3TIJDkhxWBO2+77LVNfVz 3A985v8rIZxx5UoiWptzfsTwHBAFBoDh/w== X-Google-Smtp-Source: ABdhPJx7waSoNwASl6ojoCsLDPfkGlZxwi7gzG8ooDIzvaWljtsYLfpEweMl0cXZhCwdbFty/1/wog== X-Received: by 2002:aa7:dd53:: with SMTP id o19mr4708314edw.370.1603412194399; Thu, 22 Oct 2020 17:16:34 -0700 (PDT) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com. [209.85.218.44]) by smtp.gmail.com with ESMTPSA id ce13sm1379371edb.32.2020.10.22.17.16.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Oct 2020 17:16:34 -0700 (PDT) Received: by mail-ej1-f44.google.com with SMTP id w27so4980832ejb.3 for ; Thu, 22 Oct 2020 17:16:33 -0700 (PDT) X-Received: by 2002:a19:c703:: with SMTP id x3mr1503603lff.105.1603411884054; Thu, 22 Oct 2020 17:11:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Thu, 22 Oct 2020 17:11:08 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: mmstress[1309]: segfault at 7f3d71a36ee8 ip 00007f3d77132bdf sp 00007f3d71a36ee8 error 4 in libc-2.27.so[7f3d77058000+1aa000] To: Naresh Kamboju Cc: open list , linux-m68k , X86 ML , LTP List , lkft-triage@lists.linaro.org, Linux-Next Mailing List , linux-mm , kasan-dev , Christian Brauner , Ingo Molnar , Thomas Gleixner , "Matthew Wilcox (Oracle)" , "Peter Zijlstra (Intel)" , Al Viro , Geert Uytterhoeven , Viresh Kumar , zenglg.jy@cn.fujitsu.com, Stephen Rothwell , "Eric W. Biederman" , Dmitry Vyukov Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 22, 2020 at 4:43 PM Linus Torvalds wrote: > > Thanks. Very funky, but thanks. I've been running that commit on my > machine for over half a year, and it still looks "trivially correct" > to me, but let me go look at it one more time. Can't argue with a > reliable bisect and revert.. Hmm. The fact that it only happens with KASAN makes me suspect it's some bad interaction with the inline asm syntax change (and explains why I've run with this for half a year without issues). In particular, I wonder if it's that KASAN causes some reload pattern, and the whole register __typeof__(*(ptr)) __val_pu asm("%"_ASM_AX); .. asm volatile(.. "r" (__val_pu) ..) thing causes problems. That's an ugly pattern, but it's written that way to get gcc to handle the 64-bit case properly (with the value in %rax:%rdx). It turns out that the decode of the user-mode SIGSEGV code is a variation of system calls, ie 0: b8 18 00 00 00 mov $0x18,%eax 5: 0f 05 syscall 7: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax d: 73 01 jae 0x10 f:* c3 retq <-- trapping instruction or 0: 41 52 push %r10 2: 52 push %rdx 3: 4d 31 d2 xor %r10,%r10 6: ba 02 00 00 00 mov $0x2,%edx b: be 80 00 00 00 mov $0x80,%esi 10: 39 d0 cmp %edx,%eax 12: 75 07 jne 0x1b 14: b8 ca 00 00 00 mov $0xca,%eax 19: 0f 05 syscall 1b: 89 d0 mov %edx,%eax 1d: 87 07 xchg %eax,(%rdi) 1f: 85 c0 test %eax,%eax 21: 75 f1 jne 0x14 23:* 5a pop %rdx <-- trapping instruction 24: 41 5a pop %r10 26: c3 retq so in both cases it looks like 'syscall' returned with a bad stack pointer. Which is certainly a sign of some code generation issue. Very annoying, because it probably means that it's compiler-specific too. And that "syscall 018" looks very odd. I think that's sched_yield() on x86-64, which doesn't have any __put_user() cases at all.. Would you mind sending me the problematic vmlinux file in private (or, likely better - a pointer to some place I can download it, it's going to be huge). Linus