From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BA31168AD for ; Mon, 8 May 2023 10:07:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5E4DC433A1; Mon, 8 May 2023 10:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683540422; bh=QODmLeWTAz9RKEEaeeGKaYCn8X4IkuVq3+Ace9GQhbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bym7azA7mcecguXSe6NyZwOAGiBefN3Z7PT2A3RWZvQPxBavig31faChfEuczxg00 yIjfizm3+Z8jvRSy3CewdLMaIwhqrczqmr8Pi/dYO1lKUGghV5qt9uEU9h+DPKnH8o BJlOQIMx5GMUOhaGwirF7btjb2LFFjL8KccZ8EKo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 6.1 359/611] io_uring/rsrc: use nospeced indexes Date: Mon, 8 May 2023 11:43:21 +0200 Message-Id: <20230508094434.067176525@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230508094421.513073170@linuxfoundation.org> References: <20230508094421.513073170@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Pavel Begunkov [ Upstream commit 953c37e066f05a3dca2d74643574b8dfe8a83983 ] We use array_index_nospec() for registered buffer indexes, but don't use it while poking into rsrc tags, fix that. Fixes: 634d00df5e1cf ("io_uring: add full-fledged dynamic buffers support") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f02fafc5a9c0dd69be2b0618c38831c078232ff0.1681395792.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- io_uring/rsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 4426d0e15174f..cce95164204f3 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -562,7 +562,7 @@ static int __io_sqe_buffers_update(struct io_ring_ctx *ctx, } ctx->user_bufs[i] = imu; - *io_get_tag_slot(ctx->buf_data, offset) = tag; + *io_get_tag_slot(ctx->buf_data, i) = tag; } if (needs_switch) -- 2.39.2