Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp408619pxu; Tue, 1 Dec 2020 14:31:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfr5iGBpcH6RvoNw1tDw/eMv08WmTTja3lGq4Z/E7mkvKDn6Pt38uGHu3AZid2HjWXO6Ql X-Received: by 2002:a17:906:85cf:: with SMTP id i15mr5419899ejy.373.1606861914486; Tue, 01 Dec 2020 14:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861914; cv=none; d=google.com; s=arc-20160816; b=WwOmdH74wmVnIiLjifBHgZuta47BEQYukiTo0Lmb4UbmWAEMsWkGRfUO8FD0BNNcsF 2nuUmFl73r3M8AxeBE7A/hRtvdVgCTSRQ79gObOwrqExllB1nmDKC1IDQbZ02E/tKZyt heO8RPG9GCeVH4ixyH+OQwytavnpsYxHIZo+aOivVChIQcFCffE+OJur2lN6tnV0uOIK KMbw4YNQPrldx0XXg6iaiZBiaX7yzwmlKEHUvZROc2Y0Da+h5tCeb+D+cY1tsag6XDv5 m/qBzRtqOdDMc9fR/U3a2Z9Xa9JN/4c0NukcScKoYG01/DQb/xNbqWn93TULylnyOvhB YUjw== 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=iy5KQJzetl9u02/BQEhQfLRQTsTcLpcSa7vRrjnryC0=; b=KzUpvIXoT6Z4bTyNViEBDr4LGr8H1yzMU+1tdczoC4YxW5moEtPcGXdKZlH4BSFw6d rIzeZ1ZosI2JQkQ6zygXyoM3su5TKVfDYIjspUKu5audcUuzTIph5c2qLKvCKepzUjE6 9Y+MKDX9Z0NumEW4pcKw7vv2eYzebo5T33pCR1ZS7EQjmRuZ7uJrkluaPy6HjA4bkrJu wsepRKy1NvWIgAk3gbEt5C79eG2Ea0mYpFn9k3S6P4No7r0ye76EKzZZ2KN/DLoLVfHB 3EDBiRyr7dXvBiY5LzQxodC68KRwSTEtvSDmKhINfZxuKGPkeXmrfH2LVYtfvPLMVRyw sU6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wSB+tZrV; 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 r17si826208edq.47.2020.12.01.14.31.32; Tue, 01 Dec 2020 14:31:54 -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=wSB+tZrV; 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 S2389272AbgLAJVs (ORCPT + 99 others); Tue, 1 Dec 2020 04:21:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:45100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389261AbgLAJIe (ORCPT ); Tue, 1 Dec 2020 04:08:34 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 9BCDD206C1; Tue, 1 Dec 2020 09:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813699; bh=P8mpLxYXQ1w9AvpHN/TsUPBGQJXIfuxUnusKsGvz1HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wSB+tZrVuKzmFuuolqH62fAcK3JeebNdJZVreSgY/22xfMJIf5tSfdbP6LYDWYHHG Vmtx81mVQekpJO9F+uEC/3Y3oaTfSKH32T0raPYm8BUJ4YYfWJ+CC1IyjNKPUlmst4 M+Bf/yELjhjYXGeCAF1/Ec0HEDN1rAe45FV+OyNI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Pavel Begunkov , Jens Axboe Subject: [PATCH 5.9 029/152] io_uring: fix ITER_BVEC check Date: Tue, 1 Dec 2020 09:52:24 +0100 Message-Id: <20201201084715.690223207@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@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 9c3a205c5ffa36e96903c2e37eb5f41c0f03c43e upstream. iov_iter::type is a bitmask that also keeps direction etc., so it shouldn't be directly compared against ITER_*. Use proper helper. Fixes: ff6165b2d7f6 ("io_uring: retain iov_iter state over io_read/io_write calls") Reported-by: David Howells Signed-off-by: Pavel Begunkov Cc: # 5.9 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 @@ -2991,7 +2991,7 @@ static void io_req_map_rw(struct io_kioc rw->free_iovec = NULL; rw->bytes_done = 0; /* can only be fixed buffers, no need to do anything */ - if (iter->type == ITER_BVEC) + if (iov_iter_is_bvec(iter)) return; if (!iovec) { unsigned iov_off = 0;