You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/11/05 18:47:02 UTC

[GitHub] [mynewt-core] vikrant-proxy opened a new pull request #2711: mcu/nrf5340: Add RAM location check to calls using easyDMA

vikrant-proxy opened a new pull request #2711:
URL: https://github.com/apache/mynewt-core/pull/2711


   Add checks to confirm that the buffer points to a location in RAM given that easyDMA can only access RAM locations


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] vikrant-proxy commented on a change in pull request #2711: mcu/nrf5340: Add RAM location check to calls using easyDMA

Posted by GitBox <gi...@apache.org>.
vikrant-proxy commented on a change in pull request #2711:
URL: https://github.com/apache/mynewt-core/pull/2711#discussion_r743973729



##########
File path: hw/mcu/nordic/nrf5340_net/src/hal_spi.c
##########
@@ -685,10 +686,14 @@ hal_spi_txrx_noblock(int spi_num, void *txbuf, void *rxbuf, int len)
 {
     struct nrf5340_net_hal_spi *spi = &nrf5340_net_hal_spi0;
 
-    if (spi_num != 0 || (spi->txrx_cb_func == NULL) || (len == 0)) {
+    if (spi_num != 0 || (spi->txrx_cb_func == NULL) || (len == 0) || !nrfx_is_in_ram(txbuf)) {
         return EINVAL;
     }
 
+    if (rxbuf != NULL && !nrfx_is_in_ram(rxbuf)) {
+        return SYS_EINVAL;

Review comment:
       ah yes, let me be consistent with the existing convention.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] kasjer commented on a change in pull request #2711: mcu/nrf5340: Add RAM location check to calls using easyDMA

Posted by GitBox <gi...@apache.org>.
kasjer commented on a change in pull request #2711:
URL: https://github.com/apache/mynewt-core/pull/2711#discussion_r743961480



##########
File path: hw/mcu/nordic/nrf5340_net/src/hal_spi.c
##########
@@ -685,10 +686,14 @@ hal_spi_txrx_noblock(int spi_num, void *txbuf, void *rxbuf, int len)
 {
     struct nrf5340_net_hal_spi *spi = &nrf5340_net_hal_spi0;
 
-    if (spi_num != 0 || (spi->txrx_cb_func == NULL) || (len == 0)) {
+    if (spi_num != 0 || (spi->txrx_cb_func == NULL) || (len == 0) || !nrfx_is_in_ram(txbuf)) {
         return EINVAL;
     }
 
+    if (rxbuf != NULL && !nrfx_is_in_ram(rxbuf)) {
+        return SYS_EINVAL;

Review comment:
       This looks slightly strange to return SYS_EINVAL and EINVAL so close together for similar reason.
   Maybe some unification could be applied, I'm not sure which way though.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] vrahane merged pull request #2711: mcu/nrf5340: Add RAM location check to calls using easyDMA

Posted by GitBox <gi...@apache.org>.
vrahane merged pull request #2711:
URL: https://github.com/apache/mynewt-core/pull/2711


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] vikrant-proxy commented on a change in pull request #2711: mcu/nrf5340: Add RAM location check to calls using easyDMA

Posted by GitBox <gi...@apache.org>.
vikrant-proxy commented on a change in pull request #2711:
URL: https://github.com/apache/mynewt-core/pull/2711#discussion_r743975506



##########
File path: hw/mcu/nordic/nrf5340_net/src/hal_spi.c
##########
@@ -685,10 +686,14 @@ hal_spi_txrx_noblock(int spi_num, void *txbuf, void *rxbuf, int len)
 {
     struct nrf5340_net_hal_spi *spi = &nrf5340_net_hal_spi0;
 
-    if (spi_num != 0 || (spi->txrx_cb_func == NULL) || (len == 0)) {
+    if (spi_num != 0 || (spi->txrx_cb_func == NULL) || (len == 0) || !nrfx_is_in_ram(txbuf)) {
         return EINVAL;
     }
 
+    if (rxbuf != NULL && !nrfx_is_in_ram(rxbuf)) {
+        return SYS_EINVAL;

Review comment:
       addressed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org