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 DE3EBC56201 for ; Fri, 23 Oct 2020 17:50:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 521BA2168B for ; Fri, 23 Oct 2020 17:50:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zC+oRhFa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 521BA2168B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7275A6B005D; Fri, 23 Oct 2020 13:50:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D6A46B0062; Fri, 23 Oct 2020 13:50:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A1116B0068; Fri, 23 Oct 2020 13:50:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0154.hostedemail.com [216.40.44.154]) by kanga.kvack.org (Postfix) with ESMTP id 2BFC96B005D for ; Fri, 23 Oct 2020 13:50:26 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BB75E180AD815 for ; Fri, 23 Oct 2020 17:50:25 +0000 (UTC) X-FDA: 77403929610.29.son32_0f034f72725b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 93164180868EB for ; Fri, 23 Oct 2020 17:50:25 +0000 (UTC) X-HE-Tag: son32_0f034f72725b X-Filterd-Recvd-Size: 6265 Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Fri, 23 Oct 2020 17:50:25 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id h21so2785199iob.10 for ; Fri, 23 Oct 2020 10:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VHLmS2i+xk5cy1+Hh+6vgNtXSGGSQNTTVydbxoIIvxM=; b=zC+oRhFaf2/DzBVi/uf1QHqmlqYAMFk/0Yiq6WYy9+Xgfh3NGCaUCcTJ5Q7xSOvUZb xe6Nolg1AUdP4BtgPyn07pt0IrBoA9v6TPP5Zfonzu9OhuRJOOPnfM9l4P489FofeFwK MfB12Fm281RSTLVc2auMXC/NjKcR9gM+7yPsbZGb6xRuj/RVIewwfCV+5XqaGZnYtALt XJ/4OaJYvehbbklG3uz5H59+p1C9Jz2kLQ0URQd+x0aYhYZCEVAU/yJBvItYYSk/tetF ss5gP7Je4RLLDflZH5pdRyLfYVhSwGK+kZrSB3N6p+ziSWiyM5NEFfOhAGetgintlI5G I8qA== 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=VHLmS2i+xk5cy1+Hh+6vgNtXSGGSQNTTVydbxoIIvxM=; b=rZgKVm0lT+YiGoPBW1i8YaeVc/OODibEkwCzu9fZIEmpFxaZQrykzC/y35QRK6Fx8A YR3yII2CwZCIOpVdZJ94xrMnWe0hGdrxPLTkmoo3oj4139Z+eEjyxejJIhFXw8CkDfn4 1kcDwuddkq1gyN6ZdT+1CjoeEDfpwBvS4grGCYil0LCV7IJWnGGeadns19BVhgjXeKl8 iEYwm/nNxwLBzPjjet8aCBCeZhEkMQGGVa4kuz0GWkQCQKhV6UBbtQu+FqE2m8Fr29VN Qu0sn5P1hQWXhx0VW7x8imaaPlztWY/K4kbkY5njbY0j/VB+5Cc8vAK0Nnc9S0EkKYt4 0kmg== X-Gm-Message-State: AOAM532utT0nHOugcfz2YOQxtV1t9tRAM03iZfZkXRReeDEG7wlfp06J VQyKlp1GZyE24qSKRvNlu+tOnbRbKJjdz0jN8POZMg== X-Google-Smtp-Source: ABdhPJyI9aI5b3pmXuhMgGrCrrMpBrygNRxfLkTQjP+IQ0Z6lG4mFD0G0YvJFmbR/nZxXl1QGX0zhYxPd3SDPBH82Q8= X-Received: by 2002:a02:a910:: with SMTP id n16mr2826341jam.35.1603475424367; Fri, 23 Oct 2020 10:50:24 -0700 (PDT) MIME-Version: 1.0 References: <20201023050214.GG23681@linux.intel.com> <356811ab-cb08-7685-ca01-fe58b5654953@rasmusvillemoes.dk> In-Reply-To: From: Naresh Kamboju Date: Fri, 23 Oct 2020 23:20:13 +0530 Message-ID: Subject: Re: [LTP] mmstress[1309]: segfault at 7f3d71a36ee8 ip 00007f3d77132bdf sp 00007f3d71a36ee8 error 4 in libc-2.27.so[7f3d77058000+1aa000] To: Linus Torvalds Cc: Rasmus Villemoes , Sean Christopherson , =?UTF-8?B?RGFuaWVsIETDrWF6?= , Stephen Rothwell , "Matthew Wilcox (Oracle)" , zenglg.jy@cn.fujitsu.com, "Peter Zijlstra (Intel)" , Viresh Kumar , X86 ML , open list , lkft-triage@lists.linaro.org, "Eric W. Biederman" , linux-mm , linux-m68k , Linux-Next Mailing List , Thomas Gleixner , kasan-dev , Dmitry Vyukov , Geert Uytterhoeven , Christian Brauner , Ingo Molnar , LTP List , Al Viro 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 Fri, 23 Oct 2020 at 22:03, Linus Torvalds wrote: > > On Fri, Oct 23, 2020 at 8:54 AM Linus Torvalds > wrote: > > > > On Fri, Oct 23, 2020 at 12:14 AM Rasmus Villemoes > > wrote: > > > > > > That's certainly garbage. Now, I don't know if it's a sufficient fix (or > > > could break something else), but the obvious first step of rearranging > > > so that the ptr argument is evaluated before the assignment to __val_pu > > > > Ack. We could do that. > > > > I'm more inclined to just bite the bullet and go back to the ugly > > conditional on the size that I had hoped to avoid, but if that turns > > out too ugly, mind signing off on your patch and I'll have that as a > > fallback? > > Actually, looking at that code, and the fact that we've used the > "register asm()" format forever for the get_user() side, I think your > approach is the right one. > > I'd rename the internal ptr variable to "__ptr_pu", and make sure the > assignments happen just before the asm call (with the __val_pu > assignment being the final thing). > > lso, it needs to be > > void __user *__ptr_pu; > > instead of > > __typeof__(ptr) __ptr = (ptr); > > because "ptr" may actually be an array, and we need to have the usual > C "array to pointer" conversions happen, rather than try to make > __ptr_pu be an array too. > > So the patch would become something like the appended instead, but I'd > still like your sign-off (and I'd put you as author of the fix). > > Narest, can you confirm that this patch fixes the issue for you? This patch fixed the reported problem. Tested-by: Naresh Kamboju Build location: https://builds.tuxbuild.com/uDAiW8jkN61oWoyxZDkEYA/ Test logs, https://lkft.validation.linaro.org/scheduler/job/1868045#L1597 - Naresh