Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2399466ybi; Mon, 1 Jul 2019 11:19:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzweXhwrxJhH8vYm4pPsGleTT4g4TyHzkDTLHTytVnUFkcVUadF1GjppZFb9pxHsukBkwqX X-Received: by 2002:a63:fd0d:: with SMTP id d13mr26892133pgh.423.1562005194693; Mon, 01 Jul 2019 11:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562005194; cv=none; d=google.com; s=arc-20160816; b=ZZ7FwEwSiIiB2aa99d1TCf5t5JGjiwSb4l1UI8dePGDFqS7M3ibnyrKRHGMlBZ/Xvg uVNIS8JeRj6OtigkBNL77OK2ucSzcLxGk7C1wkdc/ZMhrbKg0B+a1zNK1NHaNCHyR6dO sYLYkmhZC/gyjp6ta/k2QDyB6jqPp6AS9FxHIcfPFZz04YMkOHB1yeB4329VXDo1kM60 dNfHY8uDvETOEvaLl+ea+RYSaqiuuXMAp343FkI9w7EASjSiSWibW3OtcFi0yuqg6E4G kUnDAao2hbW/+MHUloVVOcdNPKqhLFcpUnFgsiq1eXXD4dH2fRJXJb6Ak2fKMq35XmIo W9Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=x0MceWmB38MBmyytyZTUMrlMWkvR9R48mIZ+hG81Vpo=; b=pC9YhDHDrhkOe3EGwFYG5zaCBBVf9LV1/8YdDGKk2+lBJVXGZaDhFfaQtQErojMma8 rtP5LwHM1/iNacuTA4qWCISAAT/fVKuhZvY7SVb9okTqVtpVvihzGmRFfD9k7O+SdDXg BtKfEXY8m9KfFOpxB87F0ePlcUBkjdA2cwrPRt4Axh1NCTAU+QOv+JP18pmVqCdPcJP4 ssOuHWQ+OycP9khFscgXWFJ9g6e1AH2qC5Px9ezA5oGLvwWDOCPecAaAHLnytdVzr6Ag xM8c0+0wmP82eGumVvFJBCXM7Sx9fDjBKBr8XVmNv8f38gpIYMUI5lcF8DFpzYwq7Z+C NVhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h64si3972772pge.208.2019.07.01.11.19.31; Mon, 01 Jul 2019 11:19:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727987AbfGARd4 (ORCPT + 99 others); Mon, 1 Jul 2019 13:33:56 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:41861 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727130AbfGARd4 (ORCPT ); Mon, 1 Jul 2019 13:33:56 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1hi0Be-0005Or-7t; Mon, 01 Jul 2019 19:33:54 +0200 Date: Mon, 1 Jul 2019 19:33:54 +0200 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Peter Zijlstra , Andy Lutomirski , Nadav Amit Subject: [PATCH] x86/ldt: Initialize the context lock for init_mm Message-ID: <20190701173354.2pe62hhliok2afea@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mutex mm->context->lock for init_mm is not initialized for init_mm. This wasn't a problem because it remained unused. This changed however since commit 4fc19708b165c ("x86/alternatives: Initialize temporary mm for patching") Initialize the mutex for init_mm. Fixes: 4fc19708b165c ("x86/alternatives: Initialize temporary mm for patching") Signed-off-by: Sebastian Andrzej Siewior --- The rwsem `ldt_usr_sem' is also not initialized for init_mm. No idea if we want this. arch/x86/include/asm/mmu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h index 5ff3e8af2c205..e78c7db878018 100644 --- a/arch/x86/include/asm/mmu.h +++ b/arch/x86/include/asm/mmu.h @@ -59,6 +59,7 @@ typedef struct { #define INIT_MM_CONTEXT(mm) \ .context = { \ .ctx_id = 1, \ + .lock = __MUTEX_INITIALIZER(mm.context.lock), \ } void leave_mm(int cpu); -- 2.20.1