Bläddra i källkod

qcacmn: Add sanity check in rx monitor path

Check physical address of nbuf with ring addr. If they
don't match, move to the next descriptor. Activated with
build flag.

Change-Id: Ibd6b38679d677a59f14450db3224104396c88d2e
Manoj Ekbote 3 år sedan
förälder
incheckning
5abebcd1a6
1 ändrade filer med 8 tillägg och 1 borttagningar
  1. 8 1
      dp/wifi3.0/monitor/1.0/dp_rx_mon_status_1.0.c

+ 8 - 1
dp/wifi3.0/monitor/1.0/dp_rx_mon_status_1.0.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -555,6 +555,13 @@ dp_rx_mon_status_srng_process(struct dp_soc *soc, struct dp_intr *int_ctx,
 
 			qdf_assert_always(rx_desc);
 
+			if (qdf_unlikely(!dp_rx_desc_paddr_sanity_check(rx_desc,
+								buf_addr))) {
+				DP_STATS_INC(soc, rx.err.nbuf_sanity_fail, 1);
+				hal_srng_src_get_next(hal_soc, mon_status_srng);
+				continue;
+			}
+
 			status_nbuf = rx_desc->nbuf;
 
 			qdf_nbuf_sync_for_cpu(soc->osdev, status_nbuf,