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:	Tue, 02 Feb 2010 15:17:57 +0100
From:	Patrick McHardy <kaber@...sh.net>
To:	Sjur Brændeland 
	<sjur.brandeland@...ricsson.com>
CC:	netdev@...r.kernel.org, davem@...emloft.net, marcel@...tmann.org,
	stefano.babic@...ic.homelinux.org, randy.dunlap@...cle.com
Subject: Re: [PATCH net-next-2.6 09/13] net-caif: add CAIF netdevice

Sjur Brændeland wrote:
>>> +	if (priv->config.type == CAIF_CHTY_DATAGRAM_LOOP) { +		struct
>>> iphdr *hdr; +		__be32 swap;
>>> +		/* Retrieve IP header. */
>>> +		hdr = ip_hdr(skb);
>>> +		/* Change source and destination address. */
>>> +		swap = hdr->saddr;
>>> +		hdr->saddr = hdr->daddr;
>>> +		hdr->daddr = swap;
>> swap()?
> 
> 
> The modem provides a loopback function for the CAIF link type (CAIF_CHTY_DATAGRAM_LOOP).
> This is useful for testing the physical link between modem and host.
> In this scenario we need to swap src and destination ip address.
> I'll move this to a separate function in next patch set.

There is already a swap() function which you can use.

>>> +static int ipcaif_newlink(struct net *src_net, struct net_device
>>> *dev, +			  struct nlattr *tb[], struct nlattr *data[]) { +	int err;
>>> +	struct chnl_net *caifdev;
>>> +	ASSERT_RTNL();
>>> +	caifdev = netdev_priv(dev);
>>> +	caif_netlink_parms(data, &caifdev->config);
>>> +	err = register_netdevice(dev);
>>> +	if (err) {
>>> +		pr_warning("CAIF: %s(): device rtml registration failed\n", +			 
>>> __func__); +		goto out;
>>> +	}
>>> +	dev_hold(dev);
>> What is this reference used for? You don't have a dellink function,
>> so this looks like a leak. 
> 
> I don't think it leaks because I do dev_put in chnl_net_uninit,
> but you're right - I don't really need this. I'll remove the 
> dev_hold and dev_put completely in next patch-set.

But it wouldn't get released when deleting a link using netlink
I think since without a dellink function I don't see what would
invoke chnl_net_uninit(). Anyways, removing it will fix this :)
--
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