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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1262C433F5 for ; Sun, 24 Oct 2021 07:07:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2AE1E60FD7 for ; Sun, 24 Oct 2021 07:07:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2AE1E60FD7 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 557F16B006C; Sun, 24 Oct 2021 03:07:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 507DB6B0071; Sun, 24 Oct 2021 03:07:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41DA06B0072; Sun, 24 Oct 2021 03:07:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 3072E6B006C for ; Sun, 24 Oct 2021 03:07:55 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C6D271801495B for ; Sun, 24 Oct 2021 07:07:54 +0000 (UTC) X-FDA: 78730451268.31.E3FA348 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by imf20.hostedemail.com (Postfix) with ESMTP id C45F1D0000A7 for ; Sun, 24 Oct 2021 07:07:49 +0000 (UTC) Received: by mail-ot1-f51.google.com with SMTP id v2-20020a05683018c200b0054e3acddd91so7758875ote.8 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=uCx09Y/2Y9T9584LUKQVU3o7g/g5TzjHAJy5TidBmLXGBa2xcMiLw4soi1edsAcP9I hxldyRC9keS0WXRxgitvKoPYfM3yo/8Enhs4K3KhyVAIu/eRXpf/aunlq5pKhAEIefMF BrmTEC/Mosk0roPgjQYUDBaCkV8/lr/hahKigTtLF83u0wfZA1ucXW2bBjQgyJquA07L yD0+bQ+vRQ/MWpdWPbyh+LoIeToQFEkLMbA2Y909vBLqTbX/iMUHpkoU7ULLQVBGI4sg sp8YxYxn5IX3NW7r7m84GtpfKl7khMT9rOYs9ZrudQKTFmRgwoobRjN10/tk33oY4xR1 kp/g== X-Gm-Message-State: AOAM533t5nF2vC8dw99fKPHvnAJoOpqyyolxHbXvCTCLkamEK0hW2I+w S0nhFpAlrEVJw00/rOibydzF5tyHOnQwlPTgAl8ueA== X-Google-Smtp-Source: ABdhPJw1q5FXEGcSxeesKVoApYXL/oP86UXBU5bSp4qRUqAmI2LDoXKbuD0fL0nytKiZqzt44b+8WKu3IpswsmzEiNI= 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" X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C45F1D0000A7 X-Stat-Signature: ncjon9akz14mt6g4bt8aiuij4bdx48yd Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Bk3oVRii; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of dvyukov@google.com designates 209.85.210.51 as permitted sender) smtp.mailfrom=dvyukov@google.com X-HE-Tag: 1635059269-246999 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 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.