Skip to content

Commit 6ca32a3

Browse files
committed
[DO NOT MERGE] test analysis a little
Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
1 parent 80e6205 commit 6ca32a3

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

xen/common/grant_table.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,11 @@ active_entry_acquire(struct grant_table *t, grant_ref_t e)
349349
*/
350350

351351
act = &_active_entry(t, e);
352+
353+
/*
354+
How about logging?
352355
spin_lock(&act->lock);
356+
*/
353357

354358
return act;
355359
}
@@ -419,7 +423,10 @@ double_gt_lock(struct grant_table *lgt, struct grant_table *rgt)
419423
*/
420424
if ( lgt < rgt )
421425
{
426+
/*
427+
Only lock one?
422428
grant_write_lock(lgt);
429+
*/
423430
grant_write_lock(rgt);
424431
}
425432
else
@@ -3163,7 +3170,8 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
31633170
goto unlock;
31643171
}
31653172

3166-
for ( i = 0; i < op.nr_frames; i++ )
3173+
/* Let's check bounds */
3174+
for ( i = 0; i <= op.nr_frames; i++ )
31673175
{
31683176
gmfn = gnttab_status_gmfn(d, gt, i);
31693177
if ( copy_to_guest_offset(op.frame_list, i, &gmfn, 1) )
@@ -3188,8 +3196,11 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t) uop)
31883196
struct domain *d;
31893197
int rc;
31903198

3199+
/*
3200+
Let's see what happens if we do not initialize op
31913201
if ( copy_from_guest(&op, uop, 1) )
31923202
return -EFAULT;
3203+
*/
31933204

31943205
d = rcu_lock_domain_by_any_id(op.dom);
31953206
if ( d == NULL )
@@ -3773,8 +3784,11 @@ grant_table_destroy(
37733784
struct grant_table *t = d->grant_table;
37743785
int i;
37753786

3787+
/*
3788+
Test what happens if we drop a NULL check.
37763789
if ( t == NULL )
37773790
return;
3791+
*/
37783792

37793793
gnttab_destroy_arch(t);
37803794

0 commit comments

Comments
 (0)