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] [day] [month] [year] [list]
Message-ID: <e9e616d2-4bba-43b4-e41f-3c73f65371aa@kernel.dk>
Date:   Mon, 14 Sep 2020 19:47:19 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     Tejun Heo <tj@...nel.org>
Cc:     linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
        kernel-team@...com
Subject: Re: [PATCH block/for-next] iocost: fix infinite loop bug in
 adjust_inuse_and_calc_cost()

On 9/14/20 9:05 AM, Tejun Heo wrote:
> adjust_inuse_and_calc_cost() is responsible for reducing the amount of
> donated weights dynamically in period as the budget runs low. Because we
> don't want to do full donation calculation in period, we keep latching up
> inuse by INUSE_ADJ_STEP_PCT of the active weight of the cgroup until the
> resulting hweight_inuse is satisfactory.
> 
> Unfortunately, the adj_step calculation was reading the active weight before
> acquiring ioc->lock. Because the current thread could have lost race to
> activate the iocg to another thread before entering this function, it may
> read the active weight as zero before acquiring ioc->lock. When this
> happens, the adj_step is calculated as zero and the incremental adjustment
> loop becomes an infinite one.
> 
> Fix it by fetching the active weight after acquiring ioc->lock.

Applied, thanks.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ