From patchwork Tue Jan 28 13:59:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 232439 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=-6.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,USER_AGENT_GIT autolearn=unavailable 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 81110C33CB2 for ; Tue, 28 Jan 2020 14:48:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D7A5207FD for ; Tue, 28 Jan 2020 14:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580222913; bh=gw2aZ1LbbeRJTTJCpYwXXL2rPlgmBOh3zKCfCJdZV6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Qj7RLFbdwt6elOS8VN5JA/RwSmyeZazfCpW/DPBeZm8xf9wWFmLBKTnTdgwHoNy9j E8Krwwj3gjPH76DxZ1qKCye0/yjkS8TGQhuDiJtkD9WUzhV5T0nK4iVABFKE/1nJcN KZRjCO2DdvQsgrddB/My6fRsIaaO6hXllH9BmGII= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727601AbgA1OCW (ORCPT ); Tue, 28 Jan 2020 09:02:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:48632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbgA1OCV (ORCPT ); Tue, 28 Jan 2020 09:02:21 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E2D4024683; Tue, 28 Jan 2020 14:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220141; bh=gw2aZ1LbbeRJTTJCpYwXXL2rPlgmBOh3zKCfCJdZV6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l+xvT8RPZTqAUrevFiFsN6X2kZGQwY7yqmHAHOLr1UhpE/jPiC/FjShWSYYtLdclk jXlGMYCcVYRKEcGWJhsUa+pcjuPM1YU3qIBsPNexyt0pXgxUPMr6XzMk95ZEcSfjfU 5bn0u0iWFuE6gly9o8z5HcqtvD/1Ew2spjsp8CFs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andres Freund , Jens Axboe Subject: [PATCH 5.4 033/104] Revert "io_uring: only allow submit from owning task" Date: Tue, 28 Jan 2020 14:59:54 +0100 Message-Id: <20200128135821.839050866@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135817.238524998@linuxfoundation.org> References: <20200128135817.238524998@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jens Axboe commit 73e08e711d9c1d79fae01daed4b0e1fee5f8a275 upstream. This ends up being too restrictive for tasks that willingly fork and share the ring between forks. Andres reports that this breaks his postgresql work. Since we're close to 5.5 release, revert this change for now. Cc: stable@vger.kernel.org Fixes: 44d282796f81 ("io_uring: only allow submit from owning task") Reported-by: Andres Freund Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 6 ------ 1 file changed, 6 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3716,12 +3716,6 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned wake_up(&ctx->sqo_wait); submitted = to_submit; } else if (to_submit) { - if (current->mm != ctx->sqo_mm || - current_cred() != ctx->creds) { - ret = -EPERM; - goto out; - } - to_submit = min(to_submit, ctx->sq_entries); mutex_lock(&ctx->uring_lock);