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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 4B4B8C18E5B for ; Tue, 10 Mar 2020 11:17:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 19654246B0 for ; Tue, 10 Mar 2020 11:17:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19654246B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AE9116B0005; Tue, 10 Mar 2020 07:17:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A99606B0006; Tue, 10 Mar 2020 07:17:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AE966B0007; Tue, 10 Mar 2020 07:17:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 80CC36B0005 for ; Tue, 10 Mar 2020 07:17:14 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6E057180AD81F for ; Tue, 10 Mar 2020 11:17:14 +0000 (UTC) X-FDA: 76579201188.11.cause46_4fb8c602ca30 X-HE-Tag: cause46_4fb8c602ca30 X-Filterd-Recvd-Size: 3575 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Mar 2020 11:17:14 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id t11so15336617wrw.5 for ; Tue, 10 Mar 2020 04:17:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hMeYQLjzGBbtQiC8mAcdXgfjl4PT8fCW6CmTjHRY5u4=; b=AjTwHKeNvMX/DgF1Q6fL0PKiD/lyumZIfVIRUyOPKmnMLeOf3KbIcHC8+l2M6Bwv8Q fS8QunWYZfIY4iQlKd4lEt345/SPZ1MVnXlTY9BquJD4uDq+rIhlidyyU79coYApRrfZ 5dH1zqk1W/Y5mvA0UaP6BLTMxvU7NQUEh9Na9EFI53RqxA0t2Sg/E+R3Ai4lEAjMJrD2 mejkpzkPNhNkQWDv1Lmu2kvaGrtZXH5rvzzIt43y1YZ0uLLjqCA2tFDY/5yFNXsFpH/u 5haa//0vxwP69+QrX+UF9MD4v94u5UXDzKgWmxB8/qdl1ECWNi2EfZjW/N4rHywdRufj ajjQ== X-Gm-Message-State: ANhLgQ20ZesPpm1TP02IWHFYfZe2ONykNBqVhY0mqEoQdKmS0q2P4XuH Vrei6OvEQ6bTuzILB+i/iBI= X-Google-Smtp-Source: ADFU+vvwMGbod/4+O259JslpdYAISzZQ2Ja6Zj9n5SvnGOf2IeBIQt9CdyH0FQcsl015TRgEW+7DEw== X-Received: by 2002:a5d:4685:: with SMTP id u5mr25849575wrq.69.1583839032708; Tue, 10 Mar 2020 04:17:12 -0700 (PDT) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id 5sm11485857wrh.10.2020.03.10.04.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 04:17:11 -0700 (PDT) Date: Tue, 10 Mar 2020 12:17:10 +0100 From: Michal Hocko To: "Kirill A. Shutemov" Cc: brookxu , hannes@cmpxchg.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2] memcg: fix NULL pointer dereference in __mem_cgroup_usage_unregister_event Message-ID: <20200310111710.GF8447@dhcp22.suse.cz> References: <077a6f67-aefa-4591-efec-f2f3af2b0b02@gmail.com> <20200310094836.GD8447@dhcp22.suse.cz> <20200310104149.5c3pc75y6ny5hixb@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200310104149.5c3pc75y6ny5hixb@box> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 10-03-20 13:41:49, Kirill A. Shutemov wrote: > On Tue, Mar 10, 2020 at 10:48:36AM +0100, Michal Hocko wrote: > > [Cc Kirill, I didn't realize he has implemented this code] > > My first non-trivial mm contribution :P Everybody has to pay for sins of youth :p [...] > > It seems that the code has been broken since 2c488db27b61 ("memcg: clean > > up memory thresholds"). We've had 371528caec55 ("mm: memcg: Correct > > unregistring of events attached to the same eventfd") but it didn't > > catch this case for some reason. Unless I am missing something the code > > was broken back then already. Kirill please double check after me. > > I think the issue exitsted before 2c488db27b61. The fields had different > names back then. > > The logic to make unregister never-fail is added in 907860ed381a > ("cgroups: make cftype.unregister_event() void-returning"). I believe the > Fixes should point there. Yes, you seem to be right. It doesn't make a difference much as both went in to the same kernel but a proper Fixes tag is really valuable. Thanks for looking into that. -- Michal Hocko SUSE Labs