[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 for-4.14] x86/monitor: revert default behavior when monitoring register write events


  • To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Tue, 9 Jun 2020 02:14:13 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bitdefender.com; dmarc=pass action=none header.from=bitdefender.com; dkim=pass header.d=bitdefender.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0z/blzsh626fEpKcpbfFnHTuK9nMDcgSPsH5WU4t0oQ=; b=X0whqMCJ2wiCgTTw18CBIKWC/lUDjzrc2gpBYkbsTELpFzGPR1N1n0YnIBhjTWIfNJ+61E1RLGjj2Ub0UtuGP2lx/7aNUp2u5ggN0zhM0Sau+XRE6gOGFjvX+26Uy0wpmL4cr15QVqUDhC8xyY62dX/F+QqpTJcLZDVKcRaWHiG3GEWdoXGYj/x6rif8hqhWErWT4RzwgCo2OMcuNdUp3hO5m/RBbPsuWXBIne+eDEd2UY/H8tyhP7+M2CyUqKJBIspuLErOvzH9PVDjKh/nfL8MwkoeamqHxH6WUwzVpoP8UCqcJAu2RJ5f2VgcX4gRvTelQTK7xz4hSI5vcUYqAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gC8E0foYlAxg7I3/fz8jUx1isFQyI/uwZ8EZUC/VP7QpOlcEhN+KdWjQ6AFO6/XFbAmIwQa+iRBP5EDF65uzk7wg46VtR0+gYSMPB3PggGrBzVaA2n9KUXefUhETj9jaiprQxmd3/ffyHfGNVFZtDRIMs8bcyw/8Y67VR3FRNn7Kt0RRrFrPcqdWmfDZMKXnqp0iVZzvEbPmuz+EXh9fwqnTDGFnvymuPTkyoImfy4a9zI1TlaW5tFiddUG5AP51M2pZvftJaYrWTMyy8Tw3YWaAaHp6e34Ho29EAzfW9piJOuNKX4gg4wQXHIHGoqkvOzqzVaI+RuC3U3FUVbjGrw==
  • Authentication-results: bitdefender.com; dkim=none (message not signed) header.d=none;bitdefender.com; dmarc=none action=none header.from=bitdefender.com;
  • Cc: Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, Andrei LUTAS <vlutas@xxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Mihai Donțu <mdontu@xxxxxxxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 09 Jun 2020 04:17:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 6/9/20 1:50 AM, Tamas K Lengyel wrote:
> On Mon, Jun 8, 2020 at 3:16 PM Razvan Cojocaru
> <rcojocaru@xxxxxxxxxxxxxxx> wrote:
>> 1. A security application that is unable to _prevent_ things being done
>> to a system is not doing a very good job, since in that case you can
>> only collect stats and not veto anything. I would argue that the default
>> for such a monitoring application should be the current one (all events
>> should be pre-action).
> 
> Not all security applications require this though. Malware analysis
> where stealth is required would absolutely not want this side-effect
> to be visible to the guest where malware could use it to determine
> that it's being monitored. So I don't buy into this argument.

Fair enough, in that case having both models supported should be fine.
I'll leave the rest of that conversation to my colleagues.

>> 2. This is further supported by the fact that that's exactly how the EPT
>> vm_events work: you get a "I want to write to this page" event _before_
>> the write occurs. If register writes behave differently, you have _two_
>> different models: one where you get an event post-action, and one where
>> you get one pre-action.
> 
> Whether you get an event before or after the effects of the event have
> been applied to the system state shouldn't matter as long as you can
> revert that action. I wouldn't care either way to be the default. But
> having a default that breaks other use-cases is unacceptable.

You keep saying that as if I disagree. :) But we've already established
that the potential for a race condition has been found and needs to be
fixed.

My only (minor) objection has been that a patch fixing the current model
would have been preferable to one that switches the default as a
workaround. Still, it's understandable that perhaps there's no time or
motivation for that.


Thanks for the work,
Razvan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.