All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Doug Anderson <dianders@chromium.org>
Cc: kernel test robot <lkp@intel.com>, oe-kbuild-all@lists.linux.dev
Subject: Re: [kees:for-next/hardening 2/2] drivers/misc/lkdtm/bugs.c:302:1: warning: 'noreturn' function does return
Date: Fri, 26 Jan 2024 10:32:32 -0800	[thread overview]
Message-ID: <202401261032.562F4D7@keescook> (raw)
In-Reply-To: <CAD=FV=Uc8dPrc++jC=toV+7Tg1VtpFMxBfmTKmg9TEzif1z1CQ@mail.gmail.com>

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

      reply	other threads:[~2024-01-26 18:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202401261032.562F4D7@keescook \
    --to=keescook@chromium.org \
    --cc=dianders@chromium.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.