diff options
author | GUO Zihua <guozihua@huawei.com> | 2022-09-09 16:20:48 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-09-09 10:37:16 +0200 |
commit | a90044ef5605bc0961356548526c44964bc819a7 (patch) | |
tree | 84b7155f29f2da090adbbd2a001f2e0219a24887 | |
parent | 5bf83bef3bdc3e8e8285660713d4df086ce45aba (diff) | |
download | linux-stable-a90044ef5605bc0961356548526c44964bc819a7.tar.gz linux-stable-a90044ef5605bc0961356548526c44964bc819a7.tar.bz2 linux-stable-a90044ef5605bc0961356548526c44964bc819a7.zip |
staging: rtl8723bs: Fix return type for implementation of ndo_start_xmit
CFI (Control Flow Integrity) is a safety feature allowing the system to
detect and react should a potential control flow hijacking occurs. In
particular, the Forward-Edge CFI protects indirect function calls by
ensuring the prototype of function that is actually called matches the
definition of the function hook.
Since Linux now supports CFI, it will be a good idea to fix mismatched
return type for implementation of hooks. Otherwise this would get
cought out by CFI and cause a panic.
Use enums from netdev_tx_t as return value instead. Then change return
type to netdev_tx_t.
Fixes: cf68fffb66d6 ("add support for Clang CFI")
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Link: https://lore.kernel.org/r/20220909082048.14486-3-guozihua@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8723bs/include/xmit_osdep.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/rtl8723bs/include/xmit_osdep.h b/drivers/staging/rtl8723bs/include/xmit_osdep.h index 3c1391aef093..8704dced593a 100644 --- a/drivers/staging/rtl8723bs/include/xmit_osdep.h +++ b/drivers/staging/rtl8723bs/include/xmit_osdep.h @@ -26,7 +26,7 @@ struct xmit_frame; struct xmit_buf; extern void _rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev); -extern int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev); +extern netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev); void rtw_os_xmit_schedule(struct adapter *padapter); diff --git a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c index 2b268aab4f88..1eeabfffd6d2 100644 --- a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c @@ -217,10 +217,10 @@ drop_packet: dev_kfree_skb_any(pkt); } -int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev) +netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev) { if (pkt) _rtw_xmit_entry(pkt, pnetdev); - return 0; + return NETDEV_TX_OK; } |