lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  2 Aug 2013 12:16:17 +0200
From:	Daniel Borkmann <dborkman@...hat.com>
To:	davem@...emloft.net
Cc:	netdev@...r.kernel.org, Or Gerlitz <ogerlitz@...lanox.com>
Subject: [PATCH net] net: mlx5: fix sizeof usage in health_care's reg_handler

In mlx5's function health_care() the callback handler reg_handler() is
being called that checks the devices registers like:

  reg_handler(dev->pdev, health->health, sizeof(health->health));

health->health is a pointer to the member "struct health_buffer __iomem
*health" of mlx5_core_health, where health buffer itself looks like:

  struct health_buffer {
        __be32          assert_var[5];
        __be32          rsvd0[3];
        __be32          assert_exit_ptr;
        __be32          assert_callra;
        __be32          rsvd1[2];
        ...
        __be16          ext_sync;
  };

Therefore, I strongly assume sizeof(*health->health) is being meant
to be passed as an argument. Interestingly, there are actually no
in-tree users of mlx5_[un]register_health_report_handler(), but some
debugging modules might want to know the correct size instead.

Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
Cc: Or Gerlitz <ogerlitz@...lanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
index 748f10a..3592e43 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
@@ -101,7 +101,7 @@ static void health_care(struct work_struct *work)
 		spin_lock_irq(&health_lock);
 		if (reg_handler)
 			reg_handler(dev->pdev, health->health,
-				    sizeof(health->health));
+				    sizeof(*health->health));
 
 		list_del_init(&health->list);
 		spin_unlock_irq(&health_lock);
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ