Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4607480pxj; Wed, 12 May 2021 09:08:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBfB6QXZedhioj+jeEAcrvD1nHF9t60vtOO3uf2sFHN5VhdM2KWWE/WV1hAPpdwPDXlFxU X-Received: by 2002:a50:8fe6:: with SMTP id y93mr44063251edy.224.1620835719396; Wed, 12 May 2021 09:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835719; cv=none; d=google.com; s=arc-20160816; b=dul19nRHWd7X3CKXWKXW2nokBKsCX8RCDtShTRswP1c4Vpy8ROrh29YRQNtpho9TEa VjZWJAJLwvukTIGHeQQcawkrSTSisGlPgO8AHc+gbcdkoDt5B4Gtpuqy4gGAuMatxWQf haPm3f805W6UrA70LFwbxavQs/DcyqE3AJdO9+7MNgPnWDJUg7+7YsRPsFWPgOl9h8j2 IjvRojJAOM5ZaJkog8nx6ZpsT7hQEHNm9DR7IkwqCZ7GS1kv2ENQxU3BVLtAgeXM8zwF Tfi9rYvdZaiGsnsqAZYSLTt2XPYu9X87dG6E/DTK0BIi106LvM8UJFD1c/H+KkEkk932 DalA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jCroFbAiTkp3k830niKAWPptFsiEI18XW/Hn/IVKn5Q=; b=HDNySHLI1ab+kdqQ7lMn3DI1n5Z/LbW5+s9Y6ww/AWW8o2Hw/rlk9hXdLtkWOghthW FHYX7nQxr7aFH7Ugo8Akr0WZ4ER+dQx8L7J7KNG58mufIvFYG8psCWvc4cimq5WhQ3BW ck2nTEJgw1nCNf5oQT4dqgVb1JY20GPi6yPdWTpaqxE7QI8X/FWmUv+CXY1o9GWfPiHn 5hNOGDuJFPqEGZh5fhyepryi1Mf2x3jq+EBBWg1qO5kN4tKRyQEz/8PYZhYNH5Ov32Yr OhXjdsdyYUPmlMNkQAljJhtxlmHAMYakbVAEWGRycvQJcs24nNgAjFjYTKtZCM3vQehv QiMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vEVBak5r; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd28si364449ejb.696.2021.05.12.09.08.15; Wed, 12 May 2021 09:08:39 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=vEVBak5r; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239044AbhELQHK (ORCPT + 99 others); Wed, 12 May 2021 12:07:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:40900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235679AbhELP2q (ORCPT ); Wed, 12 May 2021 11:28:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AECE66192C; Wed, 12 May 2021 15:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832486; bh=ME+o8qVmDRw6Mq9SpL5ndvS2yjgea2XcS6Yz5PbfQF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vEVBak5rP8Io7mthF3AkRtW73Ex4YZ/4scDfnf2cHvNXP2kZnPUopU09+tmTY/eqN PS3CNslDa9JWmn81HQePtmVRcKUTx/7jFRTga0eldggazKXOic1u8z+yZB7JNRvnyk 7+jfnU5vX6s3g2/po0sy2DvuidZ2SLNngdN7EUA8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Liam R. Howlett" , "Matthew Wilcox (Oracle)" , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.10 254/530] m68k: Add missing mmap_read_lock() to sys_cacheflush() Date: Wed, 12 May 2021 16:46:04 +0200 Message-Id: <20210512144828.185791552@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Sasha Levin --- 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 1c235d8f53f3..f55bdcb8e4f1 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 cache, unsigned long len) ret = -EPERM; if (!capable(CAP_SYS_ADMIN)) goto out; + + mmap_read_lock(current->mm); } else { struct vm_area_struct *vma; -- 2.30.2