Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7204426rdb; Wed, 3 Jan 2024 07:57:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMmwy+mF0TLXNFTYWqGgMORSdpZWya2zwTTnV4P+Ngr86UJkUHixSKnqpZei/w8QmF57M1 X-Received: by 2002:ad4:4f30:0:b0:680:7cf7:d341 with SMTP id fc16-20020ad44f30000000b006807cf7d341mr10796548qvb.15.1704297448666; Wed, 03 Jan 2024 07:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704297448; cv=none; d=google.com; s=arc-20160816; b=wBqbz4awUpvst2kygvEmt65fjyl6YFKskfLcOOR0C8J0Z5kH/oUpQ1fOIOVAi8mYuJ PWpKq+fBYUlRu5koS4kQPgsu6EvyV/TzNY2J6ALIro7gD04gd6ts7fw3bjECZRxuk6hJ muvSRM4lus+IvAyNr7QQOsPtegzJ9DR2EQ0frEl1d1O+wUudCgrM6R80evgI3La97qSB uFs3dpMSlQrkXbS0jiBcCXeeX03PYNB9szucrn00k7RWF+D1ZYqBcwKiDFmAYJM5E+VZ Et4s2HfWpDcePCqsjVOb5SuVmElsm0sY6Wl9ElUX/sU1V38M1eAyx7wwX5ItZFKSpvfg +pBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hdU5ls8WrZqnB6XcqbSDmjL6xy2k02oGZxBDsQ7NsXM=; fh=OoOULpmdF0z6TdBEHUlB7PzqPpxE8U0Jk26d0cC9ME4=; b=DV//XK/S9rxCAHtkO7zmZSM1ZtN/5LJ7ufVXbJOdo+oSPOfdpTZ6D5DM26W7WjoVsz cZyYbfYdUas7levA77nHDwTMROSBL6KPyNA84/Yda3pgJ4rySAK1JDPk8M5v5YT3rrSz 5Pn7lB+8DmciiCm2DJOX7Uxkc/73XRD4zLDeUTplA0KDeemRzpSljEXPLyNA5ZAmLNAu Xmb0I+svoSoS9K8Wl26+6/mdHg5v5oAz5wJlg8UCGoK1djFtFFSdC8qeQmDH0NSBuqdP 9rCXZ4+F3cpz9dozPi1pJ9pioB9A3nFeHOYhfL0iYUeKOne2vN0lfYDFuE3acjvKcAAr I6pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S4lwkSa4; spf=pass (google.com: domain of linux-kernel+bounces-15720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d10-20020a0cdb0a000000b0067f2c4029easi21854295qvk.476.2024.01.03.07.57.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:57:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S4lwkSa4; spf=pass (google.com: domain of linux-kernel+bounces-15720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6BD461C23A75 for ; Wed, 3 Jan 2024 15:57:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47E581BDD3; Wed, 3 Jan 2024 15:57:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S4lwkSa4" X-Original-To: linux-kernel@vger.kernel.org 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 7F6071BDC5 for ; Wed, 3 Jan 2024 15:57:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55748C433C9; Wed, 3 Jan 2024 15:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704297435; bh=3PfcWwd6revmKQ+P7oeW/epk2Jli0IGYdbJw4sDRDcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S4lwkSa4/5o6qLH3t+1W4bSQpDY1x1qz8rx9BQ5IzXaVc09MGPcJlf9qb8i8G9s9V mHoHD61mNxrvIjvBM2JDSCcbhVYAIV6LYx60NX8kPw6GFhHkrstb9l17NF9i3Jk4PV 9Y8mkwjXJs89ZmniTW/Jxo3S31GOW5khJLCaL4LowShL7iEppnlgYgY/S004CfPyzd dizB9PXsCRq7cDrIPNm7lzF8SH7hwDtE0dhqCFswf/KKcCvXWcT15CSBJ6XUVShz35 y8uCvTmeOBh8zBYQsqfi9ysAxNp6OViN+2JthKDzptByOg594agbMnEJ3+h0sIx+/f Y08U1Epw6A87w== From: Arnd Bergmann To: Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Keith Busch Cc: Arnd Bergmann , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] nvme: trace: avoid memcpy overflow warning Date: Wed, 3 Jan 2024 16:56:56 +0100 Message-Id: <20240103155702.4045835-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103155702.4045835-1-arnd@kernel.org> References: <20240103155702.4045835-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann A previous patch introduced a struct_group() in nvme_common_command to help stringop fortification figure out the length of the fields, but one function is not currently using them: In file included from drivers/nvme/target/core.c:7: In file included from include/linux/string.h:254: include/linux/fortify-string.h:592:4: error: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror,-Wattribute-warning] __read_overflow2_field(q_size_field, size); ^ Change this one to use the correct field name to avoid the warning. Fixes: 5c629dc9609dc ("nvme: use struct group for generic command dwords") Signed-off-by: Arnd Bergmann --- drivers/nvme/target/trace.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvme/target/trace.h b/drivers/nvme/target/trace.h index 155334ddc13f..dbb911fd502d 100644 --- a/drivers/nvme/target/trace.h +++ b/drivers/nvme/target/trace.h @@ -84,8 +84,7 @@ TRACE_EVENT(nvmet_req_init, __entry->flags = cmd->common.flags; __entry->nsid = le32_to_cpu(cmd->common.nsid); __entry->metadata = le64_to_cpu(cmd->common.metadata); - memcpy(__entry->cdw10, &cmd->common.cdw10, - sizeof(__entry->cdw10)); + memcpy(__entry->cdw10, &cmd->common.cdws, sizeof(__entry->cdw10)); ), TP_printk("nvmet%s: %sqid=%d, cmdid=%u, nsid=%u, flags=%#x, " "meta=%#llx, cmd=(%s, %s)", -- 2.39.2