Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3375095pxb; Sun, 24 Oct 2021 00:14:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEudy5khSzy4aTRG53qrd+vxUUQT/PB1Rki19TQ7RtlMGkj6EgKkn2wEhZ/gXucH17bJg2 X-Received: by 2002:a17:907:8a12:: with SMTP id sc18mr12630191ejc.569.1635059697634; Sun, 24 Oct 2021 00:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635059697; cv=none; d=google.com; s=arc-20160816; b=wUkdCmEWrPyozSkxh6+zsiIo8hssr5HS/vyFuEhUDk2zGo+mupzWK5cpnmNE5dtzvl S+0efr/xpaUH/5ezODz1dXZuX6OBdV8Ydwjfxy/3zWz5SyiakWqwdwWH4Jv+iwSETo0C sbt9msO+x0kN3mrmn6IdeSlscF8X19bOI814rED4Z4NffBBqj2aaaUH1dQMAs2XdW5M7 f84m8SC0pJjLgksWH3kjkLtVvawbRXw/4+9airLBJMEpekuyzF6e9mT2kOn8bpHBIIDP 9e+Szjo3VswBAxeCrVucjZT8rj3cI6o/0nKsc04wHeV2ECH2r2MGIEas0t4LHQsATx4u Mr0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fYsl9CYVa0vbeqaio429pJ7nWHE90zcqRVhgSRIdIYE=; b=t8fJIEhFUJWcdpNYGEOm8741t04IriB0HMoF6EGc/rF52psS5f2ziYR5xKsV7Q+4Ia JUxNkz07qSUc64hDRW2OBRz7sNKwfEAgtfLpTYLN5JQ9zeHTK4p5wHGJc80cWIBuYvfr hBpOCg9Xtpu5ntOig0NO0Yws34oN0Y0iTgV/m1tgdRXc93SfmwPTxI+zlnn86KiUCCHo y72cFK2A68BOLaMQo9lj7X1/HpZ9fzB6qIpH8UgomkCPdJiJEbw/CEN8lKzGYfTTWXCq UFlFocgTNWgeZEkowb/XiYtfm8xbhB7BEB+Syr2vNkJdOYm7MD73DfkBsVqfwNp9jZd+ O9fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Bk3oVRii; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si16993709ede.580.2021.10.24.00.14.19; Sun, 24 Oct 2021 00:14:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Bk3oVRii; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229844AbhJXHKP (ORCPT + 99 others); Sun, 24 Oct 2021 03:10:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbhJXHKO (ORCPT ); Sun, 24 Oct 2021 03:10:14 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F73AC061764 for ; Sun, 24 Oct 2021 00:07:54 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id b4-20020a9d7544000000b00552ab826e3aso10299356otl.4 for ; Sun, 24 Oct 2021 00:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fYsl9CYVa0vbeqaio429pJ7nWHE90zcqRVhgSRIdIYE=; b=Bk3oVRiinhyfUlUcu+RlImWiIPCpoTZ7ciEl/1OCvFY0dRkxxH18hHVnZpsoaIWFdy 0iewLMOx/Pju7GJoyBoZS7tVK/q3k2yFnk7gBPGxa1bofWh5ApetiKpfjOeudXwYKIXL pSpSNWjKpvv0cH4AmnEIW+AiLFio7FO8t2fLFvwqna2BwBp19c2CQnYj0Xh4b54Z0FPG lT9afotWcfmVubaytI7b3r9ujl4Ag0LcG1GWEqyIyMkcRBaGdX/QHzUMMAKBQNqTYYnx OYMAG3AzVjOIn1JRxQ5hjhGbMQ/ssqJNVa+pHen+InDyatmILE6A1aUGQ2kR8aUo7hxo +rrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fYsl9CYVa0vbeqaio429pJ7nWHE90zcqRVhgSRIdIYE=; b=odgdSns+/jbpNg8RDC0TGNml3W1fQkOz7zkgvucBqE/QnA2uywDFRE34P77tF2YFMv W4JRNd5gbquudwru2mSBk/OEkdkeKb2gZ0P0BX3ibrFJVWpP+CacyDIS3j3TguG5T/Gd Ql6d64DIHt1XSx4mm+/ofHk3FY9ViLIE1zw0NqpEK8Se8h8H/R0Zan8y1aS/3/fILjDR V8lyaqaGW6rzP2QgnbC8r3Dp6VjVciPYSR9cW6hYodTQwVymqINqP9I0tzo5yyVp9YEU d0jRDEDeXuVNwBPvt+FdhNppudITjtneCSOohCwrznFcYKx5/n04iLdyT2PcM3gyoKA2 MEEA== X-Gm-Message-State: AOAM531DxU8DPPr1ZBgLuph8VBoQSCjFi7XgIoDkZjqWAVmMefgaqoqe +NoyLiQhk/nf+VWBq+y0of8qN2X+VvibTTvhjAKnnA== X-Received: by 2002:a05:6830:402c:: with SMTP id i12mr8016921ots.319.1635059273605; Sun, 24 Oct 2021 00:07:53 -0700 (PDT) MIME-Version: 1.0 References: <00000000000062d0fc05cef24c57@google.com> <088FF23B-CD8E-4E53-B702-53E2C2382062@chromium.org> In-Reply-To: From: Dmitry Vyukov Date: Sun, 24 Oct 2021 09:07:42 +0200 Message-ID: Subject: Re: [syzbot] WARNING: refcount bug in sys_memfd_secret To: Mike Rapoport Cc: Matthew Wilcox , Kees Cook , syzbot , Jordy Zomer , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 24 Oct 2021 at 07:38, Mike Rapoport wrote: > > On Sat, Oct 23, 2021 at 11:46:18PM +0100, Matthew Wilcox wrote: > > On Sat, Oct 23, 2021 at 10:03:11AM -0700, Kees Cook wrote: > > > On October 23, 2021 8:27:28 AM PDT, Mike Rapoport wrote: > > > >and my first reaction was to send a revert the untested commit 110860541f44 > > > >("mm/secretmem: use refcount_t instead of atomic_t"). > > > > I think you should. This isn't a real problem. > > Do you mean that creation of 4 billion of file descriptors is not feasible? FWIW I think refcount is at least capable of catching the issue I described with the counter temporarily going below its true value. With refcount it can be caught during fuzzing as refcount reaching 0 and then being incremented again. Basically this warning, but a true positive.