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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20131025150251.GH5871@mwanda>
Date:	Fri, 25 Oct 2013 18:02:51 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Dominik Paulus <dominik.paulus@....de>
Cc:	Anthony Foiani <anthony.foiani@...il.com>,
	devel@...verdev.osuosl.org, linux-kernel@...cs.fau.de,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Kurt Kanzenbach <ly80toro@....cs.fau.de>, tobias.polzer@....de,
	linux-kernel@...r.kernel.org,
	Ilija Hadzic <ihadzic@...earch.bell-labs.com>
Subject: Re: [PATCHv4 12/16] staging: usbip: Pass session keys to the kernel

On Sat, Oct 19, 2013 at 04:39:15PM +0200, Dominik Paulus wrote:
> @@ -367,10 +367,17 @@ int usbip_host_export_device(struct usbip_exported_device *edev,
>  		return -1;
>  	}
>  
> -	snprintf(sockfd_buff, sizeof(sockfd_buff), "%d\n", conf->sockfd);
> -	dbg("write: %s", sockfd_buff);
> +	{
> +		char key1[33], key2[33];
> +		snprintf(sockfd_buff, sizeof(sockfd_buff), "%d %d %s %s\n",
> +				conf->sockfd, conf->use_crypto,
> +				keytohex(conf->key2, key2),
> +				keytohex(conf->key1, key1));
> +		dbg("write: %s", sockfd_buff);
> +	}

This is gross.  Don't do that.  My gut says to just delete the debug
code but I hate debug code by default.

> -	ret = sysfs_write_attribute(attr, sockfd_buff, strlen(sockfd_buff));
> +	ret = sysfs_write_attribute(attr, (const char *) sockfd_buff,

Don't put a space between the cast and the variable.

	ret = sysfs_write_attribute(attr, (const char *)sockfd_buff,

regards,
dan carpenter
--
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