From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.100]) by mx.groups.io with SMTP id smtpd.web11.19399.1683259138164138580 for ; Thu, 04 May 2023 20:58:58 -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.236.100, mailfrom: minhnguyen1@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OqY7CMEPBv5cNKqgbV5byWBVhau/J+u6PNl61kLXrFZI56LvMCCkwwfTn+fQQd5rJ/WNJoVnbqX4HvPhRiqbcf3gWQeicrnSkZSZKi3fKRzIKT5Z4DATGHBGXT+Wa4pRGM/p35R6EyVONnX4RGXgAdoHgpGg82PECfwNyITSLEjN6OLoN15mYfQBH3vI+GyVbqSCJ1mXvmvN4skS+9xaalFG++3NbvtUEe3+qhozEDgDlOtPYIQCRLyCQR02w6NPvvJoipa2xnKhXAoYbzspCVrxWXqyOdnMV/nyU9PXMpggGoqwxKmuhdxr4NmiREqco3OqqsimBU4XhySZaejV0Q== 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=I8x0Pe/ym/RulitlzkTrHqQIrqJFDahlb84ciGXcBMgUoxasnSTorvPPkn9zNwXhmoF/tw2ei0KMvtroXhKa9fBA16cdY4jzZzdZjMQvL1keWkWuBJRkYcLgaao7/Bt3X31SO+pD4dK8v1tUlOk8n3UairFH2574TFrKFkEE3QJLjy/EVYSNRHob55DwT4bndRj4uqK0t6AqrOV6c4vUoT2EG7Mrb2o7y9+0kPCkzeb8ytEnSgMXBvN/Cj2REITjdi/cMEe1iBkcAmpY6/TSaxtQnUE8odLthIVEUue9Y/mDOzwUfMnq9IVVapR/XWDiVL7lQ7RMpzKC1zVW0GW/1Q== 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=MWB1V+TUWiFaq+/2NPK43iaXHaznrMrriggHFueHIIiHGhxjWivMZymYyvqWUiYyEMHCylI1mJTRh9fdMeSNs8nbWtLGeZuEDUR3xFAlY1tJZJzW9O2sSUM8gIytOGaTi4rqYlMpUaR9WaO0coY7ethmp3yQWCQlu3PE22j5Dys= 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 PH7PR01MB7725.prod.exchangelabs.com (2603:10b6:510:1d5::5) 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 03:58:56 +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 03:58:56 +0000 From: Minh Nguyen 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 10:58:20 +0700 Message-ID: <20230505035824.1466954-2-minhnguyen1@os.amperecomputing.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230505035824.1466954-1-minhnguyen1@os.amperecomputing.com> References: <20230505035824.1466954-1-minhnguyen1@os.amperecomputing.com> X-ClientProxiedBy: SG2PR02CA0107.apcprd02.prod.outlook.com (2603:1096:4:92::23) 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_|PH7PR01MB7725:EE_ X-MS-Office365-Filtering-Correlation-Id: e2c785cd-06fb-44d4-eb18-08db4d1d0c3f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HhGY2QipvwVfpXALlVEV1wt0OcCBBEEx76wVZWeVul1HPpQrak/swoAHwfg1BudlTTJbyy91Eob25XDDIpI8RaOigQnHt/R+3sJiSXqkTUAKiVzv6p8A1w4GzXc6sAmK+HqbY+htLxPzmQgmjoaUkHmbL1I8x9ZaZFvfKI8PPIKnFwmPi9CdlrSlU+R/31tr9lx88eLpAfEK1GU+nmumRR3n/fyda3/1SHGOqT30Nt3ANLkXjaTivCDSokWkCsvZwxi0sSZecmHukrRzPxJ1XIrwO8tQ2JauW1Yoqgkm0+y++GXXs36w/Kad98MaC3FP5RonhS3Yj7prnlc34psZi5Zg8kkqunqLzJazCF6P+JlZTk/OioFmqHcVhNnDXnfYgiXRY0OFb801K4wmDUSB94YmNSfV617NzcxCD9FnVtj07aoToXmu3sMxR2kru+mXDiaT/9P8XtFQdVdIx2EdmLaEGyUUy5gy+OuIiLwRsNZA3q+nN7Xrn3/Ki7XRbfDsPvEBaZ6NyozDpdBHkTX2oPRw8QHENU+LOVfHH1XV++Fv49uoORpUnS7nXNWDlBkpNBumhQzZ9S66WZLZ6+LdJ7NwZ5zxvjr49qmeWrmQUnUQXV5fLBhfDh757JnBGRwS 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)(39850400004)(366004)(396003)(346002)(376002)(136003)(451199021)(86362001)(54906003)(316002)(66556008)(66476007)(6916009)(4326008)(6486002)(66946007)(6666004)(52116002)(478600001)(41300700001)(8676002)(5660300002)(8936002)(2906002)(38100700002)(186003)(38350700002)(2616005)(6506007)(6512007)(26005)(1076003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vfktyQ69hqTTKQWHbEsM5Ls6H4aKdGifxHWDY6Xnl4bJIK66Hx1teMop0ycz?= =?us-ascii?Q?B34pDE+/Fj9iynqWGA9Q0LYUzqCtTmSxBCod+5iOrFdC757yy6+KO3aXku51?= =?us-ascii?Q?QZziVFgCh/hMAdcTvRy+9z8SZrEEYaeUfngMo+qNwc7Qbp7Dj7xN7kYXUer0?= =?us-ascii?Q?3ccCHcFyv5YdL+yTQrnd6a1FdDdmiTgmIEAiiRZxWZGExv9ZwD7q/ehLwwNk?= =?us-ascii?Q?KODf+UDNClrgzVyEKBZwXuUBpKxknjDGq4hXvuQIB02XJlTRTEEiWjmK/pxc?= =?us-ascii?Q?PdCdEHuxBztH42R6VOl2s1oDTxEi1weTYb/RAsszqm0H4xy0exrtn2OAdZnf?= =?us-ascii?Q?CxyYLZVz+HDu82vNJWEfOS3pSUqFkVnWdXGi6t8SYfEty6imRTJp7MCfpl8t?= =?us-ascii?Q?8Ww4+H27eiYBvtK269oRwS4chZto//Ke0/VJ3Hvzf9Pp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LSC4eGblVXxXqaPTYkM2fkvPyTPs7o0Rz+oexr+HB0RXYV6jIvc8ekLQ?= =?us-ascii?Q?oL4ovim1/6QEUfqxW3O968bk6DnI2XnmDSXI19o4vwjn1KUfkjq0/h0h9ybx?= =?us-ascii?Q?rH441l59Rc86uyb1sYCNOBiZxH10uhybWnR7eENe3A9fkjDkWrqepv4NCCHb?= =?us-ascii?Q?LjEHSYO8mubbK/y2DU1K1ummXjG3/mfY8QO92XGqUjfjUy9topoBTof6uEpT?= =?us-ascii?Q?S9nhc4wfskTFbGgxEe/HVuqwlBy39mS3bjiZhO9I7CcINeQo4nNlB3XEhIG4?= =?us-ascii?Q?sIoPXZbOguI0C7HJARaWO3CPcqRHLyGgI12FSADqTN3g?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2c785cd-06fb-44d4-eb18-08db4d1d0c3f X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB8048.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 03:58:56.1746 (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: xwG8MPewQM/l67aaD4ON57T4zZpvYtpVaVTsUPZFOIaFNEir6ge607d0mfVqVZgrgd4XfaDp145rNcX6m1lT8OammrYEIzfGgLzvgU8nTzizBHoQ2UEbc845s3E1hHXP X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR01MB7725 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