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:	Mon, 21 Apr 2008 14:43:01 +0400
From:	Evgeniy Polyakov <johnpol@....mipt.ru>
To:	Midhun A <midhunagni@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: Userspace - Kernel Space "Connector" test

Hi.

On Mon, Apr 21, 2008 at 03:59:32PM +0530, Midhun A (midhunagni@...il.com) wrote:
> static void imxmci_check_status(unsigned long data)
> {
> 	struct imxmci_host *host = (struct imxmci_host *)data;
> 
> 	/*Netlink*/
> 	struct cn_msg *m;
> 	char cn_data[32] = "SD/MMC Card Status";
> 	/*Netlink*/
> 
> 	if( host->pdata->card_present() != host->present ) {
> 		host->present ^= 1;
> 		dev_info(mmc_dev(host->mmc), "card %s\n",
> 		      host->present ? "inserted" : "removed");
> 
> 	/*Netlink*/
> 
> 	m = kmalloc(sizeof(*m) + sizeof(cn_data), GFP_ATOMIC);
> 
> 	if (m) {
> 		printk("Inside if\n");
> 		memset(m, 0, sizeof(*m) + sizeof(cn_data));
> 		memcpy(&m->id, &cn_test_id, sizeof(m->id));
> 		m->seq = cn_test_timer_counter;
> 		m->len = sizeof(cn_data);
> 
> 		m->len =
> 		    scnprintf(cn_data, sizeof(cn_data), "counter = %u",
> 			      cn_test_timer_counter) + 1;
> 
> 		memcpy(m + 1, data, m->len);
> 		printk("Copied Message\n");		
> 		cn_netlink_send(m, 0, gfp_any());
> 		printk("Sent Message\n");		
> 		kfree(m);

What is return value here?
Also, do you register this driver as connector user? If not, you can not
use 0 group number, since it will search only for registered kernel
side, and if there was no registration, it can not obtain address of the
userspace side. You can specify group (7 in your cae) as a parameter
instead.

I suppose userspace was bound to (1<<7) group number or was subscribed
using socket option to 7'th group.

-- 
	Evgeniy Polyakov
--
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