Netdev List
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: isdn@linux-pingi.de, netdev@vger.kernel.org,
	samitolvanen@google.com, llvm@lists.linux.dev,
	patches@lists.linux.dev,
	kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH] mISDN: Update parameter type of dsp_cmx_send()
Date: Thu, 3 Aug 2023 11:57:18 -0700	[thread overview]
Message-ID: <20230803185718.GA2864317@dev-arch.thelio-3990X> (raw)
In-Reply-To: <202308021255.9A6328D@keescook>

On Wed, Aug 02, 2023 at 12:59:12PM -0700, Kees Cook wrote:
> On Wed, Aug 02, 2023 at 10:40:29AM -0700, Nathan Chancellor wrote:
> > When booting a kernel with CONFIG_MISDN_DSP=y and CONFIG_CFI_CLANG=y,
> > there is a failure when dsp_cmx_send() is called indirectly from
> > call_timer_fn():
> > 
> >   [    0.371412] CFI failure at call_timer_fn+0x2f/0x150 (target: dsp_cmx_send+0x0/0x530; expected type: 0x92ada1e9)
> > 
> > The function pointer prototype that call_timer_fn() expects is
> > 
> >   void (*fn)(struct timer_list *)
> > 
> > whereas dsp_cmx_send() has a parameter type of 'void *', which causes
> > the control flow integrity checks to fail because the parameter types do
> > not match.
> > 
> > Change dsp_cmx_send()'s parameter type to be 'struct timer_list' to
> > match the expected prototype. The argument is unused anyways, so this
> > has no functional change, aside from avoiding the CFI failure.
> > 
> > Reported-by: kernel test robot <oliver.sang@intel.com>
> > Closes: https://lore.kernel.org/oe-lkp/202308020936.58787e6c-oliver.sang@intel.com
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > ---
> > I am not sure if there is an appropriate fixes tag for this, I see this
> > area was modified by commit e313ac12eb13 ("mISDN: Convert timers to use
> > timer_setup()") but I don't think it was the original source of the
> > issue. It could also be commit cf68fffb66d6 ("add support for Clang
> > CFI") but I think that just exposes the problem/makes it fatal.
> 
> Oh man. I missed one! How did I miss that one? I think "Fixes:
> e313ac12eb13" is the most correct. That was the patch that went through
> trying to fix all the prototypes, and _did_ fix all the _other_ prototypes
> in there.

Sounds reasonable to me. netdev folks, if you intend to take this, do
you want a v2 or can you pick it up with

Fixes: e313ac12eb13 ("mISDN: Convert timers to use timer_setup()")

added on top?

> Thanks for the patch!
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>
> 
> > 
> > Also not sure who should take this or how soon it should go in, I'll let
> > that to maintainers to figure out :)
> 
> If no one speaks up, I'll snag it, but since this got aimed at netdev, I
> suspect someone may pick it up. :)

Sounds good, I do see it in the netdev patchwork, so we can watch it at
least.

Cheers,
Nathan

  reply	other threads:[~2023-08-03 18:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02 17:40 [PATCH] mISDN: Update parameter type of dsp_cmx_send() Nathan Chancellor
2023-08-02 17:54 ` Sami Tolvanen
2023-08-02 19:59 ` Kees Cook
2023-08-03 18:57   ` Nathan Chancellor [this message]
2023-08-04  1:20 ` patchwork-bot+netdevbpf

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=20230803185718.GA2864317@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=isdn@linux-pingi.de \
    --cc=keescook@chromium.org \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=oliver.sang@intel.com \
    --cc=patches@lists.linux.dev \
    --cc=samitolvanen@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox