From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.112]) by mx.groups.io with SMTP id smtpd.web11.21029.1683269192559761346 for ; Thu, 04 May 2023 23:46:32 -0700 Authentication-Results: mx.groups.io; dkim=fail, err=malformed MIME header line: Subject: [PATCH V3 1/5] RedfishPkg: Correct variable type to prevent memory corruption; spf=pass (domain: os.amperecomputing.com, ip: 40.107.237.112, mailfrom: minhnguyen1@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ACb2O4QK9CLANo2RVfTTprQuGjDKyv841cjdc6DEDes8iDRsSuG8yEF8I25phIutrZ0siUwTkQNxKd+j5S4Kh3lKr6HvzHk9O4ZGezBKUhxfz6qfvKQfEjWXRJd5KBkPl7+ZDQnAdfOHjH0gt5L/ltEa3DbdoWPsw+0oHCtxOZCuHL+kg5fC9gfzlCUsBJcELzJDovSy02BolktTN+uDQypKRYpso0q3Sr8Uwmy63sgRM9aKuF88ZnSzywCh2o29w3dSnZ+E0vzTiuuAJ3bMzf2q691AlUhaPcWCzDymnrjpan0MCIG/w2TbJTpRo87r6XBm+Vebvcy+E4M/YmLXqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=35uvj5Ksz/2/Lk61WIfbLpSL01av76B96OAsKjjzYps=; b=ZcoJ8jKea7h5ggB1sS/CZG5xqyEXReTckMbCedeMetGNnder+JnMCVmxBpSrxwp9QSjPDltqEdPaJnUafIt8Wqx15xkSjuXdHeUaSQBb9DHpxUzxD25jctsEYFeNdzwU0MNQzJsmpBAiyTwARwpSIcosI6XP90iz6b6i2pGNz5Jv3PikXMqWF0SxGOBrnRGFrAPu2ms1WsA3/CubT7kDwFRtIPKSE7mB7Io/QEV6QAG5/Pfc3VDA6X/YL4SBJhjN3M5Gwz+0Juf4OQRU5LbyisN9q2Vzjtsk9A5wjqnzP9aIA3HgYKaS4Lw/quXnGaw/SQabsb/EHEJkyda5IdUtBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=35uvj5Ksz/2/Lk61WIfbLpSL01av76B96OAsKjjzYps=; b=b9wtNrmwJgVYZfbfkAI7yLz2/fippDJw6Nxod6JxSTwHSa6KcwWTZC77N04Ue27IYGlZ2AW1FaFTB4uMqtHWcMIWLgdj26MJE0wsaYF1MfAhR/pff0K5prAHuRSWWAVxQ/Z8wJ1MY2R5ZE5MB6SwWdwfwbfoG8aJv4bh6OQNhnM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) by SN6PR01MB5087.prod.exchangelabs.com (2603:10b6:805:b8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.26; Fri, 5 May 2023 06:46:30 +0000 Received: from PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1]) by PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1%7]) with mapi id 15.20.6363.026; Fri, 5 May 2023 06:46:30 +0000 From: minhnampere To: devel@edk2.groups.io CC: patches@amperecomputing.com, abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com, Vu Nguyen , Minh Nguyen , Nick Ramirez Subject: [PATCH V3 1/5] RedfishPkg: Correct variable type to prevent memory corruption Date: Fri, 5 May 2023 13:45:56 +0700 Message-ID: <20230505064600.1478461-2-minhnguyen1@os.amperecomputing.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230505064600.1478461-1-minhnguyen1@os.amperecomputing.com> References: <20230505064600.1478461-1-minhnguyen1@os.amperecomputing.com> X-ClientProxiedBy: SG3P274CA0005.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::17) To PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) Return-Path: minhnguyen1@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB8048:EE_|SN6PR01MB5087:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f8af5ef-2a20-4f9a-b0c6-08db4d3474d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zbm+UADXW6tAp+uzBLiVhAaw3nfysLwUaRDrUheAwgJPLlsnXZuUsBEOqiGhEwB3iTmDFEdBFXfRnHS3vJTKQCV9M7YHvVtdUx1E4gBr8cpYzJHiKKC3h6wV7VZRkWMd7FxUiJHjkHvdFl1CTWxNpP7udFYc7fRUsJ8V5G3mnMLKEoVfcHAugcJZwl/iV6Y1LQMlIT+xK1G2/yws5Vq5/riZaDXeTUrdiIZbCwZhgnwg42/F2NYMnESdKZVU2BE3p/OIp4Klt+qqvmyzDGx21hPSsjcvkW4puFKkz62VnfXDWuRQrLxP2wscyEMW4aAvFfI30og1JO86SLSsVwvfFjByF1Xe8GX37SvwvSuUR5t8sh1ijJyxhjrbGEFZ+jeUJQiAkEaAgAb2qHAj0tG3kVQqQmb9OmeiisAMwBXLMk5I6VwojOn9jLd4fOy65/xy0NlUzNqd3bDDXNAZidqDcFF5Sy2KwrMK68z6o4LeP5Y43HVA+43wlhejSpb+noWDs2hFmlUoPlbDVtoPZCpnyaoaxDZzPAP7Mpy+/wOVqGdDMoWTlcBEPIHtgq413QCkkIyr9mEjB6zOLk8xUi5qFrTg3VI6y/S/W3y16c+TnYKova1znYyNEHp3tqJpyjTvk2yYM0TbBa6WHTEXB5gq0A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB8048.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(366004)(136003)(396003)(39850400004)(451199021)(83380400001)(52116002)(6486002)(1076003)(186003)(478600001)(54906003)(6666004)(2616005)(6506007)(6512007)(26005)(2906002)(38350700002)(5660300002)(38100700002)(66556008)(4326008)(41300700001)(8936002)(66946007)(6916009)(66476007)(8676002)(316002)(86362001)(43062005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vJQ6vOG46rODhG2RYgLE2+1uiajTG/+l4TguFRQ8C17XY6RkexP6lzdKuOu8?= =?us-ascii?Q?Mr4dLlpcts0Prr0g0nNlJpIzK4ZcJlZJR0n5px2chxSv7trHirWs0pCmLq4f?= =?us-ascii?Q?G6cHUMgmLfUv9iz+LbQOBL2ZeShict5VoZpXESevNKGkRKdGYD15+4GLpEVm?= =?us-ascii?Q?D7Z/Hijjq0kf5t1wonIQ6slaLblh/VDnYcnFTsyRuEwGguYcLw3u3Dy6lQW9?= =?us-ascii?Q?yJmIx9AQhSgN+1x+Udd6bvShhJxcEkDMJrjMmL4gxFDcM8EOIL6nPRMh1MNK?= =?us-ascii?Q?kyBQUwRS8R9EtWW0DJgVMXD06jfWWrxmDAzlH7kV8aBRzQ1Pqej0EyT5NAo0?= =?us-ascii?Q?AiJaPD6oY2o7iRwpoT6V9v+apiUReU3CPP76eaIPjObH7D+1pgvkHq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CHbtEV66es82O04lD49mse21iAQW2oluYsX4yhvwaoJQ1a6?= =?us-ascii?Q?HvcYPm4gr7pLJxTAQgtnPg0eY8gTt2ZaSLWGI86cc3sKSS2SGLjGzmUlaA+s?= =?us-ascii?Q?dH4jl7pSd/376Oyqt0v0Mq/TJ6kZj+9sCwSN21yH/lHkAPvGQYnAmGPFobkr?= =?us-ascii?Q?h+3M1ErylfU/pdQMA1npVd0ZaPpxfB+hVZBK4Ph4j3l5s1MvpBEHPjYsPjnZ?= =?us-ascii?Q?/VLmsvJMBXOnWEyvpKt/Hw2oeBlPGGGk6p573l8qE6zu7p4bqD3ysDdvmn6o?= =?us-ascii?Q?dIuGsnRqA1GKpT4CVG6bfPLTdQYu/wghNj2Pxfg29JUjwNBVfXCoJ2ZnihLv?= =?us-ascii?Q?g5ejow6wUjn3Z7LuD96X3iJvJalc8FrCDswVmWDGBH0c?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f8af5ef-2a20-4f9a-b0c6-08db4d3474d5 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB8048.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 06:46:30.0945 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +LgT2j1MYRIaGPwujElz++jnfmrIOJbExedm79uCflyCmxX/kP0k5MOZT+QKAA+Mah/fu4vA3S+Xu8lm2dw1ygApGzdt44Ff+ajz0NfrgoJ6j87GhAsxpYu5sHEnh8mT X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR01MB5087 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Vu Nguyen Id will be casted by CoreOpenProtocol, declare this variable with a wrong type might result in the corruption of other local variables. Signed-off-by: Minh Nguyen Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez Reviewed-by: Nickle Wang --- RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h b/RedfishPkg= /RedfishRestExDxe/RedfishRestExDriver.h index 4a9e9f7b81a4..6b94e5814c43 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h @@ -3,6 +3,7 @@ =20 Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -84,7 +85,7 @@ struct _RESTEX_SERVICE { // EFI_HANDLE HttpChildHandle; =20 - UINT32 Id; + UINT32 *Id; =20 EFI_REST_EX_SERVICE_INFO RestExServiceInfo; }; --=20 2.39.0