From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13EACC43387 for ; Sat, 29 Dec 2018 19:39:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D830220873 for ; Sat, 29 Dec 2018 19:39:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IeK8dGvy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728323AbeL2TjT (ORCPT ); Sat, 29 Dec 2018 14:39:19 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:39891 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727736AbeL2TjS (ORCPT ); Sat, 29 Dec 2018 14:39:18 -0500 Received: by mail-yw1-f67.google.com with SMTP id j6so8207574ywj.6 for ; Sat, 29 Dec 2018 11:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sBBN2mphyXf7II5d9cbYV+3gNH1blN+Ub//bXMWso6o=; b=IeK8dGvyQFN1k5SZbplWXk3V0SIzw9j2rmL9koMjC7iv+qPVeovSwAMzOdqgUS3Kcl //2YwH0lVSrhCJlRATLtfOrcdYoOQHC3jCT3jFt2UZJaa/3FlOQ95FC5UUiwBan0RacU LDnWYlyPEXx2bKploZ3oYHeihW3luV6f0+VKJlrn5CUw8gRkUGdGIrzEgrOYTU7byRpv Tu7gL96vgYK3WtV5ssyHpNNKjTtTtWOBOqf10+WcS0fii4X3P4JFJG2+QhEphYoY5Tn2 6x4aeFCKX0ZWcD5CaemqpzJCKLptsuukhgC65wMqmM9tsYdi1xliAQyTvqCzmiG9rqoc CRLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sBBN2mphyXf7II5d9cbYV+3gNH1blN+Ub//bXMWso6o=; b=G/OWKq/KzB2t/BBgvQMGoXMFEcGxu0lrVnddwbF/4XgauA6lo4tgx+LNHIiNzYtGdi Fsl3yWZLfRnpBuGjAZqYNGD8ViHwB+RiiEKa2R4MTqtKkV+egnoXexhk/GC2nGE/vp34 OhhbPbHezAjaERiB3L4M/0T/dHNL0VFXZKgC/0gvjNDNek38jr1tESs8s8bLyo1zPO9y HwnkPeJ1R4kvpiGDfgDzyHAygSNCD2fcnYOGkp4yZiS/fUPFZEslq4MNnZSjCqSlfRoT r/TYmCR1D8fftfYF37eO2VP5OVwxh9Hxvt2jMV477efQ9x/gwVdEUDbQ8kKpdeCbVyDS QSZA== X-Gm-Message-State: AA+aEWY85cSty7DzmcV+UH6w5+xfDGnB1raIw0a46q9gJ5heY2Jp01rz HsPtEFRWLhlQfpmQ/c4BGppK13ipEWkBC0uWLQR2EQ== X-Google-Smtp-Source: AFSGD/VNzN0sznBQKNWyIE9lVvYn+Yku7qopyFK6Kzv9Ir+NtzY0f/EA1+sPzg/kT2UVezzNhV3E1sCC9t3lOzFPuBw= X-Received: by 2002:a81:ee07:: with SMTP id l7mr32007083ywm.489.1546112357402; Sat, 29 Dec 2018 11:39:17 -0800 (PST) MIME-Version: 1.0 References: <20181229015524.222741-1-shakeelb@google.com> <20181229073325.GZ16738@dhcp22.suse.cz> <7c0fa75f-df2f-668e-ebc2-3d3e9831030f@virtuozzo.com> In-Reply-To: <7c0fa75f-df2f-668e-ebc2-3d3e9831030f@virtuozzo.com> From: Shakeel Butt Date: Sat, 29 Dec 2018 11:39:06 -0800 Message-ID: Subject: Re: Re: [PATCH] netfilter: account ebt_table_info to kmemcg To: Kirill Tkhai Cc: Michal Hocko , Pablo Neira Ayuso , Florian Westphal , Jozsef Kadlecsik , Roopa Prabhu , Nikolay Aleksandrov , Andrew Morton , Linux MM , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux-foundation.org, LKML , syzbot+7713f3aa67be76b1552c@syzkaller.appspotmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kirill, On Sat, Dec 29, 2018 at 1:52 AM Kirill Tkhai wrote: > > Hi, Michal! > > On 29.12.2018 10:33, Michal Hocko wrote: > > On Fri 28-12-18 17:55:24, Shakeel Butt wrote: > >> The [ip,ip6,arp]_tables use x_tables_info internally and the underlying > >> memory is already accounted to kmemcg. Do the same for ebtables. The > >> syzbot, by using setsockopt(EBT_SO_SET_ENTRIES), was able to OOM the > >> whole system from a restricted memcg, a potential DoS. > > > > What is the lifetime of these objects? Are they bound to any process? > > These are list of ebtables rules, which may be displayed with $ebtables-save command. > In case of we do not account them, a low priority container may eat all the memory > and OOM killer in berserk mode will kill all the processes on machine. They are not bound > to any process, but they are bound to network namespace. > > OOM killer does not analyze such the memory cgroup-related allocations, since it > is task-aware only. Maybe we should do it namespace-aware too... This is a good idea. I am already brainstorming on a somewhat similar idea to make shmem/tmpfs files oom-killable. I will share once I have something more concrete and will think on namespace angle too. thanks, Shakeel