All of lore.kernel.org
 help / color / mirror / Atom feed
* [kees:for-next/hardening 2/2] drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return
@ 2024-01-26 14:55 kernel test robot
  2024-01-26 15:58 ` Doug Anderson
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2024-01-26 14:55 UTC (permalink / raw)
  To: Douglas Anderson; +Cc: oe-kbuild-all, Kees Cook

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
head:   edb6538da3df83806fffcfc1b873d0895c81b9e8
commit: edb6538da3df83806fffcfc1b873d0895c81b9e8 [2/2] lkdtm/bugs: Adjust lkdtm_HUNG_TASK() to avoid tail call optimization
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20240126/202401262204.wUFKRYZF-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401262204.wUFKRYZF-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401262204.wUFKRYZF-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   arch/mips/kernel/head.o: in function `__kernel_entry':
>> (.text+0x0): relocation truncated to fit: R_MIPS_26 against `kernel_entry'
   arch/mips/kernel/head.o: in function `smp_bootstrap':
>> (.ref.text+0xd8): relocation truncated to fit: R_MIPS_26 against `start_secondary'
   init/main.o: in function `set_reset_devices':
   main.c:(.init.text+0x10): relocation truncated to fit: R_MIPS_26 against `_mcount'
   main.c:(.init.text+0x18): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
   init/main.o: in function `debug_kernel':
   main.c:(.init.text+0x50): relocation truncated to fit: R_MIPS_26 against `_mcount'
   main.c:(.init.text+0x58): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
   init/main.o: in function `quiet_kernel':
   main.c:(.init.text+0x90): relocation truncated to fit: R_MIPS_26 against `_mcount'
   main.c:(.init.text+0x98): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
   init/main.o: in function `warn_bootconfig':
   main.c:(.init.text+0xd0): relocation truncated to fit: R_MIPS_26 against `_mcount'
   main.c:(.init.text+0xd8): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
   init/main.o: in function `init_setup':
   main.c:(.init.text+0x108): additional relocation overflows omitted from the output
--
   drivers/misc/lkdtm/bugs.c: In function 'lkdtm_HUNG_TASK':
>> drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return
     302 | }
         | ^


vim +/noreturn +302 drivers/misc/lkdtm/bugs.c

00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  296  
edb6538da3df83 drivers/misc/lkdtm/bugs.c Douglas Anderson 2024-01-22  297  static void __noreturn lkdtm_HUNG_TASK(void)
00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  298  {
00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  299  	set_current_state(TASK_UNINTERRUPTIBLE);
00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  300  	schedule();
edb6538da3df83 drivers/misc/lkdtm/bugs.c Douglas Anderson 2024-01-22  301  	BUG_ON(1);
00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26 @302  }
00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  303  

:::::: The code at line 302 was first introduced by commit
:::::: 00f496c416122e7f5a572a4511cf87c7240ba761 lkdtm: split remaining logic bug tests to separate file

:::::: TO: Kees Cook <keescook@chromium.org>
:::::: CC: Kees Cook <keescook@chromium.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [kees:for-next/hardening 2/2] drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return
  2024-01-26 14:55 [kees:for-next/hardening 2/2] drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return kernel test robot
@ 2024-01-26 15:58 ` Doug Anderson
  2024-01-26 18:32   ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Anderson @ 2024-01-26 15:58 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-kbuild-all, Kees Cook

Hi,

On Fri, Jan 26, 2024 at 6:56 AM kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
> head:   edb6538da3df83806fffcfc1b873d0895c81b9e8
> commit: edb6538da3df83806fffcfc1b873d0895c81b9e8 [2/2] lkdtm/bugs: Adjust lkdtm_HUNG_TASK() to avoid tail call optimization
> config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20240126/202401262204.wUFKRYZF-lkp@intel.com/config)
> compiler: mips-linux-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401262204.wUFKRYZF-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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202401262204.wUFKRYZF-lkp@intel.com/
>
> All error/warnings (new ones prefixed by >>):
>
>    arch/mips/kernel/head.o: in function `__kernel_entry':
> >> (.text+0x0): relocation truncated to fit: R_MIPS_26 against `kernel_entry'
>    arch/mips/kernel/head.o: in function `smp_bootstrap':
> >> (.ref.text+0xd8): relocation truncated to fit: R_MIPS_26 against `start_secondary'
>    init/main.o: in function `set_reset_devices':
>    main.c:(.init.text+0x10): relocation truncated to fit: R_MIPS_26 against `_mcount'
>    main.c:(.init.text+0x18): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
>    init/main.o: in function `debug_kernel':
>    main.c:(.init.text+0x50): relocation truncated to fit: R_MIPS_26 against `_mcount'
>    main.c:(.init.text+0x58): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
>    init/main.o: in function `quiet_kernel':
>    main.c:(.init.text+0x90): relocation truncated to fit: R_MIPS_26 against `_mcount'
>    main.c:(.init.text+0x98): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
>    init/main.o: in function `warn_bootconfig':
>    main.c:(.init.text+0xd0): relocation truncated to fit: R_MIPS_26 against `_mcount'
>    main.c:(.init.text+0xd8): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
>    init/main.o: in function `init_setup':
>    main.c:(.init.text+0x108): additional relocation overflows omitted from the output
> --
>    drivers/misc/lkdtm/bugs.c: In function 'lkdtm_HUNG_TASK':
> >> drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return
>      302 | }
>          | ^
>
>
> vim +/noreturn +302 drivers/misc/lkdtm/bugs.c
>
> 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  296
> edb6538da3df83 drivers/misc/lkdtm/bugs.c Douglas Anderson 2024-01-22  297  static void __noreturn lkdtm_HUNG_TASK(void)
> 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  298  {
> 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  299       set_current_state(TASK_UNINTERRUPTIBLE);
> 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  300       schedule();
> edb6538da3df83 drivers/misc/lkdtm/bugs.c Douglas Anderson 2024-01-22  301       BUG_ON(1);
> 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26 @302  }

Ah, I see the problem. MIPS has its own BUG_ON that's an inline
function instead of a macro and that means that the compiler can't
figure out that my constant condition will always call BUG(). ...this
should just be changed to BUG().

Patch fixing this at:

https://lore.kernel.org/r/20240126072852.1.Ib065e528a8620474a72f15baa2feead1f3d89865@changeid

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [kees:for-next/hardening 2/2] drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return
  2024-01-26 15:58 ` Doug Anderson
@ 2024-01-26 18:32   ` Kees Cook
  0 siblings, 0 replies; 3+ messages in thread
From: Kees Cook @ 2024-01-26 18:32 UTC (permalink / raw)
  To: Doug Anderson; +Cc: kernel test robot, oe-kbuild-all

On Fri, Jan 26, 2024 at 07:58:46AM -0800, Doug Anderson wrote:
> Hi,
> 
> On Fri, Jan 26, 2024 at 6:56 AM kernel test robot <lkp@intel.com> wrote:
> >
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
> > head:   edb6538da3df83806fffcfc1b873d0895c81b9e8
> > commit: edb6538da3df83806fffcfc1b873d0895c81b9e8 [2/2] lkdtm/bugs: Adjust lkdtm_HUNG_TASK() to avoid tail call optimization
> > config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20240126/202401262204.wUFKRYZF-lkp@intel.com/config)
> > compiler: mips-linux-gcc (GCC) 13.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401262204.wUFKRYZF-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@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202401262204.wUFKRYZF-lkp@intel.com/
> >
> > All error/warnings (new ones prefixed by >>):
> >
> >    arch/mips/kernel/head.o: in function `__kernel_entry':
> > >> (.text+0x0): relocation truncated to fit: R_MIPS_26 against `kernel_entry'
> >    arch/mips/kernel/head.o: in function `smp_bootstrap':
> > >> (.ref.text+0xd8): relocation truncated to fit: R_MIPS_26 against `start_secondary'
> >    init/main.o: in function `set_reset_devices':
> >    main.c:(.init.text+0x10): relocation truncated to fit: R_MIPS_26 against `_mcount'
> >    main.c:(.init.text+0x18): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
> >    init/main.o: in function `debug_kernel':
> >    main.c:(.init.text+0x50): relocation truncated to fit: R_MIPS_26 against `_mcount'
> >    main.c:(.init.text+0x58): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
> >    init/main.o: in function `quiet_kernel':
> >    main.c:(.init.text+0x90): relocation truncated to fit: R_MIPS_26 against `_mcount'
> >    main.c:(.init.text+0x98): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
> >    init/main.o: in function `warn_bootconfig':
> >    main.c:(.init.text+0xd0): relocation truncated to fit: R_MIPS_26 against `_mcount'
> >    main.c:(.init.text+0xd8): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
> >    init/main.o: in function `init_setup':
> >    main.c:(.init.text+0x108): additional relocation overflows omitted from the output
> > --
> >    drivers/misc/lkdtm/bugs.c: In function 'lkdtm_HUNG_TASK':
> > >> drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return
> >      302 | }
> >          | ^
> >
> >
> > vim +/noreturn +302 drivers/misc/lkdtm/bugs.c
> >
> > 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  296
> > edb6538da3df83 drivers/misc/lkdtm/bugs.c Douglas Anderson 2024-01-22  297  static void __noreturn lkdtm_HUNG_TASK(void)
> > 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  298  {
> > 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  299       set_current_state(TASK_UNINTERRUPTIBLE);
> > 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26  300       schedule();
> > edb6538da3df83 drivers/misc/lkdtm/bugs.c Douglas Anderson 2024-01-22  301       BUG_ON(1);
> > 00f496c416122e drivers/misc/lkdtm_bugs.c Kees Cook        2016-06-26 @302  }
> 
> Ah, I see the problem. MIPS has its own BUG_ON that's an inline
> function instead of a macro and that means that the compiler can't
> figure out that my constant condition will always call BUG(). ...this
> should just be changed to BUG().
> 
> Patch fixing this at:
> 
> https://lore.kernel.org/r/20240126072852.1.Ib065e528a8620474a72f15baa2feead1f3d89865@changeid

Thanks for tracking this down! :)

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-26 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-26 14:55 [kees:for-next/hardening 2/2] drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return kernel test robot
2024-01-26 15:58 ` Doug Anderson
2024-01-26 18:32   ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.