Netdev List
 help / color / mirror / Atom feed
* [PATCH] netpoll: fix incorrect access to skb data in __netpoll_rx
From: Eric Dumazet @ 2011-08-26 16:26 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

__netpoll_rx() doesnt properly handle skbs with small header

pskb_may_pull() or pskb_trim_rcsum() can change skb->data, we must
reload it.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/core/netpoll.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index adf84dd..5262251 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -558,13 +558,14 @@ int __netpoll_rx(struct sk_buff *skb)
 	if (skb_shared(skb))
 		goto out;
 
-	iph = (struct iphdr *)skb->data;
 	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
 		goto out;
+	iph = (struct iphdr *)skb->data;
 	if (iph->ihl < 5 || iph->version != 4)
 		goto out;
 	if (!pskb_may_pull(skb, iph->ihl*4))
 		goto out;
+	iph = (struct iphdr *)skb->data;
 	if (ip_fast_csum((u8 *)iph, iph->ihl) != 0)
 		goto out;
 
@@ -579,6 +580,7 @@ int __netpoll_rx(struct sk_buff *skb)
 	if (pskb_trim_rcsum(skb, len))
 		goto out;
 
+	iph = (struct iphdr *)skb->data;
 	if (iph->protocol != IPPROTO_UDP)
 		goto out;
 

^ permalink raw reply related

* Re: bridge: accept bridge own MAC address as local
From: David Miller @ 2011-08-26 16:29 UTC (permalink / raw)
  To: ulrich.weber; +Cc: netdev
In-Reply-To: <20110812113024.GA8900@babylon>

From: Ulrich Weber <ulrich.weber@sophos.com>
Date: Fri, 12 Aug 2011 13:30:24 +0200

> bridge: accept bridge own MAC address as local
> if MAC address of bridge is manually set (BR_SET_MAC_ADDR). Otherwise
> only MAC addresses of bridge members will work if manually set.
> 
> Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>

As Stephen mentioned, the real bug is that we don't create a local
FDB entry (and get rid of the old one) when the MAC address changes.

^ permalink raw reply

* Re: pull request: wireless 2011-08-26
From: David Miller @ 2011-08-26 16:36 UTC (permalink / raw)
  To: linville-2XuSBdqkA4R54TAoqtyWWQ
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20110826151758.GH2579-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Date: Fri, 26 Aug 2011 11:17:58 -0400

> Here is a round of fixes intended for 3.1...
> 
> The biggest portion are Bluetooth fixes.  Gustavo describes them
> thusly:
> 
> 	Some fixes for 3.1! It looks a lot of fixes but some of them
> 	are the same fix applied to different files. Here we have a
> 	fix for a wrong timer value from Chen Ganir, a lock balance
> 	fix from Dan Carpenter, regression fix with the HCI Reset
> 	command from Szymon Janc, a fix to not show error messages on
> 	btusb device disconnect from Paul Bolle. Support for Toshiba
> 	AR30XX from Ricardo Mendoza. And finally a bunch of fixes
> 	from Peter Hurley, there are some lost wake up, deadlocks and
> 	memort leaks fixes. Most of them fixes regressions introduced
> 	by the move to the kthread API.
> 
> In addition, we have a locking fix for carl9170, a bcma fix to enable
> driver loading via udev, a wl12xx fix to properly advertise the
> maximum number of SSIDs for scanning, another wl12xx fix to properly
> check a return code in order to avoid a possible oops, and a third
> wl12xx fix to remove a broken testmode function with locking problems
> (among others).  Also included is a suspend/resume fix for ath9k,
> a fix for reading improper MAC addresses on ath9k, a suspend/resume
> fix for mac80211, and a suspend/resume fix for rt2x00 as well.

Pulled, thanks John!
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 0/9] skb fragment API: convert non-network drivers
From: David Miller @ 2011-08-26 16:39 UTC (permalink / raw)
  To: Ian.Campbell; +Cc: netdev, linux-atm-general, linux-rdma, linux-scsi, devel
In-Reply-To: <1314260881.10283.48.camel@zakaz.uk.xensource.com>

From: Ian Campbell <Ian.Campbell@citrix.com>
Date: Thu, 25 Aug 2011 09:28:01 +0100

> The following series converts some non-network drivers to the SKB pages
> fragment API introduced in 131ea6675c76. Included are ATM, Infiniband,
> and FibreChannel. I also included the broadcom network drivers since I
> was touching the related FC driver.
> 
> This is part of my series to enable visibility into SKB paged fragment's
> lifecycles, [0] contains some more background and rationale but
> basically the completed series will allow entities which inject pages
> into the networking stack to receive a notification when the stack has
> really finished with those pages (i.e. including retransmissions,
> clones, pull-ups etc) and not just when the original skb is finished
> with, which is beneficial to many subsystems which wish to inject pages
> into the network stack without giving up full ownership of those page's
> lifecycle. It implements something broadly along the lines of what was
> described in [1].

All applied, thanks Ian.

^ permalink raw reply

* Re: [PATCH net-next 1/1] af_packet: Prefixed tpacket_v3 structs to avoid name space collision
From: David Miller @ 2011-08-26 16:39 UTC (permalink / raw)
  To: loke.chetan; +Cc: netdev
In-Reply-To: <1314305010-1154-1-git-send-email-loke.chetan@gmail.com>

From: Chetan Loke <loke.chetan@gmail.com>
Date: Thu, 25 Aug 2011 16:43:30 -0400

> structs introduced in tpacket_v3 implementation are prefixed with 'tpacket'
> to avoid namespace collision.
> 
> Compile tested.
> 
> Signed-off-by: Chetan Loke <loke.chetan@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: bridge: accept bridge own MAC address as local
From: Stephen Hemminger @ 2011-08-26 16:42 UTC (permalink / raw)
  To: David Miller; +Cc: ulrich.weber, netdev
In-Reply-To: <20110826.122917.294108473242938413.davem@davemloft.net>

On Fri, 26 Aug 2011 12:29:17 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Ulrich Weber <ulrich.weber@sophos.com>
> Date: Fri, 12 Aug 2011 13:30:24 +0200
> 
> > bridge: accept bridge own MAC address as local
> > if MAC address of bridge is manually set (BR_SET_MAC_ADDR). Otherwise
> > only MAC addresses of bridge members will work if manually set.
> > 
> > Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
> 
> As Stephen mentioned, the real bug is that we don't create a local
> FDB entry (and get rid of the old one) when the MAC address changes.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Another alternative is going back to restricting the mac address of
the bridge to be the same as one of the existing ports. This was how
it used to be, but some people wanted to set arbitrary addresses
(probably to deal with start up ordering issues).

^ permalink raw reply

* Re: [RFT PATCH v3 00/12] Cleanup and extension of netdev features
From: David Miller @ 2011-08-26 16:41 UTC (permalink / raw)
  To: greearb; +Cc: mirq-linux, netdev, bhutchings
In-Reply-To: <4E569CC8.9040605@candelatech.com>

From: Ben Greear <greearb@candelatech.com>
Date: Thu, 25 Aug 2011 12:04:40 -0700

> On 06/22/2011 09:04 AM, Michał Mirosław wrote:
>> v3 of a feature handling cleanup and extension series. For testing,
>> you
>> might want user-space ethtool patched with:
>>
>> http://patchwork.ozlabs.org/patch/96374/
> 
> It looks like this is not in net-next yet...any hope of this
> going in soon?

Why would it go into net-next?  It's not a kernel patch, it's a patch
for the ethool userland utility.

^ permalink raw reply

* Re: [RFT PATCH v3 00/12] Cleanup and extension of netdev features
From: Ben Greear @ 2011-08-26 16:43 UTC (permalink / raw)
  To: David Miller; +Cc: mirq-linux, netdev, bhutchings
In-Reply-To: <20110826.124107.1302583595703798441.davem@davemloft.net>

On 08/26/2011 09:41 AM, David Miller wrote:
> From: Ben Greear<greearb@candelatech.com>
> Date: Thu, 25 Aug 2011 12:04:40 -0700
> 
>> On 06/22/2011 09:04 AM, Michał Mirosław wrote:
>>> v3 of a feature handling cleanup and extension series. For testing,
>>> you
>>> might want user-space ethtool patched with:
>>>
>>> http://patchwork.ozlabs.org/patch/96374/
>>
>> It looks like this is not in net-next yet...any hope of this
>> going in soon?
> 
> Why would it go into net-next?  It's not a kernel patch, it's a patch
> for the ethool userland utility.

I meant the kernel bits in that patch series, not the link.

Sorry for not snipping enough.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply

* Re: [RFT PATCH v3 00/12] Cleanup and extension of netdev features
From: David Miller @ 2011-08-26 16:47 UTC (permalink / raw)
  To: greearb; +Cc: mirq-linux, netdev, bhutchings
In-Reply-To: <4E57CD27.8090500@candelatech.com>

From: Ben Greear <greearb@candelatech.com>
Date: Fri, 26 Aug 2011 09:43:19 -0700

> On 08/26/2011 09:41 AM, David Miller wrote:
>> From: Ben Greear<greearb@candelatech.com>
>> Date: Thu, 25 Aug 2011 12:04:40 -0700
>> 
>>> On 06/22/2011 09:04 AM, Michał Mirosław wrote:
>>>> v3 of a feature handling cleanup and extension series. For testing,
>>>> you
>>>> might want user-space ethtool patched with:
>>>>
>>>> http://patchwork.ozlabs.org/patch/96374/
>>>
>>> It looks like this is not in net-next yet...any hope of this
>>> going in soon?
>> 
>> Why would it go into net-next?  It's not a kernel patch, it's a patch
>> for the ethool userland utility.
> 
> I meant the kernel bits in that patch series, not the link.

It's possible that if you go look at the threads about those kernel
patches you're find out the reason.

^ permalink raw reply

* Re: [PATCH] netpoll: fix incorrect access to skb data in __netpoll_rx
From: David Miller @ 2011-08-26 16:50 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1314375975.2563.8.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 26 Aug 2011 18:26:15 +0200

> __netpoll_rx() doesnt properly handle skbs with small header
> 
> pskb_may_pull() or pskb_trim_rcsum() can change skb->data, we must
> reload it.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks Eric.

^ permalink raw reply

* Re: [PATCH] net: sh_eth: fix the compile error
From: David Miller @ 2011-08-26 16:50 UTC (permalink / raw)
  To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4E537249.8050806@renesas.com>

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 23 Aug 2011 18:26:33 +0900

> Fix the following build error:
> 
>   CC      drivers/net/sh_eth.o
> drivers/net/sh_eth.c:1115: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘sh_eth_interrupt’
> drivers/net/sh_eth.c: In function ‘sh_eth_open’:
> drivers/net/sh_eth.c:1387: error: implicit declaration of function ‘request_irq’
> drivers/net/sh_eth.c:1387: error: ‘sh_eth_interrupt’ undeclared (first use in this function)
> drivers/net/sh_eth.c:1387: error: (Each undeclared identifier is reported only once
> drivers/net/sh_eth.c:1387: error: for each function it appears in.)
> drivers/net/sh_eth.c:1391: error: ‘IRQF_SHARED’ undeclared (first use in this function)
> drivers/net/sh_eth.c:1424: error: implicit declaration of function ‘free_irq’
> make[2]: *** [drivers/net/sh_eth.o] Error 1
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Applied.

^ permalink raw reply

* Re: [PATCH] net/phy: fix DP83865 phy interrupt handler
From: David Miller @ 2011-08-26 16:50 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev, tshu
In-Reply-To: <1314083234-20361-1-git-send-email-peppe.cavallaro@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Tue, 23 Aug 2011 09:07:14 +0200

> According to the DP83865 datasheet we need to clear
> the interrupt status bit by writing a 1 to the
> corresponding bit in INT_CLEAR (2:0 are reserved).
> 
> Proposed and tested by Thorsten.
> 
> Signed-off-by: Thorsten Schubert <tshu@msc-ge.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied.

^ permalink raw reply

* Re: [PATCH] can: ti_hecc: Fix uninitialized spinlock in probe
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: abhilash.kv; +Cc: netdev, wg, linux-kernel, =linux-omap
In-Reply-To: <1314104757-16462-1-git-send-email-abhilash.kv@ti.com>

From: Abhilash K V <abhilash.kv@ti.com>
Date: Tue, 23 Aug 2011 18:35:57 +0530

> In ti_hecc_probe(), the spinlock  priv->mbx_lock is not
> inited, causing a spinlock lockup BUG.
> 
> Acked-by: Anant Gole <anantgole@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>

Applied.

^ permalink raw reply

* Re: [PATCH] can: ti_hecc: Fix unintialized variable
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: abhilash.kv; +Cc: netdev, wg, linux-kernel, =linux-omap
In-Reply-To: <1314104748-16424-1-git-send-email-abhilash.kv@ti.com>

From: Abhilash K V <abhilash.kv@ti.com>
Date: Tue, 23 Aug 2011 18:35:48 +0530

> In ti_hecc_xmit(), local variable "data" is not initialized before
> being used.
> This initialization got inadvertently removed in the following patch:
> 
> 	can: Unify droping of invalid tx skbs and netdev stats
> 
> Acked-by: Anant Gole <anantgole@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>

Applied.

^ permalink raw reply

* Re: [PATCH 1/2] bnx2x: resurrect RX hashing
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: mschmidt; +Cc: netdev, vladz, eilong, dmitry, mirq-linux
In-Reply-To: <20110823161530.24707.67923.stgit@dhcp-29-224.brq.redhat.com>

From: Michal Schmidt <mschmidt@redhat.com>
Date: Tue, 23 Aug 2011 18:15:32 +0200

> bnx2x used to be able to set rxhash, but this was lost in the conversion
> to hw_features (commit 66371c441).
> Restore it and enable it by default.
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] bnx2x: Add new PHY BCM54616
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: yanivr; +Cc: eilong, netdev
In-Reply-To: <1314117204.28819.13.camel@lb-tlvb-dmitry>

From: "Yaniv Rosner" <yanivr@broadcom.com>
Date: Tue, 23 Aug 2011 19:33:24 +0300

> The BCM54616 PHY is very similar to the 54618SE, only without EEE support, which will not be activated due to querying the actual PHY type.
> This check is already done by reading a dedicated PHY register.
> 
> Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [patch -next] bna: unlock on error path in pnad_pci_probe()
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: error27; +Cc: rmody, ddutt, netdev, kernel-janitors
In-Reply-To: <20110824112922.GC5975@shale.localdomain>

From: Dan Carpenter <error27@gmail.com>
Date: Wed, 24 Aug 2011 14:29:22 +0300

> We introduced a new lock here, so there was error path which needs
> an unlock now.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH] cassini: init before use in cas_interruptN.
From: David Miller @ 2011-08-26 16:52 UTC (permalink / raw)
  To: romieu; +Cc: thomas.jarosch, netdev
In-Reply-To: <20110825150249.GA21897@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 25 Aug 2011 17:02:49 +0200

> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> Spotted-by: Thomas Jarosch <thomas.jarosch@intra2net.com>

Applied, thanks!

>  David, any opinion regarding the removal of the USE_NAPI #ifdef
>  in this driver ?

No objections to removing it.

^ permalink raw reply

* Re: [patch -next] bna: off by one in bfa_msgq_rspq_pi_update()
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: error27; +Cc: rmody, ddutt, netdev, kernel-janitors
In-Reply-To: <20110824113028.GD5975@shale.localdomain>

From: Dan Carpenter <error27@gmail.com>
Date: Wed, 24 Aug 2011 14:30:28 +0300

> The rspq->rsphdlr[] array has BFI_MC_MAX elements, so this test was
> off by one.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net_sched: sfb: optimize enqueue on full queue
From: David Miller @ 2011-08-26 16:53 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1314289292.2387.45.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 25 Aug 2011 18:21:32 +0200

> In case SFB queue is full (hard limit reached), there is no point
> spending time to compute hash and maximum qlen/p_mark.
> 
> We instead just early drop packet.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply

* Re: Traffic shaping - class ID 16bit limit?
From: David Miller @ 2011-08-26 16:53 UTC (permalink / raw)
  To: exa.exa; +Cc: shemminger, netdev
In-Reply-To: <CAO0uZ+_6xC0gymfbu28PRK4SaVgkGaSbbe-PgXvZ4h-cPp8k2A@mail.gmail.com>

From: Miroslav Kratochvil <exa.exa@gmail.com>
Date: Thu, 25 Aug 2011 19:06:58 +0200

>>> Technically the ClassID seems to be "hardcoded" as a 16bit value, but
>>> after some source searching, I haven't found any good reason for it to
>>> be 16-bit only.
>>
>> Granted it was a poor choice in the initial design.
>> It is wired into the API and changing it would be quite painful.
>>
> 
> I was feeling something like that would come.
> 
> If I get it correctly, the API change would consist of:
> 
> - some netlink protocol change
> - slight modification of qdisc_class_hash
> - modifications in all (four?) hierarchical schedulers
> - tiny expansion of userspace tc utility

There is precedence as we had to make the routing table rule ID larger
and were successfully able to do so using netlink attributes.

^ permalink raw reply

* Re: [PATCH net-next-2.6] e1000: save skb counts in TX to avoid cache misses
From: David Miller @ 2011-08-26 16:55 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: dnelson, netdev, andy
In-Reply-To: <1314330760.2097.39.camel@jtkirshe-mobl>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 25 Aug 2011 20:52:39 -0700

> On Thu, 2011-08-25 at 17:39 -0700, Dean Nelson wrote:
>> Virtual Machines with emulated e1000 network adapter running on
>> Parallels'
>> server were seeing kernel panics due to the e1000 driver dereferencing
>> an
>> unexpected NULL pointer retrieved from buffer_info->skb.
>> 
>> The problem has been addressed for the e1000e driver, but not for the
>> e1000.
>> Since the two drivers share similar code in the affected area, a port
>> of the
>> following e1000e driver commit solves the issue for the e1000 driver:
>> 
>> commit 9ed318d546a29d7a591dbe648fd1a2efe3be1180
>> Author: Tom Herbert <therbert@google.com>
>> Date:   Wed May 5 14:02:27 2010 +0000
>> 
>>     e1000e: save skb counts in TX to avoid cache misses
>> 
>>     In e1000_tx_map, precompute number of segements and bytecounts
>> which
>>     are derived from fields in skb; these are stored in buffer_info.
>> When
>>     cleaning tx in e1000_clean_tx_irq use the values in the associated
>>     buffer_info for statistics counting, this eliminates cache misses
>>     on skb fields.
>> 
>> 
>> Signed-off-by: Dean Nelson <dnelson@redhat.com> 
> 
> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied, thanks.

^ permalink raw reply

* [patch 1/2] 9p: move dereference after NULL check
From: Dan Carpenter @ 2011-08-26 16:55 UTC (permalink / raw)
  To: Eric Van Hensbergen
  Cc: David S. Miller, Venkateswararao Jujjuri, Aneesh Kumar K.V,
	M. Mohan Kumar, open list:NETWORKING [GENERAL], kernel-janitors

We dereferenced "req->tc" and "req->rc" before checking for NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/net/9p/client.c b/net/9p/client.c
index 3f8c046..b0bcace 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -248,10 +248,8 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag, int max_size)
 		init_waitqueue_head(req->wq);
 		req->tc = kmalloc(sizeof(struct p9_fcall) + alloc_msize,
 				  GFP_NOFS);
-		req->tc->capacity = alloc_msize;
 		req->rc = kmalloc(sizeof(struct p9_fcall) + alloc_msize,
 				  GFP_NOFS);
-		req->rc->capacity = alloc_msize;
 		if ((!req->tc) || (!req->rc)) {
 			printk(KERN_ERR "Couldn't grow tag array\n");
 			kfree(req->tc);
@@ -261,6 +259,8 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag, int max_size)
 			req->wq = NULL;
 			return ERR_PTR(-ENOMEM);
 		}
+		req->tc->capacity = alloc_msize;
+		req->rc->capacity = alloc_msize;
 		req->tc->sdata = (char *) req->tc + sizeof(struct p9_fcall);
 		req->rc->sdata = (char *) req->rc + sizeof(struct p9_fcall);
 	}

^ permalink raw reply related

* [patch 2/2] 9p: change an int to unsigned int
From: Dan Carpenter @ 2011-08-26 16:57 UTC (permalink / raw)
  To: Eric Van Hensbergen
  Cc: David S. Miller, Venkateswararao Jujjuri (JV), Aneesh Kumar K.V,
	M. Mohan Kumar, Stephen Hemminger, open list:NETWORKING [GENERAL],
	kernel-janitors

The size of things should be unsigned because negative sizes are
silly.  My concern is the the limit checks don't take negative values
into consideration in p9_client_create()
	if (clnt->msize > clnt->trans_mod->maxsize)
		clnt->msize = clnt->trans_mod->maxsize;
and in p9_tag_alloc()
	int alloc_msize = min(c->msize, max_size);

I don't know if this is exported to user space?  Hopefully it's not
too late to change this.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 55ce72c..d479d7d 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -151,7 +151,7 @@ struct p9_req_t {
 
 struct p9_client {
 	spinlock_t lock; /* protect client structure */
-	int msize;
+	unsigned int msize;
 	unsigned char proto_version;
 	struct p9_trans_module *trans_mod;
 	enum p9_trans_status status;

^ permalink raw reply related

* Re: [PATCH net-next 0/2] Duplication of #define with mii.h.
From: David Miller @ 2011-08-26 17:13 UTC (permalink / raw)
  To: romieu; +Cc: netdev
In-Reply-To: <20110825092019.GA21777@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 25 Aug 2011 11:20:19 +0200

> Please pull from branch 'davem-next.mii' in repository
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6.git davem-next.mii
> 
> to get the changes below.
> 
> The sunbmac changes are not compile tested. Sunbmac changeset is on top of the
> stack so it can be instantly removed if untrusted. Building a packaged rpm for a
> cross sparc-linux compiler quickly turned more interesting than expected.

I'll pull this and sanity check the build on sparc, thanks!

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox