Skip to content

Commit 8c9eb0e

Browse files
committed
xen/grant-table: never put a reserved grant on the free list
Make sure a reserved grant is never put on the free list, as this could cause hard to debug errors. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 79c2231 commit 8c9eb0e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/xen/grant-table.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ static inline void check_free_callbacks(void)
207207
static void put_free_entry(grant_ref_t ref)
208208
{
209209
unsigned long flags;
210+
211+
if (unlikely(ref < GNTTAB_NR_RESERVED_ENTRIES))
212+
return;
213+
210214
spin_lock_irqsave(&gnttab_list_lock, flags);
211215
gnttab_entry(ref) = gnttab_free_head;
212216
gnttab_free_head = ref;

0 commit comments

Comments
 (0)