* Merge from Ubuntu:

- Fix use of freed memory when replacing existing loopback device
    (LP: #742967).
This commit is contained in:
Colin Watson 2011-04-10 21:52:09 +01:00
parent f2035564b4
commit 1edea9882f
3 changed files with 35 additions and 0 deletions

3
debian/changelog vendored
View File

@ -4,6 +4,9 @@ grub2 (1.99~rc1-11) UNRELEASED; urgency=low
- Make grub-mount exit non-zero if opening the device or filesystem
fails.
- Translate GRUB error codes into OS error codes for FUSE (LP: #756456).
* Merge from Ubuntu:
- Fix use of freed memory when replacing existing loopback device
(LP: #742967).
-- Colin Watson <cjwatson@debian.org> Sun, 10 Apr 2011 21:45:43 +0100

31
debian/patches/loopback_replace.patch vendored Normal file
View File

@ -0,0 +1,31 @@
Description: Fix use of freed memory when replacing existing loopback device
Store the loopback device as data on loopback grub_disk structures, rather
than the file it points to.
Author: Colin Watson <cjwatson@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/742967
Forwarded: yes
Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3162
Last-Update: 2011-04-01
Index: b/grub-core/disk/loopback.c
===================================================================
--- a/grub-core/disk/loopback.c
+++ b/grub-core/disk/loopback.c
@@ -166,7 +166,7 @@
disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN;
disk->id = (unsigned long) dev;
- disk->data = dev->file;
+ disk->data = dev;
return 0;
}
@@ -175,7 +175,7 @@
grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector,
grub_size_t size, char *buf)
{
- grub_file_t file = (grub_file_t) disk->data;
+ grub_file_t file = ((struct grub_loopback *) disk->data)->file;
grub_off_t pos;
grub_file_seek (file, sector << GRUB_DISK_SECTOR_BITS);

View File

@ -31,3 +31,4 @@ mdraid1x_raid0_size.patch
mdraid1x_super_offset.patch
host_optimise_flush.patch
mkimage_yeeloong.patch
loopback_replace.patch