Skip to content

coredump: format_corename() fixes/cleanups

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6coredump: format_corename() can leak cn->corenamefs/coredump.c+7 -110 replies
2/6coredump: introduce cn_vprintf()fs/coredump.c+13 -70 replies
3/6coredump: cn_vprintf() has no reason to call vsnprintf() twicefs/coredump.c+12 -180 replies
4/6coredump: kill cn_escape(), introduce cn_esc_printf()fs/coredump.c+21 -231 reply
5/6coredump: kill call_count, add core_name_sizefs/coredump.c+10 -92 replies
6/6coredump: '% at the end' shouldn't bypass core_uses_pid logicfs/coredump.c+6 -50 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNeil HormanLucas De Marchi
SeriesA-b A-b
1/6
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] coredump: format_corename() fixes/cleanups

Hello.

Quoted 9 lines · Oleg Nesterov

With the patch below we can trivially fix the problem,

+ char *fmt = ispipe ? "\e%s\e" : "%s";
...
- err = cn_printf(cn, "%s", current->comm);
+ err = cn_printf(cn, fmt, current->comm);

Or this ESC hack is too ugly or can break something?

OK, nobody really nacked "[PATCH] teach argv_split() to ignore the spaces surrounded by \e", see http://marc.info/?l=linux-kernel&m=136845597401674

I am going to send this patch "officially" and fix format_corename/argv_split interaction.

But lets fix other format_corename() bugs first: leak and use-after-free. Plus some cleanups.

Oleg.

 fs/coredump.c |  120 +++++++++++++++++++++++++++-----------------------------
 1 files changed, 58 insertions(+), 62 deletions(-)