[rtems commit] leon, grspw_pkt: protect TX descriptor from bad input ( hdrlen)

Daniel Hellstrom danielh at rtems.org
Thu Sep 20 10:59:54 UTC 2018


Module:    rtems
Branch:    master
Commit:    0aae151eba6dcfce5b6e74ea91c5da288a86d70d
Changeset: http://git.rtems.org/rtems/commit/?id=0aae151eba6dcfce5b6e74ea91c5da288a86d70d

Author:    Daniel Hellstrom <daniel at gaisler.com>
Date:      Mon Aug 13 11:36:03 2018 +0200

leon,grspw_pkt: protect TX descriptor from bad input (hdrlen)

---

 bsps/sparc/shared/spw/grspw_pkt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bsps/sparc/shared/spw/grspw_pkt.c b/bsps/sparc/shared/spw/grspw_pkt.c
index ff481f2..39f5087 100644
--- a/bsps/sparc/shared/spw/grspw_pkt.c
+++ b/bsps/sparc/shared/spw/grspw_pkt.c
@@ -1470,7 +1470,8 @@ STATIC int grspw_tx_schedule_send(struct grspw_dma_priv *dma)
 					curr_pkt->flags &= ~PKT_FLAG_TR_HDR;
 			}
 			BD_WRITE(&curr_bd->bd->haddr, hwaddr);
-			ctrl = GRSPW_TXBD_EN | curr_pkt->hlen;
+			ctrl = GRSPW_TXBD_EN |
+			       (curr_pkt->hlen & GRSPW_TXBD_HLEN);
 		} else {
 			ctrl = GRSPW_TXBD_EN;
 		}




More information about the vc mailing list