lkml.org 
[lkml]   [2019]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset()
On Mon, 9 Sep 2019 18:21:47 +0200
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

[...]


> > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> > index f329dcb3f44c..dfba51c9d60c 100644
> > --- a/arch/s390/kvm/kvm-s390.c
> > +++ b/arch/s390/kvm/kvm-s390.c
> > @@ -1018,6 +1018,10 @@ static int
> > kvm_s390_vm_start_migration(struct kvm *kvm) /* mark all the pages
> > in active slots as dirty */ for (slotnr = 0; slotnr <
> > slots->used_slots; slotnr++) { ms = slots->memslots + slotnr;
> > + if (!ms->dirty_bitmap) {
> > + WARN(1, "ms->dirty_bitmap == NULL\n");
>
> I would prefer to not have a WARN_ON. Otherwise this would allow a
> malicious user to spam the log.

I agree, the WARN is not needed.

>
> > + return -EINVAL;
> > + }
> > /*
> > * The second half of the bitmap is only used on
> > x86,
> > * and would be wasted otherwise, so we put it to
> > good

Otherwise it looks good.



Claudio Imbrenda

\
 
 \ /
  Last update: 2019-09-10 12:22    [W:0.040 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site