lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190926081400.GH4553@hirez.programming.kicks-ass.net>
Date:   Thu, 26 Sep 2019 10:14:00 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Frederic Weisbecker <frederic@...nel.org>
Cc:     Ingo Molnar <mingo@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Wanpeng Li <wanpengli@...cent.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH] sched/vtime: Fix guest/system mis-accounting on task
 switch

On Wed, Sep 25, 2019 at 11:42:42PM +0200, Frederic Weisbecker wrote:
> vtime_account_system() assumes that the target task to account cputime
> to is always the current task. This is most often true indeed except on
> task switch where we call:
> 
> 	vtime_common_task_switch(prev)
> 		vtime_account_system(prev)
> 
> Here prev is the scheduling-out task where we account the cputime to. It
> doesn't match current that is already the scheduling-in task at this
> stage of the context switch.
> 
> So we end up checking the wrong task flags to determine if we are
> accounting guest or system time to the previous task.
> 
> As a result the wrong task is used to check if the target is running in
> guest mode. We may then spuriously account or leak either system or
> guest time on task switch.
> 
> Fix this assumption and also turn vtime_guest_enter/exit() to use the
> task passed in parameter as well to avoid future similar issues.
> 
> Fixes: 2a42eb9594a1 ("sched/cputime: Accumulate vtime on top of nsec clocksource")
> Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Rik van Riel <riel@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Wanpeng Li <wanpengli@...cent.com>
> Cc: Ingo Molnar <mingo@...nel.org>

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ