Skip to content

Commit

Permalink
Fix loader detection of vbefb support on !amd64
Browse files Browse the repository at this point in the history
On i386, after 6c7a932, the vbefb vt
driver was no longer detected by the loader, if any kernel module was
loaded after the kernel itself.

This was caused by the parse_vt_drv_set() function being called multiple
times, resetting the detection flag. (It was called multiple times,
becuase i386 .ko files are shared objects like the kernel proper, while
this is not the case on amd64.)

Fix this by skipping the set_vt_drv_set lookup if vbefb was already
detected.

Reviewed by:	tsoome
(cherry picked from commit 6e26189)
  • Loading branch information
DimitryAndric authored and Toomas Soome committed Feb 21, 2021
1 parent b7f1582 commit 1714029
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stand/common/load_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off)
ef->buckets = ef->hashtab + 2;
ef->chains = ef->buckets + ef->nbuckets;

gfx_state.tg_kernel_supported = false;
if (__elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym,
if (!gfx_state.tg_kernel_supported &&
__elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym,
STT_NOTYPE) == 0) {
p_start = sym.st_value + ef->off;
if (__elfN(lookup_symbol)(ef, "__stop_set_vt_drv_set", &sym,
Expand Down

0 comments on commit 1714029

Please sign in to comment.