Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp902510pxb; Tue, 1 Feb 2022 12:48:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+053YmyAiywepTyVNgD1zT4Z9NQul3N3CQWo6LBjNVSDXXasAmPDaQZi5bee9oPrwIjBJ X-Received: by 2002:a17:902:9698:: with SMTP id n24mr28016729plp.60.1643748530909; Tue, 01 Feb 2022 12:48:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748530; cv=none; d=google.com; s=arc-20160816; b=y9sHiHpuGOhCFmVkcV4nMfHOgKaZljGOwBzqq9p5UM3fu+3+5rMFnmdvsvUl1R31Eb kA3dlw0CaTN/w3vuyz96mSY1lVCvMwVZ1pWjxhd3PsPyHq01CkzAlTxGQ1CPB41ekqJP 2aF5n4V9ngSt3C4/H8qqzz2A6txFUG6nGG7zdcbJLPAPc/ImaSq4A4DZzwOuIIeCV+dq wyzT2SggFw3PnlRktiq69f7iprxNykfAV8lhB1olddc/5+8Zsc3SeRJYhb7KWv09hloj IhcQT/Z6sBN6JpLl55fXyFMNaHB3wDws66UH2EYZzRzXocbKwpV26GfDp57I5dKb1eQd h6ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=kHae93AfveN90uTFwSNO4em3kO2ErznJczL7uGoUSOU=; b=FBPcB4GrXucdl/9Lbvg6RFeL6bYivoKM7v4b7LnWbc9v13YgSiQ6yrdLIgULJbVC8U 04zgiYQBpY096LZhglydJPGdnH7JNYp3LcbujA/YjMl8Z5hzbqvd/dlxt19VTgE+S8WG mHANRAsDbi27K7YuMwTeUK7P40fI1Cmaze3wYIK4MX5vTFm+5PlrYKFFcfCaJeix/y3k RDvapng0tDahGfxxVc8IR6OL1RXp0GlI8nqGy4z6/Yl5ZTpXF5NiGkyMgD/fTqun5kWg 5J2ipMGkaVFigHA3f5mRhL2bDa2wfO3UYM+Ko+2wdFmIXsFpENRAOjhGvHv2ndzMy3rD IYIQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w31si19002133pgk.389.2022.02.01.12.48.39; Tue, 01 Feb 2022 12:48:50 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357703AbiAaSqS (ORCPT + 99 others); Mon, 31 Jan 2022 13:46:18 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:53042 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357564AbiAaSqK (ORCPT ); Mon, 31 Jan 2022 13:46:10 -0500 Received: from in01.mta.xmission.com ([166.70.13.51]:49910) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nEbgm-006c8W-Tf; Mon, 31 Jan 2022 11:46:09 -0700 Received: from ip68-110-24-146.om.om.cox.net ([68.110.24.146]:56344 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nEbgl-00ExTQ-Ud; Mon, 31 Jan 2022 11:46:08 -0700 From: "Eric W. Biederman" To: Jann Horn Cc: Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Viro , Denys Vlasenko , Kees Cook , Vlastimil Babka , "Liam R . Howlett" References: <20220131153740.2396974-1-willy@infradead.org> <871r0nriy4.fsf@email.froward.int.ebiederm.org> <877dafq3bw.fsf@email.froward.int.ebiederm.org> <87bkzroica.fsf_-_@email.froward.int.ebiederm.org> Date: Mon, 31 Jan 2022 12:46:01 -0600 In-Reply-To: <87bkzroica.fsf_-_@email.froward.int.ebiederm.org> (Eric W. Biederman's message of "Mon, 31 Jan 2022 12:44:53 -0600") Message-ID: <875ypzoiae.fsf_-_@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1nEbgl-00ExTQ-Ud;;;mid=<875ypzoiae.fsf_-_@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.110.24.146;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18jQRBv9iObiu0wrlEsJHbWC0XiQ+TmAOA= X-SA-Exim-Connect-IP: 68.110.24.146 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa06.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_SCC_BODY_TEXT_LINE,T_TooManySym_01, T_TooManySym_02,XMNoVowels,XMSubLong autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4994] * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject * -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Jann Horn X-Spam-Relay-Country: X-Spam-Timing: total 416 ms - load_scoreonly_sql: 0.08 (0.0%), signal_user_changed: 12 (2.8%), b_tie_ro: 10 (2.4%), parse: 1.77 (0.4%), extract_message_metadata: 20 (4.8%), get_uri_detail_list: 2.3 (0.6%), tests_pri_-1000: 22 (5.3%), tests_pri_-950: 2.2 (0.5%), tests_pri_-900: 1.79 (0.4%), tests_pri_-90: 75 (18.0%), check_bayes: 73 (17.6%), b_tokenize: 12 (2.8%), b_tok_get_all: 7 (1.7%), b_comp_prob: 3.0 (0.7%), b_tok_touch_all: 47 (11.4%), b_finish: 1.07 (0.3%), tests_pri_0: 261 (62.8%), check_dkim_signature: 0.61 (0.1%), check_dkim_adsp: 3.0 (0.7%), poll_dns_idle: 1.09 (0.3%), tests_pri_10: 2.5 (0.6%), tests_pri_500: 12 (2.8%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 1/5] coredump: Move definition of struct coredump_params into coredump.h X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the definition of struct coredump_params into coredump.h where it belongs. Remove the slightly errorneous comment explaining why struct coredump_params was declared in binfmts.h. Signed-off-by: "Eric W. Biederman" --- include/linux/binfmts.h | 13 +------------ include/linux/coredump.h | 12 +++++++++++- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 049cf9421d83..05a91f5499ba 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -8,6 +8,7 @@ #include struct filename; +struct coredump_params; #define CORENAME_MAX_SIZE 128 @@ -77,18 +78,6 @@ struct linux_binprm { #define BINPRM_FLAGS_PRESERVE_ARGV0_BIT 3 #define BINPRM_FLAGS_PRESERVE_ARGV0 (1 << BINPRM_FLAGS_PRESERVE_ARGV0_BIT) -/* Function parameter for binfmt->coredump */ -struct coredump_params { - const kernel_siginfo_t *siginfo; - struct pt_regs *regs; - struct file *file; - unsigned long limit; - unsigned long mm_flags; - loff_t written; - loff_t pos; - loff_t to_skip; -}; - /* * This structure defines the functions that are used to load the binary formats that * linux accepts. diff --git a/include/linux/coredump.h b/include/linux/coredump.h index 248a68c668b4..2ee1460a1d66 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h @@ -14,11 +14,21 @@ struct core_vma_metadata { unsigned long dump_size; }; +struct coredump_params { + const kernel_siginfo_t *siginfo; + struct pt_regs *regs; + struct file *file; + unsigned long limit; + unsigned long mm_flags; + loff_t written; + loff_t pos; + loff_t to_skip; +}; + /* * These are the only things you should do on a core-file: use only these * functions to write out all the necessary info. */ -struct coredump_params; extern void dump_skip_to(struct coredump_params *cprm, unsigned long to); extern void dump_skip(struct coredump_params *cprm, size_t nr); extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr); -- 2.29.2