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 53394C4363A for ; Fri, 23 Oct 2020 17:50:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D828024640 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" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753846AbgJWRu0 (ORCPT ); Fri, 23 Oct 2020 13:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S462911AbgJWRuZ (ORCPT ); Fri, 23 Oct 2020 13:50:25 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 203B7C0613D4 for ; Fri, 23 Oct 2020 10:50:25 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id u62so2794290iod.8 for ; Fri, 23 Oct 2020 10:50:25 -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=X7oUxApnOOJPiRSwl37bJoEKJzXfk1mnvdOR5PNLasxwOz4QpEcNgU3bYVXQ7C4NkM ddxLhIfWWoAHvXpETdd7TdRAlKS+CDXsjfgkhMQQbDNJjY/HWzK/uIO+TiRBaT+rrlUo U6sMj5J/qUinzUBHnPHhNEnuVHgx9bqmWCiAF6pR5EvEawb4R6THRAPNksX7L8aBMT+H HqNP10O6gqBLZQnqb73/k06rp9zG4Mi/LglFyV1RWSi/t6ME8rseVdGXzJo8WvbzHWbA /8pJwpEGg7F/btoQb24260MzD71zx+mixekwfH95WNa+cV0h6QPjyN1PBv4bo0WaHf1Q SQjQ== X-Gm-Message-State: AOAM5332w3Thwi/AVjFuRL0KETL2n/kMNQ0oMcBwW6PFVajBtC0foTON Fucz4e/Y7OBeph0SBS9WkW+jj82Nn0t6EJuoYAXQiQ== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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