From patchwork Tue Sep 28 18:56:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1534021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=JSMaxiHL; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HJpf11Rpsz9shn for ; Wed, 29 Sep 2021 04:57:12 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mVIHi-0003Lx-6T; Tue, 28 Sep 2021 18:56:58 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mVIHg-0003Lr-E3 for kernel-team@lists.ubuntu.com; Tue, 28 Sep 2021 18:56:56 +0000 Received: from mussarela.. (unknown [179.93.212.127]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 8E5EE419C1 for ; Tue, 28 Sep 2021 18:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632855416; bh=GnfafUhC5Wup+XHB0VHHIwzvXj3XUsnrGtwlBvaLiuk=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=JSMaxiHLt4oMwACl0JYSTs8XsI2oMgKTxuyzloOv98c4VvKQMJDYWSjpYIDgZEOiw DsbFPJFdtClJSeGXFpXv3GrGATmivBinoeKcrox2z0wEfCQFu2cK0rYn4rLFVNd3k0 dXsvb7SnfStdfhF49eZhHe3q30qlVvqFE9P7QmYwTAnZqUFk3T8EdLo+1zmqDecmVk d87f1QJwhD9RbA1lY8DwTRRncKKrNNLNr9vUF9BfAF5po8bCq4t1kReywNpE5EC0af rdOFkw1+AOGnxscXZGCsKxD/hH/rpbkTiV1maSMQZ+qKMX3VWDllvKuNBM85yxEqld EhFDCCj0vwd3w== From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [SRU Bionic/Focal/Hirsute/Impish/hwe-5.8/oem-5.10/oem-5.13 0/1] CVE-2021-3759 Date: Tue, 28 Sep 2021 15:56:46 -0300 Message-Id: <20210928185648.144163-1-cascardo@canonical.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" [Impact] IPC objects are unaccounted as memcg limits, breaking them and leading to DoS (OOM outside the memory cgroup). [Backports] The allocation calls have changed from kvmalloc from kmalloc or kmalloc to kzalloc. I kept them as they were, just changing the GPF_KERNEL to GPF_KERNEL_ACCOUNT as from the original commit. [Test case] I did a large semget loop. When the process was on a memcg, without the fix, processes from outside the cgroup would be killed, whereas, with the fix, only processes whithin the cgroup would be OOM-killed. [Potential regression] IPC requests may be refused when processes are restricted to memory cgroups. Vasily Averin (1): memcg: enable accounting of ipc resources ipc/msg.c | 2 +- ipc/sem.c | 9 +++++---- ipc/shm.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) Acked-by: Tim Gardner Acked-by: Stefan Bader Acked-By: AceLan Kao