mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	GUO Zihua <guozihua@huawei.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	philipp.g.hortmann@gmail.com, dave@stgolabs.net,
	paskripkin@gmail.com, dan.carpenter@oracle.com,
	yogi.kernel@gmail.com, yangyingliang@huawei.com,
	f3sch.git@outlook.com, linux-staging@lists.linux.dev
Subject: Re: [PATCH AUTOSEL 5.10 10/33] staging: rtl8192e: Fix return type for implementation of ndo_start_xmit
Date: Tue, 18 Oct 2022 11:48:21 +0200	[thread overview]
Message-ID: <20221018094821.GG1264@duo.ucw.cz> (raw)
In-Reply-To: <20221013002334.1894749-10-sashal@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 2013 bytes --]

Hi!

> [ Upstream commit 513d9a61156d79dd0979c4ad400c8587f52cbb9d ]
> 
> 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. Note that rtllib_xmit_inter() would return 1 only
> on allocation failure and the queue is stopped if that happens, meeting
> the documented requirement if NETDEV_TX_BUSY should be returned by
> ndo_start_xmit.
> 

> +++ b/drivers/staging/rtl8192e/rtllib_tx.c
> @@ -964,9 +964,9 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
>  
>  }
>  
> -int rtllib_xmit(struct sk_buff *skb, struct net_device *dev)
> +netdev_tx_t rtllib_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
>  	memset(skb->cb, 0, sizeof(skb->cb));
> -	return rtllib_xmit_inter(skb, dev);
> +	return rtllib_xmit_inter(skb, dev) ? NETDEV_TX_BUSY : NETDEV_TX_OK;
>  }
>  EXPORT_SYMBOL(rtllib_xmit);

First, rtllib_xmit_inter() should be fixed to return the enum, too.

Second, we really should not take this to stable, as CFI is not
available there. We should drop these patches:

 4.19 14/19] staging: rtl8192u: Fix return type of ieee80211_xmit
 5.10 09/33] staging: rtl8712: Fix return type for implementation of ndo_start_xmit
 5.10 10/33] staging: rtl8192e: Fix return type for implementation of ndo_start_xmit

Thank you,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2022-10-18  9:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  0:23 [PATCH AUTOSEL 5.10 01/33] clk: zynqmp: Fix stack-out-of-bounds in strncpy` Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 02/33] media: cx88: Fix a null-ptr-deref bug in buffer_prepare() Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 03/33] clk: zynqmp: pll: rectify rate rounding in zynqmp_pll_round_rate Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 04/33] usb: host: xhci-plat: suspend and resume clocks Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 05/33] usb: host: xhci-plat: suspend/resume clks for brcm Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 06/33] dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 07/33] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 08/33] nbd: Fix hung when signal interrupts nbd_start_device_ioctl() Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 09/33] staging: rtl8712: Fix return type for implementation of ndo_start_xmit Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 10/33] staging: rtl8192e: " Sasha Levin
2022-10-18  9:48   ` Pavel Machek [this message]
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 11/33] power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type() Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 12/33] staging: vt6655: fix potential memory leak Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 13/33] blk-throttle: prevent overflow while calculating wait time Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 14/33] ata: libahci_platform: Sanity check the DT child nodes number Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 15/33] bcache: fix set_at_max_writeback_rate() for multiple attached devices Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 16/33] soundwire: cadence: Don't overwrite msg->buf during write commands Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 17/33] soundwire: intel: fix error handling on dai registration issues Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 18/33] hid: topre: Add driver fixing report descriptor Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 19/33] HID: roccat: Fix use-after-free in roccat_read() Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 20/33] HSI: ssi_protocol: fix potential resource leak in ssip_pn_open() Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 21/33] md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 22/33] usb: host: xhci: Fix potential memory leak in xhci_alloc_stream_info() Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 23/33] usb: musb: Fix musb_gadget.c rxstate overflow bug Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 24/33] Revert "usb: storage: Add quirk for Samsung Fit flash" Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 25/33] staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv() Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 26/33] staging: rtl8192u: Fix return type of ieee80211_xmit Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 27/33] staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 28/33] nvme: copy firmware_rev on each init Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 29/33] nvmet-tcp: add bounds check on Transfer Tag Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 30/33] usb: idmouse: fix an uninit-value in idmouse_open Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 31/33] fsi: master-ast-cf: Fix missing of_node_put in fsi_master_acf_probe Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 32/33] sbitmap: fix lockup while swapping Sasha Levin
2022-10-13  0:23 ` [PATCH AUTOSEL 5.10 33/33] clk: bcm2835: Make peripheral PLLC critical Sasha Levin

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=20221018094821.GG1264@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=dan.carpenter@oracle.com \
    --cc=dave@stgolabs.net \
    --cc=f3sch.git@outlook.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guozihua@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paskripkin@gmail.com \
    --cc=philipp.g.hortmann@gmail.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yangyingliang@huawei.com \
    --cc=yogi.kernel@gmail.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®