Thanks to visit codestin.com
Credit goes to github.com

Skip to content

panic: runtime error: makeslice: len out of rang while trying rotate-keys on 0.16 #420

@pietrushnic

Description

@pietrushnic

Following issue was triggered in Setup Mode. I enrolled keys once, then trying to rotate and get following trace:

user@OST2-HW:~$ sudo sbctl rotate-keys
old configuration detected. Please use `sbctl setup --migrate`
panic: runtime error: makeslice: len out of range

goroutine 1 [running]:
github.com/foxboron/go-uefi/efivarfs/fswrapper.(*FSWrapper).ParseEfivars(0xc01b60?, {0x961dc0, 0xc000050308}, 0x0)
        /home/user/go/pkg/mod/github.com/foxboron/[email protected]/efivarfs/fswrapper/fswrapper.go:158 +0xcc
github.com/foxboron/go-uefi/efivarfs/fswrapper.(*FSWrapper).ReadEfivarsFile(0xc0000123c0, {0xc0000285a0?, 0xc0000337f0?})
        /home/user/go/pkg/mod/github.com/foxboron/[email protected]/efivarfs/fswrapper/fswrapper.go:176 +0x1ab
github.com/foxboron/go-uefi/efivarfs/fswrapper.(*FSWrapper).ReadEfivarsWithGuid(0xc0000123c0, {0x89c7da, 0x2}, {0x8be4df61, 0x93ca, 0x11d2, {0xaa, 0xd, 0x0, 0xe0, ...}})
        /home/user/go/pkg/mod/github.com/foxboron/[email protected]/efivarfs/fswrapper/fswrapper.go:181 +0x118
github.com/foxboron/go-uefi/efivarfs.(*EFIFS).GetVarWithAttributes(0x0?, {{0x89c7da?, 0xc0000338a8?}, 0xc000014640?, 0x18?}, {0x9624a0, 0xc000012828})
        /home/user/go/pkg/mod/github.com/foxboron/[email protected]/efivarfs/efifs.go:71 +0x46
github.com/foxboron/go-uefi/efivarfs.(*EFIFS).GetVar(0xc4b0e0?, {{0x89c7da?, 0x0?}, 0xc000014640?, 0x750cb4?}, {0x9624a0?, 0xc000012828?})
        /home/user/go/pkg/mod/github.com/foxboron/[email protected]/efivarfs/efifs.go:62 +0x27
github.com/foxboron/go-uefi/efivarfs.(*Efivarfs).GetPK(0xc00002e710)
        /home/user/go/pkg/mod/github.com/foxboron/[email protected]/efivarfs/efivarfs.go:29 +0x72
github.com/foxboron/sbctl.SystemEFIVariables(0xc00002e710)
        /media/sbctl-0.16/siglist.go:93 +0x105
main.rotateAllKeys(0xc00016c690, {0x0, 0x0}, {0x0, 0x0})
        /media/sbctl-0.16/cmd/sbctl/rotate-keys.go:133 +0xc7
main.RunRotateKeys(0xc0c5c0?, {0x89cbb1?, 0x4?, 0x89cbb5?})
        /media/sbctl-0.16/cmd/sbctl/rotate-keys.go:117 +0x291
github.com/spf13/cobra.(*Command).execute(0xc0c5c0, {0xc6a8a0, 0x0, 0x0})
        /home/user/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc0ba40)
        /home/user/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/user/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
main.main()
        /media/sbctl-0.16/cmd/sbctl/main.go:191 +0x205

If there are any additional information I can provide please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions