Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp8673887pxu; Sun, 27 Dec 2020 15:42:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqv6o51s8XsrEajcaaq83kB5uMRSmFNcj+NUhHG0RyipGNN8Udlhczakkxrl1rtBY4kDqX X-Received: by 2002:a50:a6c2:: with SMTP id f2mr40089385edc.7.1609112551200; Sun, 27 Dec 2020 15:42:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609112551; cv=none; d=google.com; s=arc-20160816; b=phpCKZQNnNieUN7qgYUOc6Nnn6RDuQS4VqHCrQYHx0gTW4ECc78iaRuzCTFXomtow5 i0DJmqL6ukp+moXan77ydn8VJygsMn6b8pZBEaIJyvBG9l+fes+Bh9TpWLX9gSbxdoSI qzc2CRNYB79TcN6Mq6rxnXvFpZtAI66kAB1G1I0Dy2ZCN2V53ZhM+YixgGw8wIUf3Nbm KUShxHnbUQw25rGwZZCmTS5lz6pxkuORc2c5u+G+GpseVRpzS9f38TOE7OTpYPf67+9P tgBaPAYHyiwuXyt0c++iJYJwriBH2i+q/P+0NW18KFzi2khueXsxnL8LhZtZ/KmlU9QK ORfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2g/tw1CfRfSS28JS/E5UEQtXF4RogkgHtVGCAK+cqLg=; b=nlU7zpoHdukTCbKUlA7TSqF2rO4x/js7wnMeKtBUH1h+WW4Un8KxBefV4yFTIUDFUH vYYijiRc/HsJ2LTbCkcveKaL97Ial3K1NKbxc0LAmIC3s24lA0z/DCJW6U0u0qHZptT2 Rle/0GGDCxGBwMxQIC9l4wOaQ5DOREp+AMSK0M+QxJMdFKjAtMfGrLA/Lg3UFFIhtiFw 5FB9qGcCVZARbQ9wqSKGm0H1+vcVNWxBVzLwlzbLD7U8aGvRxie5AGGT25k/u1h6lmoe mKliUDPru+AxmJjSSa03mkRxVDcpkgMKXbzKb+JdWwoPvfC1dRL1pvME77W1o5U7800O gX1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=hmk+nXUK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga15si17378965ejc.598.2020.12.27.15.42.08; Sun, 27 Dec 2020 15:42:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=hmk+nXUK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726320AbgL0Xlh (ORCPT + 99 others); Sun, 27 Dec 2020 18:41:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgL0Xlg (ORCPT ); Sun, 27 Dec 2020 18:41:36 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B3B8C061794 for ; Sun, 27 Dec 2020 15:40:56 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id o19so20524932lfo.1 for ; Sun, 27 Dec 2020 15:40:56 -0800 (PST) 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=2g/tw1CfRfSS28JS/E5UEQtXF4RogkgHtVGCAK+cqLg=; b=hmk+nXUKCLprIED87lepHbqNo9/5jDD/zPgpKqfdGUAfyt5eQN8IPSx+3kRgMMUEUo WENraXsqaYlObe0ODWSqZ3r0hKg3rOLnExPsZHKeesNCNNc0ihW35MuIOnqY4fkAS3BZ dhMQhiHVyIoLXszKYVzPhcMPZpMIyqz7BTmxg= 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=2g/tw1CfRfSS28JS/E5UEQtXF4RogkgHtVGCAK+cqLg=; b=E3JfffUfv9CMn6lS5WFUEzasa/uaWFCQzZoalZyQZnZutRtzFS8MHZK8s35Rdp6tjc dUxVqniO74pC47ONP1hMRnlI94qalzoeUf1Jnl5xJqHX9qmtBwBYLICxq0PItAjc8MAF vd+a/OXeYhnvm607iaHgbiUBwqZnTHWxnf16lMQaI5Oe7MyyEWVtnZujcN6dpw34YzyC XOgS6LKpeGEpD2wgLPp+h+oD1+dou5CtdDmcW1kxbn17E1MU5B1UXthS07KEmXGxLnOz cgZRf1qY9NyHX8EBT/tKuTQw0ejbONDfNh8HUp83dfEpx7otj1zwzGO+M+DZe9YGDQef faYw== X-Gm-Message-State: AOAM533NR45whXk65F7Q2kdZGj3t1eQoCEYkm620ZfjFE8yqpnPRJQNO 09/mOntHr0MSKzNT7vDBj0zWja0ikDeTKA== X-Received: by 2002:a05:6512:3e6:: with SMTP id n6mr17346428lfq.262.1609112454075; Sun, 27 Dec 2020 15:40:54 -0800 (PST) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id y13sm5161653lfg.189.2020.12.27.15.40.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Dec 2020 15:40:52 -0800 (PST) Received: by mail-lf1-f42.google.com with SMTP id o17so20476312lfg.4 for ; Sun, 27 Dec 2020 15:40:52 -0800 (PST) X-Received: by 2002:a2e:9ad7:: with SMTP id p23mr19677994ljj.465.1609112452213; Sun, 27 Dec 2020 15:40:52 -0800 (PST) MIME-Version: 1.0 References: <20201225113157.e7hmluffh56fszfc@box> <20201226204335.dikqkrkezqet6oqf@box> <20201226224016.dxjmordcfj75xgte@box> In-Reply-To: From: Linus Torvalds Date: Sun, 27 Dec 2020 15:40:36 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting To: Hugh Dickins , Andrew Morton Cc: Damian Tometzki , "Kirill A. Shutemov" , Matthew Wilcox , "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Vinayak Menon , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 27, 2020 at 3:12 PM Linus Torvalds wrote: > > Ok, your fix for that folded in, and here's yet another version. Still not good. I don't know what happened, but the change of - vm_fault_t ret = 0; + vm_fault_t ret; is very very wrong. The next user is + if (!(vma->vm_flags & VM_SHARED)) + ret = check_stable_address_space(vma->vm_mm); + if (ret) + return ret; so now 'ret' will potentially be used uninitialized (although this is the kind of thing that a compiler might almost accidentally end up fixing - with a single dominating assignment, I could imagine the compiler moving the test to that assignment and thus "fixing" the code without really even meaning to). I think Kirill was intending to move the "if (ret)" up into the path that sets it, IOW something like + if (!(vma->vm_flags & VM_SHARED)) { + ret = check_stable_address_space(vma->vm_mm); + if (ret) + return ret; + } instead. But that patch as-is is broken. Kirill? Linus