* [dpdk-dev] [PATCH] net/sfc: fix NULL dereference in EF10 TSO if no payload
@ 2019-01-23 13:08 Andrew Rybchenko
2019-01-23 14:55 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Rybchenko @ 2019-01-23 13:08 UTC (permalink / raw)
To: dev; +Cc: Igor Romanov, stable
From: Igor Romanov <igor.romanov@oktetlabs.ru>
Fixes: 6bc985e41155 ("net/sfc: support TSO in EF10 Tx datapath")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
There are a couple of warnings generated by checkpatches.sh which are
OK since positive errors are used inside PMD (since positive error
codes are used in base driver).
drivers/net/sfc/sfc_ef10_tx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index bcd3153ff..ff6d5b486 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -381,6 +381,9 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
hdr_addr = rte_pktmbuf_mtod(m_seg, uint8_t *);
hdr_iova = rte_mbuf_data_iova(m_seg);
if (rte_pktmbuf_data_len(m_seg) == header_len) {
+ /* Cannot send a packet that consists only of header */
+ if (unlikely(m_seg->next == NULL))
+ return EMSGSIZE;
/*
* Associate header mbuf with header descriptor
* which is located after TSO descriptors.
@@ -409,6 +412,10 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
copied_segs = sfc_tso_prepare_header(hdr_addr, header_len,
&m_seg, &in_off);
+ /* Cannot send a packet that consists only of header */
+ if (unlikely(m_seg == NULL))
+ return EMSGSIZE;
+
m_seg_to_free_up_to = m_seg;
/*
* Reduce the number of needed descriptors by the number of
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/sfc: fix NULL dereference in EF10 TSO if no payload
2019-01-23 13:08 [dpdk-dev] [PATCH] net/sfc: fix NULL dereference in EF10 TSO if no payload Andrew Rybchenko
@ 2019-01-23 14:55 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2019-01-23 14:55 UTC (permalink / raw)
To: Andrew Rybchenko, dev; +Cc: Igor Romanov, stable
On 1/23/2019 1:08 PM, Andrew Rybchenko wrote:
> From: Igor Romanov <igor.romanov@oktetlabs.ru>
>
> Fixes: 6bc985e41155 ("net/sfc: support TSO in EF10 Tx datapath")
> Cc: stable@dpdk.org
>
> Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-23 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23 13:08 [dpdk-dev] [PATCH] net/sfc: fix NULL dereference in EF10 TSO if no payload Andrew Rybchenko
2019-01-23 14:55 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).