Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp832833ybc; Tue, 12 Nov 2019 09:52:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxyJ1Vj6+GqEJtR44Vw9Gth03hVoF4x3MjXBUmdImYPKXwl1Drp3bTvzt1c/I2a6UF2BGgn X-Received: by 2002:a17:906:2f09:: with SMTP id v9mr3803041eji.91.1573581152081; Tue, 12 Nov 2019 09:52:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573581152; cv=none; d=google.com; s=arc-20160816; b=UFkUDeHUUdFCG98aT+Jjhk4AtfptCQCsqnR21whl2KSBW/fb++26jDPTjkAqyPrij8 uYeMAo28Yneklg65gdgMNZcGIrgjZ/ZLzI/yN5xTY9HFsHEcKNvEKodn+pDv+9xDaOYw kMOJKbddIOriBWL4L7vV4C2CSImYNjysqsdEvs2KK3PHnmZDyv/gvVK0OW3aW9yDyfAE DRRudh3OdaE67pTl9t3Wq0knfmbt9ELNBE9KesMgsqaRowm/CTIA4miIganPVQDEeSej mWgjItXJcXFTvfOD3EJsnGarlJuebOcxB8Kog775pj+CRIadyn7peTMlOrVTH0IBu7c9 NhhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=b2s8SEY9t9fulZHVtE2E7prB2MDxE1u1Ylc99r86PD8=; b=yX4hTBC3a2j9tcEtwcGaTcR9S7Wx+kPZzRUWMUTe0TaGOdDfMJRFiAUwUMAuzqZm8W DY3UZ25MzFcO04SG1XmO1TqLSB91aTtqZ77/0CnGXGrLeWxvJlC8QsICK08sPeQeN/qa us/GlrpqWwtTmIuSqklHrjYeOI8bqWH9sT+O1neL6e5q1bpOsa1wJK5lMXEcO7kS77Bf XxyBZpRj2eh/++gF9WP2LUmAMDL/f2YHuBglE5QQ9xlywhx5J8pzRqns87TN2a0I1yb4 qO2/TD0MPD03VojtwyZUF2NGlZ0GggbdddrWNqtfBVoEeNWf0fOxHNl6RE9dXIQWEcvk pztQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d0yJ5Dz5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j21si410593ejd.265.2019.11.12.09.52.07; Tue, 12 Nov 2019 09:52:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d0yJ5Dz5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbfKLRtV (ORCPT + 99 others); Tue, 12 Nov 2019 12:49:21 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35641 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbfKLRtV (ORCPT ); Tue, 12 Nov 2019 12:49:21 -0500 Received: by mail-wr1-f65.google.com with SMTP id s5so8440005wrw.2 for ; Tue, 12 Nov 2019 09:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=b2s8SEY9t9fulZHVtE2E7prB2MDxE1u1Ylc99r86PD8=; b=d0yJ5Dz57PgK7Z0V45voYWt/WzqHqNY5NBtC01g2eYXLfE8Fypw7fDOQj6rCAVMLgV 6oVT+CjwNI4Ez5Rt6oVCGHCbyocVxo4X1IJsWxQjICw2lNDresTfFfA1/NuBqgqqPK/6 anWK84bmfXc/gaWVG5HyLCAMiaVtVlWFPlPSsPa8Hqt5j3fJyQlzQV46OIfFNp0VoTD+ KM+6LnMOkApmbvtmkV7O/+aLZ3UMAFvnrz/kH1F9puI53ZQ6SVWh5x5EG5LN/PiXpw3x eziGKFGb9OPQAG/1+VOGE99qEBF8XUudh36wPcwEW6ZKVirUVUanEEdsyal0p8D68csy 64hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=b2s8SEY9t9fulZHVtE2E7prB2MDxE1u1Ylc99r86PD8=; b=Z+uDxCyIuIVwusjCLyNg0IMmLE0pRWmgH+mHCM+FyUIaAQN/zC/saA+joDha2M0rzR d92Af8GmX12rA7m5IfpaZ+s7QYGIYoWxcIFgwAEkRny3jlT77YHug6Tl0unuMtNbIEgM XqBjtNDr8JkmwD7i2djloWiUGnXl5OH7XaLGTMyMweqYcofxWG3TQazpXXnKLBAEB+xu Ooz94NjyJUG3WKkNMDOGyOun4JZeuvS47WxY5os/v42980l8j5TwnjppHgfIbNEOBBfv EncBLhH1Rne75Sytbg6Ir3XH4M8Zl03f8JZ9+eWtvPwsypNEfZKsLFMj0cESK30fFGE/ UYnQ== X-Gm-Message-State: APjAAAVhhp9K8Onpg+6CCly+kUTBZdp+CCRhe//p1g5DmSWjMzmxOWH8 2nZRwvBRx8SQRPDNETrsE8vqUg== X-Received: by 2002:adf:dc81:: with SMTP id r1mr29187752wrj.84.1573580959164; Tue, 12 Nov 2019 09:49:19 -0800 (PST) Received: from [192.168.43.233] ([37.161.193.189]) by smtp.gmail.com with ESMTPSA id 76sm5676410wma.0.2019.11.12.09.49.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Nov 2019 09:49:18 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: [PATCH BUGFIX] block, bfq: deschedule empty bfq_queues not referred by any process From: Paolo Valente In-Reply-To: <83a56a54-3269-ecb9-f4ae-01c3f9717279@kernel.dk> Date: Tue, 12 Nov 2019 18:49:16 +0100 Cc: linux-block , linux-kernel , Ulf Hansson , Linus Walleij , noreply-spamdigest via bfq-iosched , Oleksandr Natalenko , Chris Evich , Patrick Dung , Thorsten Schubert Content-Transfer-Encoding: quoted-printable Message-Id: <4E12E7F9-B6C3-4B8A-9659-C60C9830ACBB@linaro.org> References: <20191112074856.40433-1-paolo.valente@linaro.org> <83a56a54-3269-ecb9-f4ae-01c3f9717279@kernel.dk> To: Jens Axboe X-Mailer: Apple Mail (2.3445.104.8) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Il giorno 12 nov 2019, alle ore 16:23, Jens Axboe ha = scritto: >=20 > On 11/11/19 11:48 PM, Paolo Valente wrote: >> Since commit 3726112ec731 ("block, bfq: re-schedule empty queues if >> they deserve I/O plugging"), to prevent the service guarantees of a >> bfq_queue from being violated, the bfq_queue may be left busy, i.e., >> scheduled for service, even if empty (see comments in >> __bfq_bfqq_expire() for details). But, if no process will send >> requests to the bfq_queue any longer, then there is no point in >> keeping the bfq_queue scheduled for service. >>=20 >> In addition, keeping the bfq_queue scheduled for service, but with no >> process reference any longer, may cause the bfq_queue to be freed = when >> descheduled from service. But this is assumed to never happen, and >> causes a UAF if it happens. This, in turn, caused crashes [1, 2]. >>=20 >> This commit fixes this issue by descheduling an empty bfq_queue when >> it remains with not process reference. >>=20 >> [1] https://bugzilla.redhat.com/show_bug.cgi?id=3D1767539 >> [2] https://bugzilla.kernel.org/show_bug.cgi?id=3D205447 >=20 > Applied, thanks. >=20 That was fast (thanks)! Some people are testing this, with no more hangs, and no new issues, so far. BTW, could you reply to the hung thread on finally fixing BFQ's cgroups interface [1]? Thanks, Paolo [1] https://lkml.org/lkml/2019/10/1/1252 > --=20 > Jens Axboe