lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <24840570-913e-1603-eb92-baefd4758784@igalia.com>
Date: Fri, 23 May 2025 01:16:31 +0530
From: Bhupesh Sharma <bhsharma@...lia.com>
To: kernel test robot <lkp@...el.com>, Bhupesh <bhupesh@...lia.com>,
 akpm@...ux-foundation.org
Cc: oe-kbuild-all@...ts.linux.dev, kernel-dev@...lia.com,
 linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
 linux-perf-users@...r.kernel.org, linux-fsdevel@...r.kernel.org,
 linux-mm@...ck.org, oliver.sang@...el.com, laoar.shao@...il.com,
 pmladek@...e.com, rostedt@...dmis.org, mathieu.desnoyers@...icios.com,
 arnaldo.melo@...il.com, alexei.starovoitov@...il.com,
 andrii.nakryiko@...il.com, mirq-linux@...e.qmqm.pl, peterz@...radead.org,
 willy@...radead.org, david@...hat.com, viro@...iv.linux.org.uk,
 keescook@...omium.org, ebiederm@...ssion.com, brauner@...nel.org,
 jack@...e.cz, mingo@...hat.com, juri.lelli@...hat.com, bsegall@...gle.com,
 mgorman@...e.de
Subject: Re: [PATCH v4 2/3] treewide: Switch memcpy() users of 'task->comm' to
 a more safer implementation

Hi,

On 5/22/25 1:32 AM, kernel test robot wrote:
> Hi Bhupesh,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on trace/for-next]
> [also build test WARNING on tip/sched/core akpm-mm/mm-everything linus/master v6.15-rc7 next-20250521]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Bhupesh/exec-Remove-obsolete-comments/20250521-142443
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace for-next
> patch link:    https://lore.kernel.org/r/20250521062337.53262-3-bhupesh%40igalia.com
> patch subject: [PATCH v4 2/3] treewide: Switch memcpy() users of 'task->comm' to a more safer implementation
> config: arc-randconfig-002-20250522 (https://download.01.org/0day-ci/archive/20250522/202505220326.5yDQHjnt-lkp@intel.com/config)
> compiler: arc-linux-gcc (GCC) 8.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250522/202505220326.5yDQHjnt-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202505220326.5yDQHjnt-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
>     In file included from fs/coredump.c:20:
>     fs/coredump.c: In function 'do_coredump':
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:655:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure(
>         ^~~~~~~~~~~~~~~~~~~~~~~
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:730:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure("Core dump to %s aborted: "
>         ^~~~~~~~~~~~~~~~~~~~~~~
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:725:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure("Core dump to %s aborted: "
>         ^~~~~~~~~~~~~~~~~~~~~~~
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:618:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure("over core_pipe_limit, skipping core dump");
>         ^~~~~~~~~~~~~~~~~~~~~~~
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:642:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure("|%s pipe failed", cn.corename);
>         ^~~~~~~~~~~~~~~~~~~~~~~
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:625:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure("%s failed to allocate memory", __func__);
>         ^~~~~~~~~~~~~~~~~~~~~~~
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:611:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure("RLIMIT_CORE is set to 1, aborting core");
>         ^~~~~~~~~~~~~~~~~~~~~~~
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:591:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure("format_corename failed, aborting core");
>         ^~~~~~~~~~~~~~~~~~~~~~~
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:752:4: note: in expansion of macro 'coredump_report_failure'
>         coredump_report_failure("Core dump to |%s disabled", cn.corename);
>         ^~~~~~~~~~~~~~~~~~~~~~~
>     fs/coredump.c: In function 'validate_coredump_safety':
>>> include/linux/coredump.h:57:7: warning: array subscript 16 is above array bounds of 'char[16]' [-Warray-bounds]
>        comm[TASK_COMM_LEN] = '\0'; \
>        ~~~~^~~~~~~~~~~~~~~
>     include/linux/coredump.h:63:43: note: in expansion of macro '__COREDUMP_PRINTK'
>      #define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)
>                                                ^~~~~~~~~~~~~~~~~
>     fs/coredump.c:1006:3: note: in expansion of macro 'coredump_report_failure'
>        coredump_report_failure("Unsafe core_pattern used with fs.suid_dumpable=2: "
>        ^~~~~~~~~~~~~~~~~~~~~~~
>
>
> vim +57 include/linux/coredump.h
>
>      46	
>      47	/*
>      48	 * Logging for the coredump code, ratelimited.
>      49	 * The TGID and comm fields are added to the message.
>      50	 */
>      51	
>      52	#define __COREDUMP_PRINTK(Level, Format, ...) \
>      53		do {	\
>      54			char comm[TASK_COMM_LEN];	\
>      55			/* This will always be NUL terminated. */ \
>      56			memcpy(comm, current->comm, TASK_COMM_LEN); \
>    > 57			comm[TASK_COMM_LEN] = '\0'; \
>      58			printk_ratelimited(Level "coredump: %d(%*pE): " Format "\n",	\
>      59				task_tgid_vnr(current), (int)strlen(comm), comm, ##__VA_ARGS__);	\
>      60		} while (0)	\
>      61	
>

Thanks, I will fix these in v5.

Regards,
Bhupesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ