From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59624C7EE22 for ; Mon, 8 May 2023 10:07:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234069AbjEHKHF (ORCPT ); Mon, 8 May 2023 06:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234075AbjEHKHE (ORCPT ); Mon, 8 May 2023 06:07:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FDD14EEF for ; Mon, 8 May 2023 03:07:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C3DE962368 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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