Follow-up Comment #14, bug #32472 (project grub):
I have found some errors in code and provide a patch:
grub_util_biosdisk_flush():
grub_util_biosdisk_flush() tries to open device as RDONLY and flush() after
that. This will not work. As I think, it should not try to open closed device,
and second, it should not try to flush devices opened read-only. Also it
should check return values of fsync() and ioctl()
open_device():
In case of error during open, disk structure will be corrupted (data->dev
points to free()d location. data->fd close()d, but still > 0.)
(The same issue in second place of that function)
grub_util_biosdisk_close():
simplifiction for use new grub_util_biosdisk_flush().
(file #23298)
_______________________________________________________
Additional Item Attachment:
File name: z.patch Size:2 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?32472>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-grub