Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1547088lqm; Thu, 2 May 2024 20:44:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXstgRXbvxgMG7VsD2OfWGrvB9AweHS4pews3ypxqUiM1ic8aPf32jcLDXdEHmZoN6Bxnf+J808Z5204quxj7qyzaIxtbo28XFBitQjGg== X-Google-Smtp-Source: AGHT+IFvIZZnPYRdp0AQBpFuR+tsYjuPIf8mL2bCWO4XM8pJC4R/Xog8g1f56+Mzj8+4A+eSXU8Q X-Received: by 2002:a9d:7685:0:b0:6eb:d349:8c3f with SMTP id j5-20020a9d7685000000b006ebd3498c3fmr1813974otl.28.1714707868466; Thu, 02 May 2024 20:44:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714707868; cv=pass; d=google.com; s=arc-20160816; b=vpN+nlY9BgKdXe83y6fJ3ChN6lT9RdqTSJDKIBUlUKdR0zmSIU8N3gQWNnysT+h21h 1csMXwVmWaCEtOaA76L1NTtm8gvbSVVge3rqt1TrqEQej0FM5UWpNxUP47gapbbgOqN0 0S4Zt5nYPQo26epQPme+3mHRHtfDYYd9hpLpwOrlGvLUBlx1TSJoN916Yf+N6d1OGlaK OSqCdNAm3FFp4cQY1qHhkC3auAuFAVjqLW+lakzCAKYR3JFAUyFatv0kOxtHbZSLhtSR PHHcscpaCH8SZ7r2iAyEvqXndEnkbt7I7FHlfU/fmM+1ADSv1SuXl2q5wJEpLIjV6C6h Vt9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=tlFW8nHNMe/kIplt0cgGnakBNynrklQOcrWEc7IQ7x4=; fh=34/d//wLu1MfsG8lKlexoVvXxcC7A+EXyUO0Iz8izJg=; b=KyQWlFyKuKdbYkBEBw6tBAkyrElk8+YP1QXP/gYfTWL1Kv0HuIbCB6lXltbYVd89Oj gF9BLUdSbH5NMZCdM2QT7rZzUMBdnOCFQ/5kusewW0AaVNnRiE8Fo2r8SabV/aX1rPcu 0Qu0d8pY3QYuuxkUznh743fhepPyp/kU9vNQLsw5K2aQqnAKXKOw32j98WfxS+MWifVS G/uOjTuy17UxYt7bmwaqdDBA2Rp3n4R1/DzYuNdLX33/9nLXc/zCk9VyHMTsfMcM+Ca3 VGyNca0LlifvqM0WHuj8DNADqZeo+HW2pilrRQUQbtLC7TSdO3VZP3GGJqnUHaOfzuLD Azww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=kMWDdPq6; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-166946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s20-20020a056a00179400b006f38515d199si2232728pfg.202.2024.05.02.20.44.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 20:44:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=kMWDdPq6; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-166946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C2332287429 for ; Thu, 2 May 2024 21:36:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1621C1C0DC0; Thu, 2 May 2024 21:35:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="kMWDdPq6" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BDC91BED6F; Thu, 2 May 2024 21:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714685720; cv=none; b=ag34cZBiN5rrRzOlmGN1srFSPoFVIFBu9lFGvx8JR1FeH3tQXyOTKVy0Cxf3MXdEOZWwJIJsAQ9SSb29OMSfaJ43jolQ3xhzp3PiszXmPjNu18hA/5Pv+lLW8Dtept+73XIaKJzmXuFhrVNCMvIAJE/1T9vwDG8QSqfbBFBjc1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714685720; c=relaxed/simple; bh=dGVoI4d4tynFDPGLs6MfTg5m6n3+0kLY1UaKnKdA55k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WLiY2PaJK2t49eht7pOXyWw+APGIriJXTj5psje/+pZiSZaw1evOhjgzGYSidp4BYm39PvTuBnhhdmHckBOQ1K3X2vmxdLFeXHFDXFhkf37xyKbFdWqu1K81pReEMf7zPj/v3LCgGficPspnDLRmRvrTgkuw+08rkW95r8uLrvU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=kMWDdPq6; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tlFW8nHNMe/kIplt0cgGnakBNynrklQOcrWEc7IQ7x4=; b=kMWDdPq6vs1CUwS+IRPUbgpLoA IC8dWLw6FaCljPdIJWTkh4MImGo5Ty2XG0jnQ8eMOHqj4i6byL8Sstn/I4JOXliEjY5jvCvoKaXl5 3HNrPT8//2gKQfyGPO+EdzOS84mlIe4MG55TupkdB6W/+SMQsanlE73aXBjYgUvUyd6BkYHL91/PC 3M4qdcaMnIyXnnb1dGoniT1IqGRPS3wXcU353S1r/zt8TQAKllsLUF25JhzlqPgToXZl+ifv9vhfn IMfo4YL3OH/6ADo5OwtaFfxrA0OzfbMUc5ufFQ+yul6Cvb1v5xzR0CiEPQC4UOXdXQKpsEZhZfqOc fBEUzOmg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2e5C-0000000DzCy-2lmy; Thu, 02 May 2024 21:35:14 +0000 Date: Thu, 2 May 2024 14:35:14 -0700 From: Luis Chamberlain To: Allen Cc: Kees Cook , Allen Pais , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, ebiederm@xmission.com, j.granados@samsung.com Subject: Re: [PATCH v2] fs/coredump: Enable dynamic configuration of max file note size Message-ID: References: <20240502145920.5011-1-apais@linux.microsoft.com> <202405021045.360F5313EA@keescook> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain On Thu, May 02, 2024 at 01:03:52PM -0700, Allen wrote: > +int proc_core_file_note_size_max(struct ctl_table *table, int write, > void __user *buffer, size_t *lenp, loff_t *ppos) { > + int error = proc_douintvec(table, write, buffer, lenp, ppos); > + if (write && (core_file_note_size_max < MAX_FILE_NOTE_SIZE || > core_file_note_size_max > MAX_ALLOWED_NOTE_SIZE)) > + core_file_note_size_max = MAX_FILE_NOTE_SIZE; // Revert to > default if out of bounds > + return error; > +} There's already a proc helper which let's you set min / max. Luis