From: Vincent Stehlé <hidden> Date: 2020-12-13 17:27:15
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Fix the korina_send_packet() function
accordingly.
Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Signed-off-by: Vincent Stehlé <redacted>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Florian Fainelli <redacted>
---
drivers/net/ethernet/korina.c | 1 -
1 file changed, 1 deletion(-)
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Fix the korina_send_packet() function
accordingly.
Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Signed-off-by: Vincent Stehlé <redacted>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Florian Fainelli <redacted>
---
drivers/net/ethernet/korina.c | 1 -
1 file changed, 1 deletion(-)
As this skb is returned to the stack (and not dropped), the tx_dropped
statistics increment looks bogus too.
Since this is clearly an ugly use after free, and nobody complained we
can assume that the driver correctly stops its TX queue ahead of time.
So perhaps we can change the return value to NETDEV_TX_OK instead.
As this skb is returned to the stack (and not dropped), the tx_dropped
statistics increment looks bogus too.
Since this is clearly an ugly use after free, and nobody complained we
can assume that the driver correctly stops its TX queue ahead of time.
So perhaps we can change the return value to NETDEV_TX_OK instead.
Hi Jakub,
Thanks for the review.
Ok, if this is the preferred fix I will respin the patch this way.
Best regards,
Vincent.
From: Vincent Stehlé <hidden> Date: 2020-12-14 22:16:48
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Therefore, make sure the
korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.
Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vincent Stehlé <redacted>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <redacted>
---
Changes since v1:
- Keep freeing the packet but return NETDEV_TX_OK, as suggested by Jakub
drivers/net/ethernet/korina.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Jakub Kicinski <kuba@kernel.org> Date: 2020-12-16 20:44:42
On Mon, 14 Dec 2020 23:09:52 +0100 Vincent Stehlé wrote:
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Therefore, make sure the
korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.
Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vincent Stehlé <redacted>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <redacted>
Let me CC Florian's more recent email just in case he wants to review.
quoted hunk
Changes since v1:
- Keep freeing the packet but return NETDEV_TX_OK, as suggested by Jakub
drivers/net/ethernet/korina.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
On Mon, 14 Dec 2020 23:09:52 +0100 Vincent Stehlé wrote:
quoted
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Therefore, make sure the
korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.
Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vincent Stehlé <redacted>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <redacted>
Let me CC Florian's more recent email just in case he wants to review.
From: Jakub Kicinski <kuba@kernel.org> Date: 2020-12-16 23:03:03
On Wed, 16 Dec 2020 13:32:26 -0800 Florian Fainelli wrote:
On 12/16/20 12:43 PM, Jakub Kicinski wrote:
quoted
On Mon, 14 Dec 2020 23:09:52 +0100 Vincent Stehlé wrote:
quoted
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Therefore, make sure the
korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.
Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vincent Stehlé <redacted>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <redacted>
Let me CC Florian's more recent email just in case he wants to review.