* Re: EDK2 bug report [not found] <ffefa25c-8d52-b6c7-c3f7-7718b71f8e2a@piquantinnovation.com> @ 2019-11-19 7:58 ` Ni, Ray 2019-11-19 16:46 ` Michael D Kinney 0 siblings, 1 reply; 2+ messages in thread From: Ni, Ray @ 2019-11-19 7:58 UTC (permalink / raw) To: devel@edk2.groups.io, Gao, Zhichao, Kinney, Michael D; +Cc: Jonathan O'Neal [-- Attachment #1: Type: text/plain, Size: 1833 bytes --] + Zhichao, Mike and mailing list. In general, if the code does contain bug handling UGA but isn't found until now, I think we are safe to remove the UGA support now. From: Jonathan O'Neal <jko@piquantinnovation.com> Sent: Monday, November 18, 2019 4:52 AM To: Ni, Ray <ray.ni@intel.com> Subject: EDK2 bug report Hi - sorry to email you directly, but I couldn't find an address for a relevant mailing list, and I wasn't sure how else to report this. In trying to understand the EDK2 Graphics Console, I think I found an ugly bug (which I might have also encountered in a UGA runtime environment). In MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c, GraphicsConsoleControllerDriverStart() does the following circa line 436: if (Private->GraphicsOutput != NULL) { // console is GOP, handle as GOP // ... } else { // console is UGA Status = CheckModeSupported(Private->GraphicsOutput, ...); // !! note that Private->GraphicsOutput is known to be NULL here // ... } Then, in CheckModeSupported(), circa line 773, the GraphicsOutput pointer is dereferenced without a NULL check: MaxMode = GraphicsOutput->Mode->MaxMode; It appears that CheckModeSupported()only supports GOP, not UGA. Therefore, GraphicsConsoleControllerDriverStart() should not be calling it when the output device is known to be UGA - and/or, CheckModeSupported() should contain a defensive NULL check prior to dereferencing the GraphicsOutput pointer. (I realize that UGA is deprecated, but if some level of UGA support remains in the code, it seems like it shouldn't dereference a NULL pointer.) Sorry if emailing you directly was inappropriate; if it was, please let me know whom I should contact. Thanks for your work on EDK. -Jonathan O'Neal [-- Attachment #2: Type: text/html, Size: 7394 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: EDK2 bug report 2019-11-19 7:58 ` EDK2 bug report Ni, Ray @ 2019-11-19 16:46 ` Michael D Kinney 0 siblings, 0 replies; 2+ messages in thread From: Michael D Kinney @ 2019-11-19 16:46 UTC (permalink / raw) To: Ni, Ray, devel@edk2.groups.io, Gao, Zhichao, Kinney, Michael D Cc: Jonathan O'Neal [-- Attachment #1: Type: text/plain, Size: 2240 bytes --] Ray, I agree that removing all UGA content makes the most sense. Mike From: Ni, Ray <ray.ni@intel.com> Sent: Monday, November 18, 2019 11:59 PM To: devel@edk2.groups.io; Gao, Zhichao <zhichao.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com> Cc: Jonathan O'Neal <jko@piquantinnovation.com> Subject: RE: EDK2 bug report + Zhichao, Mike and mailing list. In general, if the code does contain bug handling UGA but isn't found until now, I think we are safe to remove the UGA support now. From: Jonathan O'Neal <jko@piquantinnovation.com<mailto:jko@piquantinnovation.com>> Sent: Monday, November 18, 2019 4:52 AM To: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>> Subject: EDK2 bug report Hi - sorry to email you directly, but I couldn't find an address for a relevant mailing list, and I wasn't sure how else to report this. In trying to understand the EDK2 Graphics Console, I think I found an ugly bug (which I might have also encountered in a UGA runtime environment). In MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c, GraphicsConsoleControllerDriverStart() does the following circa line 436: if (Private->GraphicsOutput != NULL) { // console is GOP, handle as GOP // ... } else { // console is UGA Status = CheckModeSupported(Private->GraphicsOutput, ...); // !! note that Private->GraphicsOutput is known to be NULL here // ... } Then, in CheckModeSupported(), circa line 773, the GraphicsOutput pointer is dereferenced without a NULL check: MaxMode = GraphicsOutput->Mode->MaxMode; It appears that CheckModeSupported()only supports GOP, not UGA. Therefore, GraphicsConsoleControllerDriverStart() should not be calling it when the output device is known to be UGA - and/or, CheckModeSupported() should contain a defensive NULL check prior to dereferencing the GraphicsOutput pointer. (I realize that UGA is deprecated, but if some level of UGA support remains in the code, it seems like it shouldn't dereference a NULL pointer.) Sorry if emailing you directly was inappropriate; if it was, please let me know whom I should contact. Thanks for your work on EDK. -Jonathan O'Neal [-- Attachment #2: Type: text/html, Size: 44985 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-19 16:46 UTC | newest] Thread overview: 2+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <ffefa25c-8d52-b6c7-c3f7-7718b71f8e2a@piquantinnovation.com> 2019-11-19 7:58 ` EDK2 bug report Ni, Ray 2019-11-19 16:46 ` Michael D Kinney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox