bugGNU GRUB - Bugs: bug #58283, save_env prepends \0 to grubenv,...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58283: save_env prepends \0 to grubenv, causing "error: invalid environment block."

Submitter:  Clara Short <clarity>
Submitted:  Fri 01 May 2020 02:37:36 PM UTC
   
 
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Clara Short
Open/Closed:  Open Release:  2.02
Release:  Reproducibility:  Every Time
Planned Release:  None

Fri 01 May 2020 02:37:36 PM UTC, original submission:  

Configuration


grub> echo $package_version $grub_cpu $grub_platform
2.02-2ubuntu8.15 i386 pc


Steps to reproduce

1. Initial conditions


# rm /boot/grub/grubenv
# grub-editenv - create
# grub-editenv - set foo=bar
# grub-editenv - list
foo=bar
# hexdump -C /boot/grub/grubenv
00000000  23 20 47 52 55 42 20 45  6e 76 69 72 6f 6e 6d 65  |# GRUB Environme|
00000010  6e 74 20 42 6c 6f 63 6b  0a 66 6f 6f 3d 62 61 72  |nt Block.foo=bar|
00000020  0a 23 23 23 23 23 23 23  23 23 23 23 23 23 23 23  |.###############|
00000030  23 23 23 23 23 23 23 23  23 23 23 23 23 23 23 23  |################|
*
00000400
# reboot

2. Drop to GRUB shell


grub> list_env
foo=bar
grub> baz=quux
grub> save_env baz
grub> list_env
error: invalid environment block.
grub> reboot

3. Boot into Linux


$ grub-editenv - list
grub-editenv: error: invalid environment block.
$ hexdump -C /boot/grub/grubenv
00000000  00 23 20 47 52 55 42 20  45 6e 76 69 72 6f 6e 6d  |.# GRUB Environm|
00000010  65 6e 74 20 42 6c 6f 63  6b 0a 66 6f 6f 3d 62 61  |ent Block.foo=ba|
00000020  72 0a 62 61 7a 3d 71 75  75 78 0a 23 23 23 23 23  |r.baz=quux.#####|
00000030  23 23 23 23 23 23 23 23  23 23 23 23 23 23 23 23  |################|
*
00000400
$


Clara Short <clarity>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by clarity (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code