mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Nathan Huckleberry" <nhuck@google.com>, nathan@kernel.org
Cc: error27@gmail.com,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
	llvm@lists.linux.dev,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	trix@redhat.com
Subject: Re: [PATCH v3] staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow
Date: Thu, 15 Sep 2022 10:21:47 +0200	[thread overview]
Message-ID: <b66ea89d-c62e-4772-b3d7-6e236da837af@www.fastmail.com> (raw)
In-Reply-To: <20220914211057.423617-1-nhuck@google.com>

On Wed, Sep 14, 2022, at 11:10 PM, Nathan Huckleberry wrote:
> The ndo_start_xmit field in net_device_ops is expected to be of type
> netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev).
>
> The mismatched return type breaks forward edge kCFI since the underlying
> function definition does not match the function hook definition.
>
> The return type of cvm_oct_xmit and cvm_oct_xmit_pow should be changed
> from int to netdev_tx_t.
>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1703
> Cc: llvm@lists.linux.dev
> Signed-off-by: Nathan Huckleberry <nhuck@google.com>
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
>
> ---
>
> Changes v1 -> v2:
> - Update function signatures in ethernet-tx.h.
>
> Changes v2 -> v3:
> - Move changes below the scissors --- so they don't show in commit msg
> - Add reviewed-by tag

The patch looks correct to me so

Acked-by: Arnd Bergmann <arnd@arndb.de>

but I have two more general comments:

- For your changelogs, it would help to include the diagnostic message
  from smatch that you link to.

- This has probably been discussed before, but why is this only
  reported by smatch but by clang itself when building with CFI
  enabled? It appears that CFI enforces stricter C++ style type
  compatibility on enums while the warnings only catch incompatible
  types according to the normal C11 rules.

     Arnd

  reply	other threads:[~2022-09-15  8:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 21:45 [PATCH] " Nathan Huckleberry
2022-09-13 22:33 ` Nathan Chancellor
2022-09-13 22:35   ` Nathan Chancellor
2022-09-13 23:04     ` [PATCH v2] " Nathan Huckleberry
2022-09-13 23:22       ` Nathan Chancellor
2022-09-14 21:10         ` [PATCH v3] " Nathan Huckleberry
2022-09-15  8:21           ` Arnd Bergmann [this message]
2022-09-15  9:09             ` Dan Carpenter
2022-09-15 12:03               ` Arnd Bergmann

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=b66ea89d-c62e-4772-b3d7-6e236da837af@www.fastmail.com \
    --to=arnd@arndb.de \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nhuck@google.com \
    --cc=trix@redhat.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

all inboxes | Powered by JetHome®