Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1736923pxb; Fri, 20 Aug 2021 12:41:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTNLan7RoASUnZTArQn0ctaGJYgv8SOhl7GcxcreNMvOlnLjMnFdNCDXMQs2nftOtU45kz X-Received: by 2002:a5d:8986:: with SMTP id m6mr16947792iol.87.1629488483461; Fri, 20 Aug 2021 12:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629488483; cv=none; d=google.com; s=arc-20160816; b=sGjPKNqpSj5FYqbn/HydCDGpSN6gsZTiIPoMgW4JGkvKSwMaYhTKL2qf01EDRwEd5G P5gadA12rXEbs15OV3EUH9C+HDDnI/6+BmCJAC2ZOJKguA8OxB3gqWYuygqht1HGa53M RuKnQ/oLpe+NadQus8IIGcBdAArYVRruBL2XpUkOm5ps3M5QTHnLszB7kGqLQgAEPXi/ EbIgpL1JtbQ7xSU1OD0lfZ/KFmQIgMgO0rerpPtf/wuK/wLN0xN3AGtnWMS5Cd0/vwhO QqCscF8sbJTBhYmCf0NlIsW1KPzIcP7OKs6rYQYvNmoTopGQAU0Y0+QmaIzGrpaJs1TE h9hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:dkim-signature; bh=bcPgGbljoOw8hg6ujHyebmzfoDMwLwiwDCOl2K5JJY0=; b=Ll0P9im5zVNlktajtgCw/hffNrGcykTGIEgvRs5e5b/da/NeyYxGune1lkpnjg1JEj 2YW+koc8D2+Z++BF+sXPZolH2byv2EvuyPR+oKM12RNETLYvqqIwBKhp2npR+zHXEkOc SH4OqKlREUirYauMHNPunzYXT0SeNq+V0sPoNShcjAy6u255/lP4QGvCZRdB1w3uVSwP nje4AjXQOdZVPK1zt0CYQW496aqQwi91HAIH7Yi3+Ne+/2FrdlxIQY+gj336vrI/nm3I +RcOCdaO6XKVDWYcduBu5O1rvpHd5mj67U5JstrgsOBS6NufbEO2uhYHS7H2ICDSEgxd Y2cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=MmqJ3XZX; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=MmqJ3XZX; 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=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si8789996jac.95.2021.08.20.12.41.10; Fri, 20 Aug 2021 12:41:23 -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=@hansenpartnership.com header.s=20151216 header.b=MmqJ3XZX; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=MmqJ3XZX; 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=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232279AbhHTTlG (ORCPT + 99 others); Fri, 20 Aug 2021 15:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbhHTTlG (ORCPT ); Fri, 20 Aug 2021 15:41:06 -0400 Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [IPv6:2607:fcd0:100:8a00::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB0AC061575 for ; Fri, 20 Aug 2021 12:40:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id A140A12801DB; Fri, 20 Aug 2021 12:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1629488427; bh=m7pwO1nE5aq19db0pqFBeoLj6CeJBhN9nsxzrjprEGM=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=MmqJ3XZXEfMCJlAKFh2eI/5ZYNGKBfgORnXhNp0Zz7I8QwbNLAPGdES1xy51LhjVO rQScnkEoKTaMQc34aIco0fRK5nIv5TfrSq8gvxUWmL5KtI/8U5OI1KJ5HGcbYmbU5B oab87nnJpijZ65kA7FHDIJKwwQieIIrNJmAuR/dI= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jN7dzCKAsSvP; Fri, 20 Aug 2021 12:40:27 -0700 (PDT) Received: from jarvis.int.hansenpartnership.com (unknown [IPv6:2601:600:8280:66d1::527]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 3077212801B4; Fri, 20 Aug 2021 12:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1629488427; bh=m7pwO1nE5aq19db0pqFBeoLj6CeJBhN9nsxzrjprEGM=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=MmqJ3XZXEfMCJlAKFh2eI/5ZYNGKBfgORnXhNp0Zz7I8QwbNLAPGdES1xy51LhjVO rQScnkEoKTaMQc34aIco0fRK5nIv5TfrSq8gvxUWmL5KtI/8U5OI1KJ5HGcbYmbU5B oab87nnJpijZ65kA7FHDIJKwwQieIIrNJmAuR/dI= Message-ID: <68d2b3afd9a7ee27cdb7ec9ff7eb45342ce23c12.camel@HansenPartnership.com> Subject: Re: [PATCH] mm/secretmem: use refcount_t instead of atomic_t From: James Bottomley To: Jordy Zomer , Kees Cook Cc: linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Mike Rapoport Date: Fri, 20 Aug 2021 12:40:26 -0700 In-Reply-To: <209705133.1285234.1629477520318@privateemail.com> References: <20210820043339.2151352-1-jordy@pwning.systems> <0874a50b61cfaf7c817cab7344c49c1641c1fd10.camel@HansenPartnership.com> <202108200904.81ED4AA52@keescook> <209705133.1285234.1629477520318@privateemail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-08-20 at 12:38 -0400, Jordy Zomer wrote: > Hi There! > > Because this is a global variable, it appears to be exploitable. > Either we generate a sufficient number of processes to achieve this > counter, or you increase the open file limit with ulimit or sysctl. > Unless the kernel has a hard restriction on the number of potential > file descriptors that I'm not aware of. There's no direct global counter for file descriptors, no; however, there is an indirect limit: the number of processes per user which is now defaulting to around 65535, so even a fork bomb opening the max number of fds won't get you a wrap. > In any case, it's probably a good idea to patch this to make it > explicitly secure. If you discover a hard-limit in the kernel for > open file descriptors, please let me know. I'm genuinely interested > :D! I didn't disagree it might be a useful think to update ... I just didn't think it was currently exploitable. James