Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2828679pxb; Mon, 1 Nov 2021 02:41:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXVPPFPN0LtNS5431IzLMPdsSF8cTKplEU6aoVflIuOJ1fDtmgW1IDzjZJoPCzS6EwOymO X-Received: by 2002:a50:ed92:: with SMTP id h18mr3912871edr.381.1635759680835; Mon, 01 Nov 2021 02:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635759680; cv=none; d=google.com; s=arc-20160816; b=gTadhXgDiksXjEuYg+cSXhRrpHzolr1L7KHM4JOg6WDpQzB73QakFkzVviWiTnMvp1 dHuUS/1UHT4da6kvOUVivLcDg5wooEzqwv4EGc0TYfOwEaj9afsxSM98WpmmY1OvyUCI vgm7+ThW3QJdaheYRa4YDkNkykmJTkAKjSpBed4swpOcLBU6z/FZrLEeHQ9TmfmW7XR9 IUOB8uncyMusqFOFcwnnDvi1y15VGZPKEmLrnQJIFJiyG1KEjyq5XOR8oyWFfqy3klGL H9ZARI/XzrHs7qds5lrsSuDbcQVpEtKzvewRKldrU9MmeshluXqlzVvHHDrbuEYMm//D 8EXQ== 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=NOYkoTx9M74m2T3NrqRozIPWtV9XOolvXwGKcAzyr1U=; b=rJvFLOz1ilrW0RVOO1zmYnKqlbWN0KQfMUjbVjXb0/2j/0pWN3SWPtXXrcodJqA1u/ j43S8Onl0VCONKVBnoQskiBJXFNP7l2sBY57iUshIXgCIph07cp0p9aHbCjU63D4qj2S 4Bk3AxNz9or+WIpTMZ/eV3VJHE1wPaVtB8ZflGPfW3ExVJSZtNezGRog8totkuUiZ6j2 p6GGgSOP6JtVEacvM+jA0uAqYxX/znfjYWdCls+GYseofOr34F1llZPuS/gL9ZuSMi8k hfOrQ6L49NWLi9VLQ+jAJaJkylEatiTHiae4XvPEqoUntOsKUMSXqGWhVIH/wiwheiDj SIEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ageqs7yC; 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 go7si21945608ejc.160.2021.11.01.02.40.57; Mon, 01 Nov 2021 02:41:20 -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=Ageqs7yC; 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 S233847AbhKAJkg (ORCPT + 99 others); Mon, 1 Nov 2021 05:40:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:43676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbhKAJh6 (ORCPT ); Mon, 1 Nov 2021 05:37:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0541E6135F; Mon, 1 Nov 2021 09:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635758821; bh=73kbLrNQx+k4FLJe261GHYcAhY78v1LnKm7hh+TgTs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ageqs7yCKGtmVPIPIjQV0zTqUumley+RYY6jQ3tW5aLdshzyMec4LVXb72nT7cWAP Qy8GMmfxuTKEqKm0v0Ia7ljE9C7+TZSWxN1IWJ5sSQEgwnQIGXzrDXxd9z2JIKeyRR dwfV+bpWAfHdBAM3sl5P7QoWqFLF2WYgWy2Lsc3s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Varun Prakash , Sagi Grimberg , Christoph Hellwig Subject: [PATCH 5.10 41/77] nvmet-tcp: fix data digest pointer calculation Date: Mon, 1 Nov 2021 10:17:29 +0100 Message-Id: <20211101082520.522300494@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101082511.254155853@linuxfoundation.org> References: <20211101082511.254155853@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: Varun Prakash commit e790de54e94a7a15fb725b34724d41d41cbaa60c upstream. exp_ddgst is of type __le32, &cmd->exp_ddgst + cmd->offset increases &cmd->exp_ddgst by 4 * cmd->offset, fix this by type casting &cmd->exp_ddgst to u8 *. Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver") Signed-off-by: Varun Prakash Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/target/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -690,7 +690,7 @@ static int nvmet_try_send_ddgst(struct n struct nvmet_tcp_queue *queue = cmd->queue; struct msghdr msg = { .msg_flags = MSG_DONTWAIT }; struct kvec iov = { - .iov_base = &cmd->exp_ddgst + cmd->offset, + .iov_base = (u8 *)&cmd->exp_ddgst + cmd->offset, .iov_len = NVME_TCP_DIGEST_LENGTH - cmd->offset }; int ret;