]> git.baikalelectronics.ru Git - kernel.git/commit
xen: fix grant table bug
authorMichael Abd-El-Malek <mabdelmalek@cmu.edu>
Fri, 4 Apr 2008 09:33:48 +0000 (02:33 -0700)
committerIngo Molnar <mingo@elte.hu>
Fri, 4 Apr 2008 16:36:46 +0000 (18:36 +0200)
commit675afd61a36fdfd48657a867cb04f0f70b8bd33e
treeb8cd0cc51cf9bfb96f99ad58038b7489ae5b7c9c
parent91099fd7a9e6b2287ba0705377edfb14b8b5aec9
xen: fix grant table bug

fix memory corruption and crash due to mis-sized grant table.

A PV OS has two grant table data structures: the grant table itself
and a free list.  The free list is composed of an array of pages,
which grow dynamically as the guest OS requires more grants.  While
the grant table contains 8-byte entries, the free list contains 4-byte
entries.  So we have half as many pages in the free list than in the
grant table.

There was a bug in the free list allocation code. The free list was
indexed as if it was the same size as the grant table.  But it's only
half as large.  So memory got corrupted, and I was seeing crashes in
the slab allocator later on.

Taken from:

  http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/4018c0da3360

Signed-off-by: Michael Abd-El-Malek <mabdelmalek@cmu.edu>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
drivers/xen/grant-table.c