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 C72BA1DCB1E; Tue, 3 Sep 2024 20:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725396403; cv=none; b=CWCTJ0i0lgXb8drL2dyz4RV1S4tbYnzDygvimVVNy+KFAchGYMdmcLHmJW8IRs2vNlpe01R41ywNK1zyo5hEwK+XsHsFI+RNbnQLSdQ/xtOlRnBhWXubOI3HRPY4s3T2YFiX/xJwthvzputs7U1P3/yjCMR95Uf6dJNsN3SQFY4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725396403; c=relaxed/simple; bh=gyKmTyTWsLFKWuyb1CViguXxZW6EghA9L1hLyOY/2+o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CKkyKhWu9rjww9z3p4jz8UM3s7ncg/Yetl9gLyZGfvii8xQuPoxJE18UYFejO8T7HHXLaTCGKjCYBNKCnkdoXzZaQn6cyaj1nKWNF1WBDqEWpKwD3bKQqdNfRc4/zB0nbzIat72BoSNV0ajRElt562f5TAiNs+htc62DcZdWrOg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jSsq+p5D; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jSsq+p5D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72B34C4CEC5; Tue, 3 Sep 2024 20:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725396403; bh=gyKmTyTWsLFKWuyb1CViguXxZW6EghA9L1hLyOY/2+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jSsq+p5DXz7504YkA4dpgdREt+zsahPtNYYmOxY1nkU5MW6H0flgzy5OrToc2OSJx OExvBQcXQ/bSWZn5aWC8p35ZABleTEMpb7Lj+GYOs5Q/HgGDSmEs0mpi704A7NiDXI S3O5BbVFEcuVcsKZBSx/blbIm3TOvH/QD5mm3xR1RxXf27y7k+3FsCkwEuU8AhdqQ6 Id2iFAdtDB5NJN8twoVH9d5vQnNHoosgqfHER/5yNBCvv1cNqEBHAZwowLE7KZ9ZLq jbIf4D50sQ3vKEwlK1V5YOIIl2GBmgGp5JxdL/yRnu0Fb6huI2NfFW/ZSgW+E7XALS WOFOguyHTiRRA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sherry Yang , Justin Tee , "Martin K . Petersen" , Sasha Levin , james.smart@broadcom.com, dick.kennedy@broadcom.com, James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 04/12] scsi: lpfc: Fix overflow build issue Date: Tue, 3 Sep 2024 15:26:48 -0400 Message-ID: <20240903192718.1108456-4-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903192718.1108456-1-sashal@kernel.org> References: <20240903192718.1108456-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.165 Content-Transfer-Encoding: 8bit From: Sherry Yang [ Upstream commit 3417c9574e368f0330637505f00d3814ca8854d2 ] Build failed while enabling "CONFIG_GCOV_KERNEL=y" and "CONFIG_GCOV_PROFILE_ALL=y" with following error: BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c: In function 'lpfc_get_cgnbuf_info': BUILDSTDERR: ./include/linux/fortify-string.h:114:33: error: '__builtin_memcpy' accessing 18446744073709551615 bytes at offsets 0 and 0 overlaps 9223372036854775807 bytes at offset -9223372036854775808 [-Werror=restrict] BUILDSTDERR: 114 | #define __underlying_memcpy __builtin_memcpy BUILDSTDERR: | ^ BUILDSTDERR: ./include/linux/fortify-string.h:637:9: note: in expansion of macro '__underlying_memcpy' BUILDSTDERR: 637 | __underlying_##op(p, q, __fortify_size); \ BUILDSTDERR: | ^~~~~~~~~~~~~ BUILDSTDERR: ./include/linux/fortify-string.h:682:26: note: in expansion of macro '__fortify_memcpy_chk' BUILDSTDERR: 682 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ BUILDSTDERR: | ^~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c:5468:9: note: in expansion of macro 'memcpy' BUILDSTDERR: 5468 | memcpy(cgn_buff, cp, cinfosz); BUILDSTDERR: | ^~~~~~ This happens from the commit 06bb7fc0feee ("kbuild: turn on -Wrestrict by default"). Address this issue by using size_t type. Signed-off-by: Sherry Yang Link: https://lore.kernel.org/r/20240821065131.1180791-1-sherry.yang@oracle.com Reviewed-by: Justin Tee Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_bsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index ed827f198cb68..45c59006945b9 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -5761,7 +5761,7 @@ lpfc_get_cgnbuf_info(struct bsg_job *job) struct get_cgnbuf_info_req *cgnbuf_req; struct lpfc_cgn_info *cp; uint8_t *cgn_buff; - int size, cinfosz; + size_t size, cinfosz; int rc = 0; if (job->request_len < sizeof(struct fc_bsg_request) + -- 2.43.0