Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2860966pxv; Mon, 12 Jul 2021 03:49:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXtJeg/2O/P1yzRRv6LtfVZ7OWLZHnLySoL802fG0PMf46Aet9gZAW+fqeymt9NhMqJJZF X-Received: by 2002:a6b:f813:: with SMTP id o19mr21702695ioh.49.1626086978026; Mon, 12 Jul 2021 03:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626086978; cv=none; d=google.com; s=arc-20160816; b=AwxjUUbpfOuHwt/jDJzi6kei+TPDLCDFq4iMqk/0UODHKzFG2cyYIlGoG5xx7B1FVr MLZFJkhm4badgfMsFOYMfc0cW1ZD/SqEYdrzfl0rUPDDoDmzbz8Ft1ZYzie8vXIUUd4g 8fYQ153C49lYaBWXJfZsfsTBBmq7JnKsXOpPP/5ANCwMLqoStpxCxBUOzkjeO0Ln45DP qziJ5qn23SQvcG2VbZ9pv5TM1yfj5cPeBGdjY2SgEDm4LDYlN/mjR3P+HO+7iO52++XN 0QkAekSFFvL8L0wqBtuoIUm/5SpebcVJvA5vpjCneovZbvhULydQuhbJb3oje2Ber/Zf XRnQ== 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=33y87NLIDcQ+wEFFFB2HnvT/jB/jp2EFUAcUp7XWuHA=; b=SrpMcW8GR+HPPszRN9IiqNOJ7IBwMv4UE98xtY4wlTOW6Nk/UsXCKFuYXjRQ3DDDz+ SD7mLJQnLiz95oS/N9a+xxVXRVqS4y/PNFCKhkTz/f0Gok/oicp8dZaQmWxfSueaYxAG mYWd5+gJ/APH9C4M1t7IEB0kfKi31CBo9STPfp8W+VwAgPnAZPjfBgY4r/afUn8TiYCH UT5TxDCl2nTW8MwnFHReTuxd+/qNGacTMZmHMZEk2yOk7yU1sanMihqehJiqKZRE2GJ7 4Z3eCBOjrIOzO9H5pJs2s3KM6G76k2m7OdWHwjSzlRgqUCFr0DCpL5siErEKe8Bp5ory CkRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fkWNY9J0; 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 e16si18609004iom.90.2021.07.12.03.49.26; Mon, 12 Jul 2021 03:49:38 -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=fkWNY9J0; 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 S1355459AbhGLIJp (ORCPT + 99 others); Mon, 12 Jul 2021 04:09:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:43708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345316AbhGLH3n (ORCPT ); Mon, 12 Jul 2021 03:29:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E42C261448; Mon, 12 Jul 2021 07:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074778; bh=IPeU1+DPfLeGp3jgG7TlWOA5Uz7mLiDuoDU1hAU1Yec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fkWNY9J0s7j6hf871zuNWl4K9HRNc49FLYkyRWuOvt5Uni74UF0JuzkFt4KrdHWO5 TOcGVrjW2mdWimPXdYt7vDD/cI/LtMaermy+kviFjUc5ZdX/aarT+Otv7bF9jSUcCv 6tQ+UqAgQvxSd6NZQzk2kePsVQJ+9VIVR5yD7DaA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Birk Hirdman , Pavel Begunkov , Jens Axboe Subject: [PATCH 5.12 694/700] io_uring: fix blocking inline submission Date: Mon, 12 Jul 2021 08:12:57 +0200 Message-Id: <20210712061049.765644537@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@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 commit 976517f162a05f4315b2373fd11585c395506259 upstream. There is a complaint against sys_io_uring_enter() blocking if it submits stdin reads. The problem is in __io_file_supports_async(), which sees that it's a cdev and allows it to be processed inline. Punt char devices using generic rules of io_file_supports_async(), including checking for presence of *_iter() versions of rw callbacks. Apparently, it will affect most of cdevs with some exceptions like null and zero devices. Cc: stable@vger.kernel.org Reported-by: Birk Hirdman Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d60270856b8a4560a639ef5f76e55eb563633599.1623236455.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2683,7 +2683,7 @@ static bool io_file_supports_async(struc return true; return false; } - if (S_ISCHR(mode) || S_ISSOCK(mode)) + if (S_ISSOCK(mode)) return true; if (S_ISREG(mode)) { if (IS_ENABLED(CONFIG_BLOCK) &&