mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix runsc VDSO mapping
80bdf8a406 accidentally moved vdso into an
inner scope, never assigning the vdso variable passed to the Kernel and
thus skipping VDSO mappings.
Fix this and remove the ability for loadVDSO to skip VDSO mappings,
since tests that do so are gone.
PiperOrigin-RevId: 203169135
Change-Id: Ifd8cadcbaf82f959223c501edcc4d83d05327eba
This commit is contained in:
@@ -278,12 +278,6 @@ func PrepareVDSO(p platform.Platform) (*VDSO, error) {
|
||||
//
|
||||
// loadVDSO takes a reference on the VDSO and parameter page FrameRegions.
|
||||
func loadVDSO(ctx context.Context, m *mm.MemoryManager, v *VDSO, bin loadedELF) (usermem.Addr, error) {
|
||||
if v == nil {
|
||||
// Should be used only by tests.
|
||||
ctx.Warningf("No VDSO provided, skipping VDSO mapping")
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
if v.os != bin.os {
|
||||
ctx.Warningf("Binary ELF OS %v and VDSO ELF OS %v differ", bin.os, v.os)
|
||||
return 0, syserror.ENOEXEC
|
||||
|
||||
@@ -134,7 +134,7 @@ func New(spec *specs.Spec, conf *Config, controllerFD, restoreFD int, ioFDs []in
|
||||
// Create VDSO.
|
||||
//
|
||||
// Pass k as the platform since it is savable, unlike the actual platform.
|
||||
vdso, err := loader.PrepareVDSO(k)
|
||||
vdso, err = loader.PrepareVDSO(k)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating vdso: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user