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, 11 Feb 2011 22:43:57 +0100 (CET)
From:	Jesper Juhl <jj@...osbits.net>
To:	linux-kernel@...r.kernel.org
cc:	linux-rdma@...r.kernel.org, Eli Cohen <eli@...lanox.co.il>,
	Julia Lawall <julia@...u.dk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Hal Rosenstock <hal.rosenstock@...il.com>,
	Sean Hefty <sean.hefty@...el.com>,
	Roland Dreier <roland@...nel.org>
Subject: [PATCH][RFC] infiniband: Fix allocation size in
 register_snoop_agent()

Ok, someone needs to double check me on this before merging anything, but 
don't we want to allocate sizeof(struct ib_mad_snoop_private) here, rather 
than just the size of a pointer to the struct?

Signed-off-by: Jesper Juhl <jj@...osbits.net>
---
 mad.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

 compile tested only. no hardware available for proper test.

diff --git 
a/drivers/infiniband/core/mad.c 
b/drivers/infiniband/core/mad.c
index 822cfdc..2c74b85 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -413,7 +413,7 @@ static int register_snoop_agent(struct ib_mad_qp_info *qp_info,
 	if (i == qp_info->snoop_table_size) {
 		/* Grow table. */
 		new_snoop_table = krealloc(qp_info->snoop_table,
-					   sizeof mad_snoop_priv *
+					   sizeof(struct ib_mad_snoop_private) *
 					   (qp_info->snoop_table_size + 1),
 					   GFP_ATOMIC);
 		if (!new_snoop_table) {


-- 
Jesper Juhl <jj@...osbits.net>            http://www.chaosbits.net/
Plain text mails only, please.
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ