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]
Date:   Thu, 15 Sep 2022 10:21:47 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Nathan Huckleberry" <nhuck@...gle.com>, nathan@...nel.org
Cc:     error27@...il.com,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev,
        llvm@...ts.linux.dev, "Nick Desaulniers" <ndesaulniers@...gle.com>,
        trix@...hat.com
Subject: Re: [PATCH v3] staging: octeon: Fix return type of cvm_oct_xmit and
 cvm_oct_xmit_pow

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@...il.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1703
> Cc: llvm@...ts.linux.dev
> Signed-off-by: Nathan Huckleberry <nhuck@...gle.com>
> Reviewed-by: Nathan Chancellor <nathan@...nel.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@...db.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ