audk/NetworkPkg/SnpDxe
Michael Kubacki df4f154da9 NetworkPkg/SnpDxe: Prevent invalid PCI BAR access
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1563

SnpDxe initializes values for MemoryBarIndex and IoBarIndex to 0 and 1
respectively even if calls to PciIo->GetBarAttributes never return
success.

Later, if the BAR is used to perform IO/Mem reads/writes, a potentially
non-existent BAR index may be accessed. This change initializes the
values
to an invalid BAR index (PCI_MAX_BAR) so the condition can be explicitly
checked to avoid an invalid BAR access.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
2020-04-17 17:34:33 +00:00
..
Callback.c NetworkPkg/SnpDxe: Prevent invalid PCI BAR access 2020-04-17 17:34:33 +00:00
ComponentName.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Get_status.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Initialize.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Mcast_ip_to_mac.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Nvdata.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Receive.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Receive_filters.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Reset.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Shutdown.c NetworkPkg/SnpDxe: Fix few typos 2020-02-10 22:30:07 +00:00
Snp.c NetworkPkg/SnpDxe: Prevent invalid PCI BAR access 2020-04-17 17:34:33 +00:00
Snp.h NetworkPkg/SnpDxe: Fix few typos 2020-02-10 22:30:07 +00:00
SnpDxe.inf NetworkPkg/SnpDxe: Add PCD to remove ExitBootServices event from SNP driver. 2019-10-21 14:50:51 +08:00
SnpDxe.uni NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
SnpDxeExtra.uni NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Start.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Station_address.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Statistics.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Stop.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Transmit.c NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
WaitForPacket.c NetworkPkg/SnpDxe: Fix few typos 2020-02-10 22:30:07 +00:00