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.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS 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 513AEC606B0 for ; Tue, 9 Jul 2019 09:11:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2732021537 for ; Tue, 9 Jul 2019 09:11:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QpsAKtUK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726582AbfGIJLa (ORCPT ); Tue, 9 Jul 2019 05:11:30 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40792 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbfGIJLa (ORCPT ); Tue, 9 Jul 2019 05:11:30 -0400 Received: by mail-lj1-f193.google.com with SMTP id m8so9328342lji.7 for ; Tue, 09 Jul 2019 02:11:29 -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=9LTtPPOn4Ak8eK9FW8AabXZcBEJh0Lnb8xIdmS0/IJU=; b=QpsAKtUKi/9eTxa+EeMW6C9efPOxUkmSK+eftMzIKmxy/utKmzJkDuPGkCNljZhsc5 7iGyYTINlQH1eyfo1fjveiJ4DUGoW55nFZnlng1tG8AIyVg2vFN0ut9eN0lBIMq1EkE5 f++VbpJFM+hwEokcwO+WXfLlCQwI9IaiH3l1EKg0RMDB27aXHmOLIUwRPhlh6FZ3KSnm qSa1D99CUlPAR/fI5sejfEI19alRwKz0FrBuodUW1DWIJEu95TRxrWHXgnLm9HGrVJ1q BQZX54uMeqpe7Fe0u9LObF19YHlaNubRtH+zSJfn1UwBuWYpB+mxCouPVukEYPIuEhFj 14Nw== 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=9LTtPPOn4Ak8eK9FW8AabXZcBEJh0Lnb8xIdmS0/IJU=; b=UsGpeprMmCOy/144ieQPss7nGyiVnpaExpzkRFUG2Y8OUoBoi/qYEkLQJIjJamvELD i6FvR5SA9NrzzvoJhczRlsz7aQQHvG7ApmgJ7ubN4YKI0IEPCN2MhzxlmjhXqh41TSBP PUb2G4p34EkhBq5ILvVJIwmfHjKpymylkFHDklOJ/fTqi1jZADvDlRHke7RjnWGC9VDz 51nmfWSHxkwUz1AVUeTZvsNe70HgzlI8AcvVOgg+ZlTtBmhtGD0l99spOSUFmv3yc9C2 1bS8yKgidN4GwPYdv0fOuh8yESQZw61N5Ge0+JckIaTr7XuDwkfdDMvlxhgOKMnKMpRH CBvw== X-Gm-Message-State: APjAAAUHhM6+vsUYr/T0WLIA0m9+/zowHgHy+pRVTu4UdeI/gjV+cucl iIavtoydqRRrgbJ90xi2npyG3oeBW5kEs+J6/KnUeg== X-Google-Smtp-Source: APXvYqwiB3XqZd0MLimd/C9W++RvKxUs5C/lBSsyMkteU5OX/BLh17CZP9xgh8x3if6F4yr2ncjHO1cjnBQHMatTz0c= X-Received: by 2002:a2e:9593:: with SMTP id w19mr10055087ljh.69.1562663488615; Tue, 09 Jul 2019 02:11:28 -0700 (PDT) MIME-Version: 1.0 References: <1561671168-29896-1-git-send-email-opendmb@gmail.com> In-Reply-To: <1561671168-29896-1-git-send-email-opendmb@gmail.com> From: Linus Walleij Date: Tue, 9 Jul 2019 11:11:16 +0200 Message-ID: Subject: Re: [PATCH] ARM: mm: only adjust sections of valid mm structures To: Doug Berger Cc: Linux ARM , Russell King , Laura Abbott , Mike Rapoport , Andrew Morton , Florian Fainelli , Rob Herring , "Steven Rostedt (VMware)" , Peng Fan , Geert Uytterhoeven , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 27, 2019 at 11:33 PM Doug Berger wrote: > A timing hazard exists when an early fork/exec thread begins > exiting and sets its mm pointer to NULL while a separate core > tries to update the section information. > > This commit ensures that the mm pointer is not NULL before > setting its section parameters. The arguments provided by > commit 11ce4b33aedc ("ARM: 8672/1: mm: remove tasklist locking > from update_sections_early()") are equally valid for not > requiring grabbing the task_lock around this check. > > Fixes: 08925c2f124f ("ARM: 8464/1: Update all mm structures with section adjustments") > Signed-off-by: Doug Berger Cc: stable@vger.kernel.org ? I'm not smart enough to say whether it is the right solution, but I also want to test this on some boards I have. I suspect this may be part of the problem I have with mounting root on a USB stick on some early mpcore machines, so I might come back with a Tested-by. Yours, Linus Walleij 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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 67AACC606B0 for ; Tue, 9 Jul 2019 09:11:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3CB7921537 for ; Tue, 9 Jul 2019 09:11:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KC6e7apP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QpsAKtUK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CB7921537 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Naso7UPcnf71XqYRgM+Uo3lKpdxTdh1OstSYuGAole8=; b=KC6e7apPAABMJM 2i3vGCneZTOEMHEzaFC79njNa168uOrTJQmWRg2ExfvqSrCH6fPEzMbXvHQJCSasPq5itWlOfkbi4 QQjGjRA00B9n1x1MD3G3MApkujwBRRoOXoPUah4w+XPHQ6CF48noXCJHBT4r0t4UBsH23/iNJLZCE j1hJ7o5RGiUn+4G+Nv9umX2LMBc54r+s+bMDAN3vLM8Lmtn6M/jmF31vG8hdefsnTt4FQxqftuOla KYbQ/hs9AVCEXG0GJ/dPyW7flEU1y0cWeYTHfTtZs/BXetTK2Rwed5a7Z3sRSEn+ZjPxPYhIVQms9 a8rDW+IyDL/RgqH9fLLg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hkmA1-0006Uo-0C; Tue, 09 Jul 2019 09:11:41 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hkm9q-0006Qm-Rz for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2019 09:11:32 +0000 Received: by mail-lj1-x244.google.com with SMTP id k18so18799730ljc.11 for ; Tue, 09 Jul 2019 02:11:29 -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=9LTtPPOn4Ak8eK9FW8AabXZcBEJh0Lnb8xIdmS0/IJU=; b=QpsAKtUKi/9eTxa+EeMW6C9efPOxUkmSK+eftMzIKmxy/utKmzJkDuPGkCNljZhsc5 7iGyYTINlQH1eyfo1fjveiJ4DUGoW55nFZnlng1tG8AIyVg2vFN0ut9eN0lBIMq1EkE5 f++VbpJFM+hwEokcwO+WXfLlCQwI9IaiH3l1EKg0RMDB27aXHmOLIUwRPhlh6FZ3KSnm qSa1D99CUlPAR/fI5sejfEI19alRwKz0FrBuodUW1DWIJEu95TRxrWHXgnLm9HGrVJ1q BQZX54uMeqpe7Fe0u9LObF19YHlaNubRtH+zSJfn1UwBuWYpB+mxCouPVukEYPIuEhFj 14Nw== 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=9LTtPPOn4Ak8eK9FW8AabXZcBEJh0Lnb8xIdmS0/IJU=; b=i5MVxN1LrIzXBMP6e9+LTGRRDyRITNwFSYrPEgViYIsrSNULdK6nAbwrPuPanxJia3 A0L0f6PIHDtUAIKJ9xWfiNKLQqLaNeIXI9s7u+JgH8em0uGJOxUVR1wrAhQI7Q1RKDbr R8OIRcRgJxUZRsxwVszrUOaMBmFBtkT/GVcLaZNdanbk7veoGDKKzR4QMM4f3ElwSLq6 Iz8NP4twU/+48Ff2ZDG80v62NPjKzeCH7ABT1b/+9pmirBYrhOyW5q/WWeQ6OCkQpXuN Kejk0SjUsZBkPD8X9Q8XwDdOyWfUfXO5AWTRjnHeBXC+8Tm3GaXOx0s+Ys8vXrhcBqXP O0YA== X-Gm-Message-State: APjAAAUgkF3CgetzxamH5yv3qOhLeWbWgIZhQ15ITUnBu/k/Kc3NQnfP mupjam2sEctQFg8EWtL98iqE2gMZEBkwgFgSV+kRMw== X-Google-Smtp-Source: APXvYqwiB3XqZd0MLimd/C9W++RvKxUs5C/lBSsyMkteU5OX/BLh17CZP9xgh8x3if6F4yr2ncjHO1cjnBQHMatTz0c= X-Received: by 2002:a2e:9593:: with SMTP id w19mr10055087ljh.69.1562663488615; Tue, 09 Jul 2019 02:11:28 -0700 (PDT) MIME-Version: 1.0 References: <1561671168-29896-1-git-send-email-opendmb@gmail.com> In-Reply-To: <1561671168-29896-1-git-send-email-opendmb@gmail.com> From: Linus Walleij Date: Tue, 9 Jul 2019 11:11:16 +0200 Message-ID: Subject: Re: [PATCH] ARM: mm: only adjust sections of valid mm structures To: Doug Berger X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190709_021130_968151_C26B4DBF X-CRM114-Status: GOOD ( 12.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Peng Fan , Florian Fainelli , "linux-kernel@vger.kernel.org" , Russell King , "Steven Rostedt \(VMware\)" , Mike Rapoport , Geert Uytterhoeven , Andrew Morton , Laura Abbott , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 27, 2019 at 11:33 PM Doug Berger wrote: > A timing hazard exists when an early fork/exec thread begins > exiting and sets its mm pointer to NULL while a separate core > tries to update the section information. > > This commit ensures that the mm pointer is not NULL before > setting its section parameters. The arguments provided by > commit 11ce4b33aedc ("ARM: 8672/1: mm: remove tasklist locking > from update_sections_early()") are equally valid for not > requiring grabbing the task_lock around this check. > > Fixes: 08925c2f124f ("ARM: 8464/1: Update all mm structures with section adjustments") > Signed-off-by: Doug Berger Cc: stable@vger.kernel.org ? I'm not smart enough to say whether it is the right solution, but I also want to test this on some boards I have. I suspect this may be part of the problem I have with mounting root on a USB stick on some early mpcore machines, so I might come back with a Tested-by. Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel