Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2277139pxb; Thu, 11 Feb 2021 08:29:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwW2Zvtdp1GX/5xXQF3VBY6nqp64rfNXvKpQWh3lOvDwQICrZiVNj7ABw10ITRh9a1ETKyr X-Received: by 2002:a17:906:145b:: with SMTP id q27mr9513032ejc.432.1613060956990; Thu, 11 Feb 2021 08:29:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613060956; cv=none; d=google.com; s=arc-20160816; b=1BM8WalNYKiayW+BuOEmmoBAFSzR0JWyfnGXsQO8Pw1o0ytSmYHA3xOZ9Zic+oAK93 FDfAHaGCUEU6QoMM0VW073EpMu6uVilhBEsJwQP5bvJgUuiR4pE9Wxz5RQyhH2pTtAnm bjUFhNO+xoCsOptA7/IY6mZYMRm6hTReIK/FHnmJRtsxqwyOnJcPgEI9AwXEFdv5I8qZ rAEjDkw2M+lSgQPK4PGt63DuzgmLIcLuZll3HKJT0G+M4otOORujL8AhxOsZ+tCDb8ZG YU5VXhyNx4JKtrRNE9MynclN1+v1PLarCMSEyORksAEqt0QEc1k6RsYQWY87E3JOvxoJ nP2w== 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=+xXZ0155TUrwi6n5nT+ceH9tvidt7KPRCSAgkCt5AOI=; b=XP0V/PumG++MGWcQ9dhGlMP611NJ0rEzcAJ+QiNw64pJY/NolR1ocvGC8XH6xyhBEt 7Bh8mfet6rvyYn5l8zt3+Z99vFPwXrLm4AsfC0q7Apl0OefNtdRTXuz4LtVNYc7r8FwP LtFCB9hFDBz18GgkA7VzuntqbxQFvLpDiZvRgBv0oA9dgG0H4iRWP7YzVQljGjzNUVQr rQ6pHmfU5AmcNloUtwdkVm6f3XcPO32Pe1Zb6NUBbNnr8zujomKVHKuD8fiLF7i12Vlm wUd2mf++5JVQRtj/5xPsTwGVXZD/Zw6dWywHHnAsaFEKW85BCqKPFPE9hoa16bSlh5rZ gXjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cAqb66xS; 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 e13si3963451edz.214.2021.02.11.08.28.53; Thu, 11 Feb 2021 08:29:16 -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=@linuxfoundation.org header.s=korg header.b=cAqb66xS; 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 S230365AbhBKQZq (ORCPT + 99 others); Thu, 11 Feb 2021 11:25:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:53520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbhBKPYz (ORCPT ); Thu, 11 Feb 2021 10:24:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82CED64EAC; Thu, 11 Feb 2021 15:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613055810; bh=UX8knx71OTQhAq2JbIxW49k4VFQBjNbCR0qusov5xgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cAqb66xS1RIb/tiTtbPlTXDSzr++82Ku3ZxFwW+MiXHSBp5y9XdDJ1zsaqUOAI+xy fOP1ZUsGw3yOvPFbagZG5xvOvOvhCTahVYNNmqptjSa/ozv6SQpEQE19xnbNCjcSHS 2PIWr4q0+wTFIIhai/rV3CVsSVd5V7p0wk5a71i8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Jens Axboe , Pavel Begunkov Subject: [PATCH 5.10 16/54] io_uring: drop mm/files between task_work_submit Date: Thu, 11 Feb 2021 16:02:00 +0100 Message-Id: <20210211150153.580290349@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210211150152.885701259@linuxfoundation.org> References: <20210211150152.885701259@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: Pavel Begunkov [ Upstream commit aec18a57edad562d620f7d19016de1fc0cc2208c ] Since SQPOLL task can be shared and so task_work entries can be a mix of them, we need to drop mm and files before trying to issue next request. Cc: stable@vger.kernel.org # 5.10+ Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2084,6 +2084,9 @@ static void __io_req_task_submit(struct else __io_req_task_cancel(req, -EFAULT); mutex_unlock(&ctx->uring_lock); + + if (ctx->flags & IORING_SETUP_SQPOLL) + io_sq_thread_drop_mm(); } static void io_req_task_submit(struct callback_head *cb)