Message ID | 87mtgh17li.fsf_-_@email.froward.int.ebiederm.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | binfmt_flat; Drop vestigates of coredump support | expand |
On Tue, Apr 19, 2022 at 09:16:41AM -0500, Eric W. Biederman wrote: > > There is the briefest start of coredump support in binfmt_flat. It is > actually a pain to maintain as binfmt_flat is not built on most > architectures so it is easy to overlook. > > Since the support does not do anything remove it. > > Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> > --- > > Apologies for hijacking this thread but it looks like we have people who > are actively using binfmt_flat on it. > > Does anyone have any objections to simply removing what little there > is of coredump support from binfmt_flat? > > Eric > > fs/binfmt_flat.c | 22 ---------------------- > 1 file changed, 22 deletions(-) > > diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c > index 626898150011..0ad2c7bbaddd 100644 > --- a/fs/binfmt_flat.c > +++ b/fs/binfmt_flat.c > @@ -37,7 +37,6 @@ > #include <linux/flat.h> > #include <linux/uaccess.h> > #include <linux/vmalloc.h> > -#include <linux/coredump.h> > > #include <asm/byteorder.h> > #include <asm/unaligned.h> > @@ -98,33 +97,12 @@ static int load_flat_shared_library(int id, struct lib_info *p); > #endif > > static int load_flat_binary(struct linux_binprm *); > -#ifdef CONFIG_COREDUMP > -static int flat_core_dump(struct coredump_params *cprm); > -#endif > > static struct linux_binfmt flat_format = { > .module = THIS_MODULE, > .load_binary = load_flat_binary, > -#ifdef CONFIG_COREDUMP > - .core_dump = flat_core_dump, > - .min_coredump = PAGE_SIZE > -#endif > }; > > -/****************************************************************************/ > -/* > - * Routine writes a core dump image in the current directory. > - * Currently only a stub-function. > - */ > - > -#ifdef CONFIG_COREDUMP > -static int flat_core_dump(struct coredump_params *cprm) > -{ > - pr_warn("Process %s:%d received signr %d and should have core dumped\n", > - current->comm, current->pid, cprm->siginfo->si_signo); > - return 1; > -} > -#endif Since this only prints a warning that the process "should have core dumped", I agree, I don't really see the point of keeping this code. nit: $subject: "binfmt_flat; Drop vestigates of coredump support" s/;/:/ Other than that: Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
On Tue, 19 Apr 2022 09:16:41 -0500, Eric W. Biederman wrote: > There is the briefest start of coredump support in binfmt_flat. It is > actually a pain to maintain as binfmt_flat is not built on most > architectures so it is easy to overlook. > > Since the support does not do anything remove it. > > > [...] Applied to for-next/execve, thanks! (With typo nits fixed.) [1/1] binfmt_flat; Drop vestigates of coredump support https://git.kernel.org/kees/c/6e1a873cefd1
On 20/4/22 00:16, Eric W. Biederman wrote: > There is the briefest start of coredump support in binfmt_flat. It is > actually a pain to maintain as binfmt_flat is not built on most > architectures so it is easy to overlook. > > Since the support does not do anything remove it. > > Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> > --- > > Apologies for hijacking this thread but it looks like we have people who > are actively using binfmt_flat on it. > > Does anyone have any objections to simply removing what little there > is of coredump support from binfmt_flat? No objections from me. Acked-by: Greg Ungerer <gerg@linux-m68k.org> > Eric > > fs/binfmt_flat.c | 22 ---------------------- > 1 file changed, 22 deletions(-) > > diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c > index 626898150011..0ad2c7bbaddd 100644 > --- a/fs/binfmt_flat.c > +++ b/fs/binfmt_flat.c > @@ -37,7 +37,6 @@ > #include <linux/flat.h> > #include <linux/uaccess.h> > #include <linux/vmalloc.h> > -#include <linux/coredump.h> > > #include <asm/byteorder.h> > #include <asm/unaligned.h> > @@ -98,33 +97,12 @@ static int load_flat_shared_library(int id, struct lib_info *p); > #endif > > static int load_flat_binary(struct linux_binprm *); > -#ifdef CONFIG_COREDUMP > -static int flat_core_dump(struct coredump_params *cprm); > -#endif > > static struct linux_binfmt flat_format = { > .module = THIS_MODULE, > .load_binary = load_flat_binary, > -#ifdef CONFIG_COREDUMP > - .core_dump = flat_core_dump, > - .min_coredump = PAGE_SIZE > -#endif > }; > > -/****************************************************************************/ > -/* > - * Routine writes a core dump image in the current directory. > - * Currently only a stub-function. > - */ > - > -#ifdef CONFIG_COREDUMP > -static int flat_core_dump(struct coredump_params *cprm) > -{ > - pr_warn("Process %s:%d received signr %d and should have core dumped\n", > - current->comm, current->pid, cprm->siginfo->si_signo); > - return 1; > -} > -#endif > > /****************************************************************************/ > /*
Kees Cook <keescook@chromium.org> writes: > On Tue, 19 Apr 2022 09:16:41 -0500, Eric W. Biederman wrote: >> There is the briefest start of coredump support in binfmt_flat. It is >> actually a pain to maintain as binfmt_flat is not built on most >> architectures so it is easy to overlook. >> >> Since the support does not do anything remove it. >> >> >> [...] > > Applied to for-next/execve, thanks! (With typo nits fixed.) > > [1/1] binfmt_flat; Drop vestigates of coredump support > https://git.kernel.org/kees/c/6e1a873cefd1 Thanks, Eric
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 626898150011..0ad2c7bbaddd 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c @@ -37,7 +37,6 @@ #include <linux/flat.h> #include <linux/uaccess.h> #include <linux/vmalloc.h> -#include <linux/coredump.h> #include <asm/byteorder.h> #include <asm/unaligned.h> @@ -98,33 +97,12 @@ static int load_flat_shared_library(int id, struct lib_info *p); #endif static int load_flat_binary(struct linux_binprm *); -#ifdef CONFIG_COREDUMP -static int flat_core_dump(struct coredump_params *cprm); -#endif static struct linux_binfmt flat_format = { .module = THIS_MODULE, .load_binary = load_flat_binary, -#ifdef CONFIG_COREDUMP - .core_dump = flat_core_dump, - .min_coredump = PAGE_SIZE -#endif }; -/****************************************************************************/ -/* - * Routine writes a core dump image in the current directory. - * Currently only a stub-function. - */ - -#ifdef CONFIG_COREDUMP -static int flat_core_dump(struct coredump_params *cprm) -{ - pr_warn("Process %s:%d received signr %d and should have core dumped\n", - current->comm, current->pid, cprm->siginfo->si_signo); - return 1; -} -#endif /****************************************************************************/ /*
There is the briefest start of coredump support in binfmt_flat. It is actually a pain to maintain as binfmt_flat is not built on most architectures so it is easy to overlook. Since the support does not do anything remove it. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> --- Apologies for hijacking this thread but it looks like we have people who are actively using binfmt_flat on it. Does anyone have any objections to simply removing what little there is of coredump support from binfmt_flat? Eric fs/binfmt_flat.c | 22 ---------------------- 1 file changed, 22 deletions(-)