From nobody Fri Nov 22 05:05:07 2024 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C91213C69E for ; Mon, 18 Nov 2024 05:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731907347; cv=none; b=fBj4ejYMBp/1INAl7kcRzgv1TB9yBtzjY8tK8/kAFHvBIpQ6H8ViOn/WPGF7L2ACn7qt2NbMIEqOiU4HQxzuX0yzfzvMLOrsw4cT+rPNkzu6CJgmR3XQ8Qh66jLI8aZcm0Q9lsF4pYZmik/aP4mtjArynfumvxGI8T6nywSwfr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731907347; c=relaxed/simple; bh=KelfrUEDKn1STr/uyl6Wn/gXFShtj7LS2NXx40teaXU=; h=Date:Message-ID:From:To:Cc:Subject; b=FhQTD2MrdA8Zrg/KsSwnQnevtzKQpgaAVUPqMsYQx/kA/mytrxgBuquQqUMChirHCtZLN7gMdPkOah3hZq07ni1YEMMi9zZWkX//TmmD/SBjiM6dXbQTlF6CQZyBBTb4w7AoczJJpXM5NvilIm9Dv4D5YaweqHROgfLrFNsqTG8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=none smtp.mailfrom=linux-m68k.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=A+o/nVSK; arc=none smtp.client-ip=202.12.124.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="A+o/nVSK" Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.stl.internal (Postfix) with ESMTP id 41E36114011A; Mon, 18 Nov 2024 00:22:24 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Mon, 18 Nov 2024 00:22:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1731907344; x=1731993744; bh=2pmDU7e3MlYtu8haZn4roILPX83I 3ITd6BRmfCF1ljE=; b=A+o/nVSKft+oQl4p8ZmqM2nqTN6LmPGK1W38jyBqf4Lb nrZwrPmZijynn6bxGXUx4ydfauROzXY3Dyc/yC94qc/mdwaM/n4bvfClc3mFShlW YA46HfnKqk/8h8mU+fzzcbdZ1EOFrIx/+jUx0RqErRVGujLrwiDrRn1NiUJhqFOm /NjD4q8FE/CxH5udU2nYOavPbtukSwrF6TSdIr5JDm0DVMr5d0j+4AMRaUXofAEY 0e66ckHdJNfKwFNkgPYf9Of0Q93mvSVnPwCyW9ECcRa46Uf9w+1jMZwMF3NoFKlm 2RbXEsp3bugGwLuGjdg3Ja0ZFACFlDyp9RibDCKgDQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvdelgdekfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffkffhvfevufestddtjhdttddttdenucfhrhhomhep hfhinhhnucfvhhgrihhnuceofhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrgheqne cuggftrfgrthhtvghrnhepiedugfduhffgheekjeekffduueejudevffehiedtledttdek veekuefhvdfftedunecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfthhhrghinheslhhinhhu gidqmheikehkrdhorhhgpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehsthgrsghlvgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghgv vghrtheslhhinhhugidqmheikehkrdhorhhgpdhrtghpthhtoheplhhirghmrdhhohiflh gvthhtsehorhgrtghlvgdrtghomhdprhgtphhtthhopehlihhnuhigqdhmieekkheslhhi shhtshdrlhhinhhugidqmheikehkrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrh hnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Nov 2024 00:22:20 -0500 (EST) Date: Mon, 18 Nov 2024 16:22:48 +1100 Message-ID: From: Finn Thain To: stable@kernel.org Cc: Geert Uytterhoeven , Liam Howlett , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: [PATCH 4.19.y] m68k: Add missing mmap_read_lock() to sys_cacheflush() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Liam Howlett [ Upstream commit f829b4b212a315b912cb23fd10aaf30534bb5ce9 ] When the superuser flushes the entire cache, the mmap_read_lock() is not taken, but mmap_read_unlock() is called. Add the missing mmap_read_lock() call. Fixes: cd2567b6850b1648 ("m68k: call find_vma with the mmap_sem held in sys= _cacheflush()") Signed-off-by: Liam R. Howlett Reviewed-by: Matthew Wilcox (Oracle) Link: https://lore.kernel.org/r/20210407200032.764445-1-Liam.Howlett@Oracle= .com Signed-off-by: Geert Uytterhoeven [ mmap_read_lock() open-coded using down_read() as was done prior to v5.8 ] Signed-off-by: Finn Thain --- arch/m68k/kernel/sys_m68k.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 6363ec83a290..38dcc1a2097d 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -388,6 +388,8 @@ sys_cacheflush (unsigned long addr, int scope, int cach= e, unsigned long len) ret =3D -EPERM; if (!capable(CAP_SYS_ADMIN)) goto out; + + down_read(¤t->mm->mmap_sem); } else { struct vm_area_struct *vma;