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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 9 Jun 2011 08:27:22 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	"Michael Chan" <mchan@...adcom.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org,
	"Eddie Wai" <eddie.wai@...adcom.com>
Subject: Re: [PATCH 3/5 net-next] cnic: Randomize initial TCP port for iSCSI
 connections

On Wed, 8 Jun 2011 22:29:34 -0700
"Michael Chan" <mchan@...adcom.com> wrote:

>  static int cnic_cm_alloc_mem(struct cnic_dev *dev)
>  {
>  	struct cnic_local *cp = dev->cnic_priv;
> +	u32 port_id;
>  
>  	cp->csk_tbl = kzalloc(sizeof(struct cnic_sock) * MAX_CM_SK_TBL_SZ,
>  			      GFP_KERNEL);
>  	if (!cp->csk_tbl)
>  		return -ENOMEM;
>  
> +	get_random_bytes(&port_id, sizeof(port_id));

I think random32() or it's alias net_random() would be sufficient
for your needs here.
--
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