* [PATCH] trivial: fix alignment of IP-Config output
From: Uwe Kleine-König @ 2008-02-12 8:38 UTC (permalink / raw)
To: netdev; +Cc: trivial, linux-kernel
make the intended lines aligned in the output (not in the code)
Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
---
net/ipv4/ipconfig.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index a52b585..10013cc 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1390,7 +1390,7 @@ static int __init ip_auto_config(void)
* Clue in the operator.
*/
printk("IP-Config: Complete:");
- printk("\n device=%s", ic_dev->name);
+ printk("\n device=%s", ic_dev->name);
printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr));
printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
--
1.5.4
^ permalink raw reply related
* Open bugs
From: Natalie Protasevich @ 2008-02-12 8:18 UTC (permalink / raw)
To: linux-kernel, akpm, netdev, alsa-devel, linux-ide, bugme-daemon
Hello,
The bugs listed are over a month old, and haven't been addressed yet.
It would be appreciated if corresponding maintainers identify whether
the bugs have been fixed, or need to be worked on, and take
appropriate action.
In most cases, reporters are standing by and ready to provide
information and necessary testing.
Thanks!
Memory Management=======================================
swapping in 2.6.24-rc5-git3
http://bugzilla.kernel.org/show_bug.cgi?id=9592
Date: 12/07/2007
Regression
Summary:
# /proc/sys/vm# cat swappiness
0
but scp-ing 2GB file causes many processes are swapped out due to
increase of the file cache size.
Was looked at by Jan Kara <jack@suse.cz>; KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> - commented
I/O-Storage================================================
SATA DVD drive & UDF filesystem problem
http://bugzilla.kernel.org/show_bug.cgi?id=9668
12/31/2007
Summary: I mount dvd discs (udf) with piix and ide_cd modules without
problem (on hw decribed higher).
Then I put NEC drive to new mainboard (ICH9 + jmicron SATA/PATA chips)
and use ahci (jmicron) + sr_mod modules.
SCSI======================================================
Problems on booting
http://bugzilla.kernel.org/show_bug.cgi?id=9621
Date: 12/22/2007
Regression
Summary: The boot stops / hangs on hardware detection of SCSI. I have
an InitioINI-9X00U/UW
When I have an usb key sticked in /dev/sba, and run lilo then, then it
dont boot but give L99 99 99 99 ... error
Resetting RAID attached to a FC Switch causes kernel panic and crash
http://bugzilla.kernel.org/show_bug.cgi?id=9598
12/18/2007
Hardware Environment:SunFire X4200 - 2 x dual core AMD Opteron CPUs,
8GB Ram, Qlogic FC adapter.
Summary: Resetting the RAID box causes the X4200 to crash.
3ware 9650SE -8LPML not recognized by 3w-9xxx driver
http://bugzilla.kernel.org/show_bug.cgi?id=8908
08/19/2007
Problem Description: The 3w-9xxx kernel driver for 3ware 9xxx SATA
RAID Controller series did not recognize the 3ware 9650SE-8LPML SATA
RAID Controller.
Plarform===================================================
kexec buffer error
http://bugzilla.kernel.org/show_bug.cgi?id=9693
Date: 01/04/2008
Regression
Summary: Close of /boot/kernel-2.6.24-rc6-git11 failed: : buffer error
kexec load failed, error = 1
20000+ wake-ups/second in 2.6.24
http://bugzilla.kernel.org/show_bug.cgi?id=9489
Date: 12/02/2007
Summary: "something" is causing the system to go into a state where
the cpu throws us right out of the C-state the kernel asks for
Discussed: Arjan van de Ven, Mark Lord
VIDEO/FB======================================================
No text consoles with FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
http://bugzilla.kernel.org/show_bug.cgi?id=9310
11/05/2007 still there
Regression
Summary: After initial boot messages all output to console stops. The
last visible messages are:
checking if image is initramfs...<6>Switched to high resolution mode on CPU 1
Switched to high resolution mode on CPU 0
After that, nothing until XOrg starts up and graphical login/desktop
on VT7are displayed normal.
DVB===========================================================
DVB-T Pluto2: SUSPEND/RESUME methods are missing for this driver
04/05/2007 - still present in 2.6.24
http://bugzilla.kernel.org/show_bug.cgi?id=8304
Summary: After SWSUPS resume, pluto2 card is not started properly, led
getts not green and card is unable load tda firmware
Hardware Environment: Acer TravelMate
No one looked at it yet.
Several Pluto bug:
DVB-T Pluto2 && PCI: When playing in dmesg I often getts: "pluto2
0000:03:00.0: overflow irq (10)"
Date: 11/08/2006 still there
http://bugzilla.kernel.org/show_bug.cgi?id=7473
Hardware Environment: Acer TravelMate
DVB-T Pluto2: Getting tons of "card hung up :(" messages when card is
removed from pcmcia slot
Date: 11/08/2006 - still there
http://bugzilla.kernel.org/show_bug.cgi?id=7472
DVB-T Pluto2: Unable to change MUX
Date: 11/08/2006
http://bugzilla.kernel.org/show_bug.cgi?id=7471
KNC1 DVB-C cam module not working on driver load
Date: 1/15/2007 - still there
http://bugzilla.kernel.org/show_bug.cgi?id=7825
Error:
DVB: registering new adapter (KNC1 DVB-C)
adapter failed MAC signature check
encoded MAC from EEPROM was
ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff
KNC1-0: MAC addr = 00:09:d6:6d:5a:f0
TDA10021: i2c-addr = 0x0c, id = 0x7c
DVB: registering frontend 0 (Philips TDA10021 DVB-C)...
budget-av: ci interface initialised.
budget-av: cam inserted A
dvb_ca adaptor 0: PC card did not respond :(
build #341 failed for 2.6.24-rc6-g1842c7f in
linux/./drivers/media/dvb/ttpci/budget-av.c
01/01/2008
http://bugzilla.kernel.org/show_bug.cgi?id=9671
Still there in 2.6.24.. has it been fixed?
DVB-USB UMT-010 driver has certain oops when installed
01/09/2008
http://bugzilla.kernel.org/show_bug.cgi?id=9720
In the umt-010 driver the struct umt_properties sets the number of
URBs for transfer to 20.
But in dvb-usb.h MAX_NO_URBS_FOR_DATA_STREAM is set to 10. This causes
an oops for all devices which use the umt-010 chipset when they are
inserted.
v4l Problem with dvb-usb and Hauppage USB Stick
http://bugzilla.kernel.org/show_bug.cgi?id=9001
9/9/2007
x86_64
dvb-usb: Hauppauge Nova-T Stick crashes during channel search with Kaffeine
KEXEC=============================================================
kexec buffer error
http://bugzilla.kernel.org/show_bug.cgi?id=9693
01/05/2008
2.6.24-rc6-git9 works as expected. git10 fails with root device not found
DRIVERS===========================================================
Two small bugs detected by code review:
physmap does not have a release() function
01/05/2008
http://bugzilla.kernel.org/show_bug.cgi?id=9690
Summary: Pretty trivial addition of the release()
hgafb module is broken & unmaintained
http://bugzilla.kernel.org/show_bug.cgi?id=9689
This one also needs release() function
FILESYSTEMS======================================================
journal_data mount option causes filesystem corruption with blocksize != 4096
01/05/2008
http://bugzilla.kernel.org/show_bug.cgi?id=9692
Appears to be e2fsck problem
ALSA==============================================================
SC-5200 + wine = System freeze
http://bugzilla.kernel.org/show_bug.cgi?id=9649
12/27/2007
-- Motherboard: Asus A8R-MVP
-- Harddrive: Samsung 200Gb
-- Soundcard 1: Onboard
-- Soundcard 2: Trust SC-5200
Running any part of wine freezes up the whole system. Both SSH
connections, the normal X screen and any other device, including sound
played by for example music players, freezes up. After about 10
seconds the system reboots.
By removing my second sound card it works. By disabling my onboard
sound it still causes the freeze.
Networking=========================================================
An ioctl to delete an ipv6 tunnel leads to a kernel panic
http://bugzilla.kernel.org/show_bug.cgi?id=8895
8/16/2007
Summary: The mip6d HA was modified to make a redundancy evolution,
when an HA is interrupted, the other takes over, this leads to some
creation/deletion of routes and tunnels.
BUG: bad unlock balance detected!
http://bugzilla.kernel.org/show_bug.cgi?id=9542
Date: 12/11/2007
Summary:
...bug in the bonding driver...bond->lock should always turn BH off,
even on read lock.
Handled: Herbert Xu
Problem and solution has been identified, but the bug stalled -
probably needs someone to submit an actual patch
WIRELESS==========================================================
IWL3945 generates WARNING in mac80211/rx.c code
http://bugzilla.kernel.org/show_bug.cgi?id=9656
12/28/2007
WARNING: at net/mac80211/rx.c:1486 __ieee80211_rx()
Pid: 0, comm: swapper Not tainted 2.6.24-rc6 #8
Call Trace:
<IRQ> [<ffffffff88123d89>] :mac80211:__ieee80211_rx+0xc69/0xd30
[<ffffffff812abd86>] _spin_lock_irqsave+0x26/0xa0
[<ffffffff812ac3a5>] _spin_unlock_irqrestore+0x15/0x30
[<ffffffff8815af91>] :iwl3945:iwl_rx_queue_restock+0xd1/0x160
[<ffffffff812abd86>] _spin_lock_irqsave+0x26/0xa0
[<ffffffff88114f7b>] :mac80211:ieee80211_tasklet_handler+0xbb/0x120
[<ffffffff810420a7>] tasklet_action+0x47/0xb0
[<ffffffff81041fb9>] __do_softirq+0x59/0xd0
[<ffffffff8100d5dc>] call_softirq+0x1c/0x30
[<ffffffff8100f975>] do_softirq+0x35/0x90
[<ffffffff81041ee5>] irq_exit+0x85/0x90
[<ffffffff8100fa54>] do_IRQ+0x84/0x100
[<ffffffff8100c931>] ret_from_intr+0x0/0xa
<EOI> [<ffffffff811a312f>] acpi_idle_enter_bm+0x272/0x2de
[<ffffffff811a3125>] acpi_idle_enter_bm+0x268/0x2de
[<ffffffff81230357>] cpuidle_idle_call+0x97/0xd0
[<ffffffff812302c0>] cpuidle_idle_call+0x0/0xd0
[<ffffffff8100b001>] cpu_idle+0x71/0xe0
NFS/RPC===================================================
in-kernel rpc generates broken RPCBPROC_GETVERSADDR v4 requests
http://bugzilla.kernel.org/show_bug.cgi?id=8891
8/15/2007
Problem Description: When locking a file, an invalid
RPCBPROC_GETVERSADDR procedure call is sent out
Chuck Lever looked at it a while ago
^ permalink raw reply
* Re: [PATCH] [IPV4]: Remove warning in node_set_parent.
From: Denis V. Lunev @ 2008-02-12 8:11 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: davem, netdev, devel
In-Reply-To: <20080211114849.042a3da2@extreme>
ugly :), but
Acked-by: Denis V. Lunev <den@openvz.org>
On Mon, 2008-02-11 at 11:48 -0800, Stephen Hemminger wrote:
> On Mon, 11 Feb 2008 11:47:17 +0300
> "Denis V. Lunev" <den@openvz.org> wrote:
>
> > net/ipv4/fib_trie.c: In function 'node_set_parent':
> > net/ipv4/fib_trie.c:184: warning: assignment makes integer from pointer
> > without a cast
> >
> > Signed-off-by: Denis V. Lunev <den@openvz.org>
> > ---
> > net/ipv4/fib_trie.c | 7 ++++---
> > 1 files changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> > index f5fba3f..1753cd4 100644
> > --- a/net/ipv4/fib_trie.c
> > +++ b/net/ipv4/fib_trie.c
> > @@ -177,10 +177,11 @@ static inline struct tnode *node_parent_rcu(struct node *node)
> > return rcu_dereference(ret);
> > }
> >
> > -static inline void node_set_parent(struct node *node, struct tnode *ptr)
> > +static inline void node_set_parent(struct node *node, struct tnode *__ptr)
> > {
> > - rcu_assign_pointer(node->parent,
> > - (unsigned long)ptr | NODE_TYPE(node));
> > + struct node *ptr;
> > + ptr = (struct node *)((unsigned long)__ptr | NODE_TYPE(node));
> > + rcu_assign_pointer(node->parent, ptr);
> > }
> >
> > static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
>
> No, this causes new warning from assigning pointer (ptr) to integer node->parent.
>
> Why not just change rcupdate.h to do the right thing.
>
> >From a00f7cbf1c2f2282eced236e1e8b99b0fecd213a Mon Sep 17 00:00:00 2001
> From: Stephen Hemminger <stephen.hemminger@vyatta.com>
> Date: Mon, 11 Feb 2008 11:28:13 -0800
> Subject: [PATCH] eliminate warnings when rcu_assign_pointer is used with unsigned long
>
> It is reasonable to use RCU with non-pointer values, and describe
> the optimization.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> ---
> include/linux/rcupdate.h | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 37a642c..c44ac87 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -172,14 +172,15 @@ struct rcu_head {
> * structure after the pointer assignment. More importantly, this
> * call documents which pointers will be dereferenced by RCU read-side
> * code.
> + *
> + * If value is the NULL (constant 0), then no barrier is needed.
> */
>
> -#define rcu_assign_pointer(p, v) \
> - ({ \
> - if (!__builtin_constant_p(v) || \
> - ((v) != NULL)) \
> - smp_wmb(); \
> - (p) = (v); \
> +#define rcu_assign_pointer(p, v) \
> + ({ \
> + if (!(__builtin_constant_p(v) && v)) \
> + smp_wmb(); \
> + (p) = (v); \
> })
>
> /**
> --
> 1.5.3.8
>
>
>
>
^ permalink raw reply
* Re: [PATCH][PPPOL2TP]: Fix SMP oops in pppol2tp driver
From: Jarek Poplawski @ 2008-02-12 7:19 UTC (permalink / raw)
To: James Chapman; +Cc: netdev
In-Reply-To: <47B0DD1E.5000608@katalix.com>
On Mon, Feb 11, 2008 at 11:41:18PM +0000, James Chapman wrote:
> Jarek Poplawski wrote:
>> On Mon, Feb 11, 2008 at 10:19:35PM +0000, James Chapman wrote:
>> ...
>>> Below is example output from lockdep. The oops is reproducible when
>>> creating/deleting lots of sessions while passing data. The lock is
>>> being acquired for read and write in softirq contexts.
>>>
>>> Is there a better way to fix this?
>>>
>>> =================================
>>> [ INFO: inconsistent lock state ]
>>> 2.6.24-core2 #1
>>> ---------------------------------
>>> inconsistent {in-softirq-R} -> {softirq-on-W} usage.
>>> openl2tpd/3215 [HC0[0]:SC0[0]:HE1:SE1] takes:
>>> (&tunnel->hlist_lock){---?}, at: [<f8eea157>]
>>> pppol2tp_connect+0x517/0x6d0 [pppol2tp]
>>> {in-softirq-R} state was registered at:
>>
>> IMHO, according to this, disabling bh should be enough. And if it's
>> like in this report: only read_lock is taken from softirqs, then this
>> should be necessary to change only all write_locks to write_lock_bh
>> (of course unless somewhere bhs are disabled already). Unless I miss
>> something?!
>
> I thought so too. I tried _bh locks first and the problem still
> occurred. Maybe I'll try it again in case I messed something up.
If there are any new lockdep warnings I'd be interested to have
a look. (BTW, with irqs disabling such ISP would probably get
considerable drop in performance?)
Regards,
Jarek P.
^ permalink raw reply
* Re: [git patches] net driver updates
From: David Miller @ 2008-02-12 5:57 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel
In-Reply-To: <20080211170516.GA13872@havoc.gtf.org>
From: Jeff Garzik <jeff@garzik.org>
Date: Mon, 11 Feb 2008 12:05:16 -0500
> Mostly fixes, a few cleanups (generally assisting fixes), and an
> exception for PS3 wireless because it had been posted, reviewed and
> acked for a while, just not committed.
>
> Please pull from 'upstream-davem' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git upstream-davem
>
> to receive the following updates:
Pulled, thanks a lot Jeff!
^ permalink raw reply
* Re: [PATCH][RFC] race in generic address resolution
From: David Miller @ 2008-02-12 5:47 UTC (permalink / raw)
To: blaschka; +Cc: netdev
In-Reply-To: <47B00EE0.4040109@linux.vnet.ibm.com>
From: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Date: Mon, 11 Feb 2008 10:01:20 +0100
> we run your patch during the weekend on single CPU and SMP
> machines. We do not see any problems. Thanks for providing the fix.
Thanks for testing Frank, I can now push this fix upstream.
^ permalink raw reply
* Re: [patch 6/7] hci_ldisc: fix null pointer deref
From: David Miller @ 2008-02-12 5:42 UTC (permalink / raw)
To: marcel; +Cc: akpm, netdev, david, alan, arjan
In-Reply-To: <1202230268.15090.105.camel@violet>
From: Marcel Holtmann <marcel@holtmann.org>
Date: Tue, 05 Feb 2008 17:51:07 +0100
> Hi David,
>
> > > akpm:
> > >
> > > No idea. trollmerge.
> > >
> > > Cc: Arjan van de Ven <arjan@linux.intel.com>
> > > Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> > > Cc: Marcel Holtmann <marcel@holtmann.org>
> > > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> >
> > I'll let Marcel and/or Alan take a look at this one.
>
> we might have to re-work the whole hci_uart driver at some point, but
> for now I think this fix is feasible.
Ok, I've applied this patch.
^ permalink raw reply
* Re: [PATCH][AX25] ax25_ds_timer: use mod_timer instead of add_timer
From: David Miller @ 2008-02-12 5:38 UTC (permalink / raw)
To: jarkao2; +Cc: netdev, ralf, jann
In-Reply-To: <20080206091413.GE4496@ff.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Wed, 6 Feb 2008 09:14:13 +0000
> [AX25] ax25_ds_timer: use mod_timer instead of add_timer
>
> This patch changes current use of: init_timer(), add_timer()
> and del_timer() to setup_timer() with mod_timer(), which
> should be safer anyway.
>
>
> Reported-by: Jann Traschewski <jann@gmx.de>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH][AX25] Fwd: SMP with AX.25
From: David Miller @ 2008-02-12 5:37 UTC (permalink / raw)
To: jarkao2; +Cc: netdev, ralf, jann
In-Reply-To: <20080206081509.GD4496@ff.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Wed, 6 Feb 2008 08:15:09 +0000
> On Wed, Feb 06, 2008 at 07:45:29AM +0000, Jarek Poplawski wrote:
> ...
> > From: Jann Traschewski <jann@gmx.de>
> > Subject: SMP with AX.25
>
>
> [AX25] ax25_timer: use mod_timer instead of add_timer
>
> According to one of Jann's OOPS reports it looks like
> BUG_ON(timer_pending(timer)) triggers during add_timer()
> in ax25_start_t1timer(). This patch changes current use
> of: init_timer(), add_timer() and del_timer() to
> setup_timer() with mod_timer(), which should be safer
> anyway.
>
>
> Reported-by: Jann Traschewski <jann@gmx.de>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH][PPPOL2TP]: Fix SMP oops in pppol2tp driver
From: David Miller @ 2008-02-12 5:30 UTC (permalink / raw)
To: jchapman; +Cc: jarkao2, netdev
In-Reply-To: <47B0DD1E.5000608@katalix.com>
From: James Chapman <jchapman@katalix.com>
Date: Mon, 11 Feb 2008 23:41:18 +0000
> Jarek Poplawski wrote:
> > On Mon, Feb 11, 2008 at 10:19:35PM +0000, James Chapman wrote:
> > ...
> >> Below is example output from lockdep. The oops is reproducible when
> >> creating/deleting lots of sessions while passing data. The lock is being
> >> acquired for read and write in softirq contexts.
> >>
> >> Is there a better way to fix this?
> >>
> >> =================================
> >> [ INFO: inconsistent lock state ]
> >> 2.6.24-core2 #1
> >> ---------------------------------
> >> inconsistent {in-softirq-R} -> {softirq-on-W} usage.
> >> openl2tpd/3215 [HC0[0]:SC0[0]:HE1:SE1] takes:
> >> (&tunnel->hlist_lock){---?}, at: [<f8eea157>]
> >> pppol2tp_connect+0x517/0x6d0 [pppol2tp]
> >> {in-softirq-R} state was registered at:
> >
> > IMHO, according to this, disabling bh should be enough. And if it's
> > like in this report: only read_lock is taken from softirqs, then this
> > should be necessary to change only all write_locks to write_lock_bh
> > (of course unless somewhere bhs are disabled already). Unless I miss
> > something?!
>
> I thought so too. I tried _bh locks first and the problem still
> occurred. Maybe I'll try it again in case I messed something up.
I agree with Jarek here, I look at all the code paths that take
->hlist_lock and all of them are in user context or software
interrupts.
Please get a lockdep trace with the change to _bh intead of
hw interrupt protection so we can find out what that doesn't
work.
Thanks!
^ permalink raw reply
* Re: [PATCH][AX25] ax25_route: make ax25_route_lock BH safe
From: David Miller @ 2008-02-12 5:26 UTC (permalink / raw)
To: jarkao2; +Cc: jann, f6bvp, ralf, netdev
In-Reply-To: <20080211124251.GB3597@ff.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Mon, 11 Feb 2008 12:42:51 +0000
> [AX25] ax25_route: make ax25_route_lock BH safe
>
> > =================================
> > [ INFO: inconsistent lock state ]
> > 2.6.24-dg8ngn-p02 #1
> > ---------------------------------
> > inconsistent {softirq-on-W} -> {in-softirq-R} usage.
> > linuxnet/3046 [HC0[0]:SC1[2]:HE1:SE0] takes:
> > (ax25_route_lock){--.+}, at: [<f8a0cfb7>] ax25_get_route+0x18/0xb7 [ax25]
> > {softirq-on-W} state was registered at:
> ...
>
> This lockdep report shows that ax25_route_lock is taken for reading in
> softirq context, and for writing in process context with BHs enabled.
> So, to make this safe, all write_locks in ax25_route.c are changed to
> _bh versions.
>
>
> Reported-by: Jann Traschewski <jann@gmx.de>,
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Applied, thanks a lot Jarek.
^ permalink raw reply
* Re: [PATCH v2][AX25] af_ax25: remove sock lock in ax25_info_show()
From: David Miller @ 2008-02-12 5:25 UTC (permalink / raw)
To: jarkao2; +Cc: f6bvp, ralf, jann, netdev
In-Reply-To: <20080210131051.GA7750@ami.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Sun, 10 Feb 2008 14:10:51 +0100
> [AX25] af_ax25: remove sock lock in ax25_info_show()
>
> This lockdep warning:
>
> > =======================================================
> > [ INFO: possible circular locking dependency detected ]
> > 2.6.24 #3
> > -------------------------------------------------------
> > swapper/0 is trying to acquire lock:
> > (ax25_list_lock){-+..}, at: [<f91dd3b1>] ax25_destroy_socket+0x171/0x1f0 [ax25]
> >
> > but task is already holding lock:
> > (slock-AF_AX25){-+..}, at: [<f91dbabc>] ax25_std_heartbeat_expiry+0x1c/0xe0 [ax25]
> >
> > which lock already depends on the new lock.
> ...
>
> shows that ax25_list_lock and slock-AF_AX25 are taken in different
> order: ax25_info_show() takes slock (bh_lock_sock(ax25->sk)) while
> ax25_list_lock is held, so reversely to other functions. To fix this
> the sock lock should be moved to ax25_info_start(), and there would
> be still problem with breaking ax25_list_lock (it seems this "proper"
> order isn't optimal yet). But, since it's only for reading proc info
> it seems this is not necessary (e.g. ax25_send_to_raw() does similar
> reading without this lock too).
>
> So, this patch removes sock lock to avoid deadlock possibility; there
> is also used sock_i_ino() function, which reads sk_socket under proper
> read lock. Additionally printf format of this i_ino is changed to %lu.
>
> Reported-by: Bernard Pidoux F6BVP <f6bvp@free.fr>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Applied, thanks Jarek.
> + sock_i_ino(ax25->sk));
Note that this taks the sk callback lock, it should be OK but
let's keep a watch out for any new lockdep warnings this
ends up causing :-)
^ permalink raw reply
* Re: [PATCH] fib_trie: rcu_assign_pointer warning fix
From: David Miller @ 2008-02-12 5:15 UTC (permalink / raw)
To: paulmck; +Cc: shemminger, netdev, linux-kernel
In-Reply-To: <20080212012741.GD29254@linux.vnet.ibm.com>
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Mon, 11 Feb 2008 17:27:41 -0800
> On Mon, Feb 11, 2008 at 04:59:54PM -0800, Stephen Hemminger wrote:
> > Eliminate warnings when rcu_assign_pointer is used with unsigned long.
> > It is reasonable to use RCU with non-pointer values so allow it for general
> > use. Add a comment to explain the if test.
>
> Good catch!!! (An apologies for the hassle!!!)
>
> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Thanks for reviewing Paul, I'll apply this.
^ permalink raw reply
* Re: [PATCH 2/2] fib_trie: /proc/net/route performance improvement
From: David Miller @ 2008-02-12 5:14 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20080211171659.28d96844@extreme>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 11 Feb 2008 17:16:59 -0800
> Use key/offset caching to change /proc/net/route (use by iputils route)
> from O(n^2) to O(n). This improves performance from 30sec with 160,000
> routes to 1sec.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks.
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index 2d89527..1ff446d 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -2459,6 +2459,84 @@ static const struct file_operations fib_trie_fops = {
> .release = seq_release_net,
> };
>
> +struct fib_route_iter {
> + struct seq_net_private p;
> + struct trie *main_trie;
> + loff_t pos;
> + t_key key;
> +};
> +
> +static struct leaf *fib_route_get_idx(struct fib_route_iter *iter, loff_t pos)
> +{
> + struct leaf *l = NULL;
> + struct trie *t = iter->main_trie;
> +
> + /* use cache location of last found key */
> + if (iter->pos > 0 && pos >= iter->pos && (l = fib_find_node(t, iter->key)))
> + pos -= iter->pos;
> + else {
> + iter->pos = 0;
> + l = trie_firstleaf(t);
> + }
> +
> + while (l && pos-- > 0) {
> + iter->pos++;
> + l = trie_nextleaf(l);
> + }
> +
> + if (l)
> + iter->key = pos; /* remember it */
> + else
> + iter->pos = 0; /* forget it */
> +
> + return l;
> +}
> +
> +static void *fib_route_seq_start(struct seq_file *seq, loff_t *pos)
> + __acquires(RCU)
> +{
> + struct fib_route_iter *iter = seq->private;
> + struct fib_table *tb;
> +
> + rcu_read_lock();
> + tb = fib_get_table(iter->p.net, RT_TABLE_MAIN);
> + if (!tb)
> + return NULL;
> +
> + iter->main_trie = (struct trie *) tb->tb_data;
> + if (*pos == 0)
> + return SEQ_START_TOKEN;
> + else
> + return fib_route_get_idx(iter, *pos - 1);
> +}
> +
> +static void *fib_route_seq_next(struct seq_file *seq, void *v, loff_t *pos)
> +{
> + struct fib_route_iter *iter = seq->private;
> + struct leaf *l = v;
> +
> + ++*pos;
> + if (v == SEQ_START_TOKEN) {
> + iter->pos = 0;
> + l = trie_firstleaf(iter->main_trie);
> + } else {
> + iter->pos++;
> + l = trie_nextleaf(l);
> + }
> +
> + if (l)
> + iter->key = l->key;
> + else
> + iter->pos = 0;
> + return l;
> +}
> +
> +static void fib_route_seq_stop(struct seq_file *seq, void *v)
> + __releases(RCU)
> +{
> + rcu_read_unlock();
> +}
> +
> static unsigned fib_flag_trans(int type, __be32 mask, const struct fib_info *fi)
> {
> static unsigned type2flags[RTN_MAX + 1] = {
> @@ -2482,7 +2560,6 @@ static unsigned fib_flag_trans(int type, __be32 mask, const struct fib_info *fi)
> */
> static int fib_route_seq_show(struct seq_file *seq, void *v)
> {
> - const struct fib_trie_iter *iter = seq->private;
> struct leaf *l = v;
> struct leaf_info *li;
> struct hlist_node *node;
> @@ -2494,12 +2571,6 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
> return 0;
> }
>
> - if (iter->trie == iter->trie_local)
> - return 0;
> -
> - if (IS_TNODE(l))
> - return 0;
> -
> hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
> struct fib_alias *fa;
> __be32 mask, prefix;
> @@ -2542,16 +2613,16 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
> }
>
> static const struct seq_operations fib_route_seq_ops = {
> - .start = fib_trie_seq_start,
> - .next = fib_trie_seq_next,
> - .stop = fib_trie_seq_stop,
> + .start = fib_route_seq_start,
> + .next = fib_route_seq_next,
> + .stop = fib_route_seq_stop,
> .show = fib_route_seq_show,
> };
>
> static int fib_route_seq_open(struct inode *inode, struct file *file)
> {
> return seq_open_net(inode, file, &fib_route_seq_ops,
> - sizeof(struct fib_trie_iter));
> + sizeof(struct fib_route_iter));
> }
>
> static const struct file_operations fib_route_fops = {
> --
> 1.5.3.8
>
^ permalink raw reply
* Re: [PATCH 1/2] fib_trie: handle empty tree
From: David Miller @ 2008-02-12 5:14 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20080211171250.60ad7bc5@extreme>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 11 Feb 2008 17:12:50 -0800
> To: David S. Miller <davem@davemloft.net>
When a user's name has "special" characters such as a "." as mine
does, it must be surrounded by double-quotes or else it is a syntax
error by SMTP rules. For this reason your patch postings were
rejected by vger.kernel.org
> This fixes possible problems when trie_firstleaf() returns NULL
> to trie_leafindex().
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks Stephen.
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index f5fba3f..2d89527 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -1762,11 +1762,9 @@ static struct leaf *trie_leafindex(struct trie *t, int index)
> {
> struct leaf *l = trie_firstleaf(t);
>
> - while (index-- > 0) {
> + while (l && index-- > 0)
> l = trie_nextleaf(l);
> - if (!l)
> - break;
> - }
> +
> return l;
> }
>
> --
> 1.5.3.8
>
^ permalink raw reply
* [PATCH] [RFC] Smack: unlabeled outgoing ambient packets - v2
From: Casey Schaufler @ 2008-02-12 0:00 UTC (permalink / raw)
To: paul.moore; +Cc: netdev, linux-kernel
From: Casey Schaufler <casey@schaufler-ca.com>
Smack uses CIPSO labeling, but allows for unlabeled packets
by specifying an "ambient" label that is applied to incoming
unlabeled packets. Because the other end of the connection
may dislike IP options, and ssh is one know application that
behaves thus, it is prudent to respond in kind. This patch
changes the network labeling behavior such that an outgoing
packet that would be given a CIPSO label that matches the
ambient label is left unlabeled. An "unlbl" domain is added
and the netlabel defaulting mechanism invoked rather than
assuming that everything is CIPSO. Locking has been added
around changes to the ambient label as the mechanisms used
to do so are more involved.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
---
This patch differs significantly from the previous version.
I think that I am using the netlbl interfaces more appropriately,
Paul, please let me know if there's a better approach.
It's inconvenient that netlbl_sock_setattr frees the domain passed.
I see that it makes sense for SELinux with the way SELinux treats
secctx's, but Smack is more careful about memory usage and I have
to do what I consider a gratuitous kalloc because of this behavior.
Would you be open to a patch to change this if it included the SELinux
changes?
Thank you.
security/smack/smack_lsm.c | 20 ++++++------
security/smack/smackfs.c | 54 +++++++++++++++++++++++++----------
2 files changed, 49 insertions(+), 25 deletions(-)
diff -uprN -X linux-2.6.25-g0210-base//Documentation/dontdiff linux-2.6.25-g0210-base/security/smack/smackfs.c linux-2.6.25-g0210/security/smack/smackfs.c
--- linux-2.6.25-g0210-base/security/smack/smackfs.c 2008-02-10 19:30:47.000000000 -0800
+++ linux-2.6.25-g0210/security/smack/smackfs.c 2008-02-11 07:14:54.000000000 -0800
@@ -45,6 +45,7 @@ enum smk_inos {
*/
static DEFINE_MUTEX(smack_list_lock);
static DEFINE_MUTEX(smack_cipso_lock);
+static DEFINE_MUTEX(smack_ambient_lock);
/*
* This is the "ambient" label for network traffic.
@@ -363,6 +364,27 @@ void smk_cipso_doi(void)
__func__, __LINE__, rc);
}
+/**
+ * smk_unlbl_ambient - initialize the unlabeled domain
+ */
+void smk_unlbl_ambient(char *oldambient)
+{
+ int rc;
+ struct netlbl_audit audit_info;
+
+ if (oldambient != NULL) {
+ rc = netlbl_cfg_map_del(oldambient, &audit_info);
+ if (rc != 0)
+ printk(KERN_WARNING "%s:%d remove rc = %d\n",
+ __func__, __LINE__, rc);
+ }
+
+ rc = netlbl_cfg_unlbl_add_map(smack_net_ambient, &audit_info);
+ if (rc != 0)
+ printk(KERN_WARNING "%s:%d add rc = %d\n",
+ __func__, __LINE__, rc);
+}
+
/*
* Seq_file read operations for /smack/cipso
*/
@@ -709,7 +731,6 @@ static ssize_t smk_read_ambient(struct f
size_t cn, loff_t *ppos)
{
ssize_t rc;
- char out[SMK_LABELLEN];
int asize;
if (*ppos != 0)
@@ -717,23 +738,18 @@ static ssize_t smk_read_ambient(struct f
/*
* Being careful to avoid a problem in the case where
* smack_net_ambient gets changed in midstream.
- * Since smack_net_ambient is always set with a value
- * from the label list, including initially, and those
- * never get freed, the worst case is that the pointer
- * gets changed just after this strncpy, in which case
- * the value passed up is incorrect. Locking around
- * smack_net_ambient wouldn't be any better than this
- * copy scheme as by the time the caller got to look
- * at the ambient value it would have cleared the lock
- * and been changed.
*/
- strncpy(out, smack_net_ambient, SMK_LABELLEN);
- asize = strlen(out) + 1;
+ mutex_lock(&smack_ambient_lock);
- if (cn < asize)
- return -EINVAL;
+ asize = strlen(smack_net_ambient) + 1;
- rc = simple_read_from_buffer(buf, cn, ppos, out, asize);
+ if (cn >= asize)
+ rc = simple_read_from_buffer(buf, cn, ppos,
+ smack_net_ambient, asize);
+ else
+ rc = -EINVAL;
+
+ mutex_unlock(&smack_ambient_lock);
return rc;
}
@@ -751,6 +767,7 @@ static ssize_t smk_write_ambient(struct
size_t count, loff_t *ppos)
{
char in[SMK_LABELLEN];
+ char *oldambient;
char *smack;
if (!capable(CAP_MAC_ADMIN))
@@ -766,7 +783,13 @@ static ssize_t smk_write_ambient(struct
if (smack == NULL)
return -EINVAL;
+ mutex_lock(&smack_ambient_lock);
+
+ oldambient = smack_net_ambient;
smack_net_ambient = smack;
+ smk_unlbl_ambient(oldambient);
+
+ mutex_unlock(&smack_ambient_lock);
return count;
}
@@ -974,6 +997,7 @@ static int __init init_smk_fs(void)
sema_init(&smack_write_sem, 1);
smk_cipso_doi();
+ smk_unlbl_ambient(NULL);
return err;
}
diff -uprN -X linux-2.6.25-g0210-base//Documentation/dontdiff linux-2.6.25-g0210-base/security/smack/smack_lsm.c linux-2.6.25-g0210/security/smack/smack_lsm.c
--- linux-2.6.25-g0210-base/security/smack/smack_lsm.c 2008-02-10 19:30:47.000000000 -0800
+++ linux-2.6.25-g0210/security/smack/smack_lsm.c 2008-02-10 20:10:47.000000000 -0800
@@ -1251,7 +1251,7 @@ static void smack_to_secattr(char *smack
switch (smack_net_nltype) {
case NETLBL_NLTYPE_CIPSOV4:
- nlsp->domain = NULL;
+ nlsp->domain = kstrdup(smack, GFP_ATOMIC);
nlsp->flags = NETLBL_SECATTR_DOMAIN;
nlsp->flags |= NETLBL_SECATTR_MLS_LVL;
@@ -1276,21 +1276,21 @@ static void smack_to_secattr(char *smack
* Convert the outbound smack value (smk_out) to a
* secattr and attach it to the socket.
*
- * Returns 0 on success or an error code
+ * The return from netlbl_sock_setattr is ignored because
+ * the defaulting label behavior provided by netlbl takes
+ * care of the error cases.
*/
-static int smack_netlabel(struct sock *sk)
+static void smack_netlabel(struct sock *sk)
{
struct socket_smack *ssp = sk->sk_security;
struct netlbl_lsm_secattr secattr;
- int rc = 0;
+ int rc;
netlbl_secattr_init(&secattr);
smack_to_secattr(ssp->smk_out, &secattr);
if (secattr.flags != NETLBL_SECATTR_NONE)
rc = netlbl_sock_setattr(sk, &secattr);
-
netlbl_secattr_destroy(&secattr);
- return rc;
}
/**
@@ -1340,7 +1340,7 @@ static int smack_inode_setsecurity(struc
ssp->smk_in = sp;
else if (strcmp(name, XATTR_SMACK_IPOUT) == 0) {
ssp->smk_out = sp;
- return smack_netlabel(sock->sk);
+ smack_netlabel(sock->sk);
} else
return -EOPNOTSUPP;
@@ -1367,7 +1367,8 @@ static int smack_socket_post_create(stru
/*
* Set the outbound netlbl.
*/
- return smack_netlabel(sock->sk);
+ smack_netlabel(sock->sk);
+ return 0;
}
/**
@@ -2199,7 +2200,6 @@ static int smack_socket_getpeersec_dgram
static void smack_sock_graft(struct sock *sk, struct socket *parent)
{
struct socket_smack *ssp;
- int rc;
if (sk == NULL)
return;
@@ -2212,7 +2212,7 @@ static void smack_sock_graft(struct sock
ssp->smk_out = current->security;
ssp->smk_packet[0] = '\0';
- rc = smack_netlabel(sk);
+ smack_netlabel(sk);
}
/**
^ permalink raw reply
* [PATCH]: Remove IP_TOS privilege checks
From: David Miller @ 2008-02-12 2:03 UTC (permalink / raw)
To: netdev
I've committing the following upstream, for the reasons outlined in
the commit message.
These DSCP value meanings are advisory and the kernel is not the
entity to enforce what values mean. This change makes us behave
consistently with BSD and with our own IPV6 implementation, yet
without breaking existing setups.
[IPV4]: Remove IP_TOS setting privilege checks.
Various RFCs have all sorts of things to say about the CS field of the
DSCP value. In particular they try to make the distinction between
values that should be used by "user applications" and things like
routing daemons.
This seems to have influenced the CAP_NET_ADMIN check which exists for
IP_TOS socket option settings, but in fact it has an off-by-one error
so it wasn't allowing CS5 which is meant for "user applications" as
well.
Further adding to the inconsistency and brokenness here, IPV6 does not
validate the DSCP values specified for the IPV6_TCLASS socket option.
The real actual uses of these TOS values are system specific in the
final analysis, and these RFC recommendations are just that, "a
recommendation". In fact the standards very purposefully use
"SHOULD" and "SHOULD NOT" when describing how these values can be
used.
In the final analysis the only clean way to provide consistency here
is to remove the CAP_NET_ADMIN check. The alternatives just don't
work out:
1) If we add the CAP_NET_ADMIN check to ipv6, this can break existing
setups.
2) If we just fix the off-by-one error in the class comparison in
IPV4, certain DSCP values can be used in IPV6 but not IPV4 by
default. So people will just ask for a sysctl asking to
override that.
I checked several other freely available kernel trees and they
do not make any privilege checks in this area like we do. For
the BSD stacks, this goes back all the way to Stevens Volume 2
and beyond.
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 754b0a5..de0572c 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -514,11 +514,6 @@ static int do_ip_setsockopt(struct sock *sk, int level,
val &= ~3;
val |= inet->tos & 3;
}
- if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP &&
- !capable(CAP_NET_ADMIN)) {
- err = -EPERM;
- break;
- }
if (inet->tos != val) {
inet->tos = val;
sk->sk_priority = rt_tos2priority(val);
^ permalink raw reply related
* [PATCH 2.6.25] ixgbe/igb: correctly obtain protocol information on transmit
From: Andy Gospodarek @ 2008-02-12 1:35 UTC (permalink / raw)
To: Auke Kok, netdev
I noticed a strange panic on a box with an ixgbe-based interface when
using bridging. Protocol information ought to come from the frame
itself rather than anywhere else.
The igb driver has a similar coding error that would cause incorrect
flags to be set, so it would not panic. It should still get fixed
though.
Checking the frame's payload on both drivers seems like a better
option.
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
igb/igb_main.c | 3 ++-
ixgbe/ixgbe_main.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index f3c144d..5572923 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2514,9 +2514,10 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT);
if (skb->ip_summed == CHECKSUM_PARTIAL) {
+ struct iphdr *iph = ip_hdr(skb);
if (skb->protocol == htons(ETH_P_IP))
tu_cmd |= E1000_ADVTXD_TUCMD_IPV4;
- if (skb->sk && (skb->sk->sk_protocol == IPPROTO_TCP))
+ if (iph->protocol == IPPROTO_TCP)
tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 3732dd6..4542870 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2202,10 +2202,11 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter,
IXGBE_ADVTXD_DTYP_CTXT);
if (skb->ip_summed == CHECKSUM_PARTIAL) {
+ struct iphdr *iph = ip_hdr(skb);
if (skb->protocol == htons(ETH_P_IP))
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4;
- if (skb->sk->sk_protocol == IPPROTO_TCP)
+ if (iph->protocol == IPPROTO_TCP)
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP;
}
^ permalink raw reply related
* [PATCH 4/4] docbook: make a networking book and fix a few errors
From: Randy Dunlap @ 2008-02-12 1:28 UTC (permalink / raw)
To: lkml; +Cc: netdev, davem, akpm
From: Randy Dunlap <randy.dunlap@oracle.com>
Move networking (core and drivers) docbook to its own networking book.
Fix a few kernel-doc errors in header and source files.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
Documentation/DocBook/Makefile | 2
Documentation/DocBook/kernel-api.tmpl | 65 --------------------
Documentation/DocBook/networking.tmpl | 106 ++++++++++++++++++++++++++++++++++
include/linux/etherdevice.h | 3
net/core/dev.c | 3
net/core/skbuff.c | 4 -
6 files changed, 111 insertions(+), 72 deletions(-)
--- linux-2.6.25-rc1.orig/include/linux/etherdevice.h
+++ linux-2.6.25-rc1/include/linux/etherdevice.h
@@ -70,8 +70,7 @@ static inline int is_multicast_ether_add
}
/**
- * is_local_ether_addr - Determine if the Ethernet address is locally-assigned
- * one (IEEE 802).
+ * is_local_ether_addr - Determine if the Ethernet address is locally-assigned one (IEEE 802).
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is a local address.
--- linux-2.6.25-rc1.orig/net/core/dev.c
+++ linux-2.6.25-rc1/net/core/dev.c
@@ -3038,8 +3038,7 @@ int dev_unicast_sync(struct net_device *
EXPORT_SYMBOL(dev_unicast_sync);
/**
- * dev_unicast_unsync - Remove synchronized addresses from the destination
- * device
+ * dev_unicast_unsync - Remove synchronized addresses from the destination device
* @to: destination device
* @from: source device
*
--- linux-2.6.25-rc1.orig/net/core/skbuff.c
+++ linux-2.6.25-rc1/net/core/skbuff.c
@@ -1907,11 +1907,11 @@ void skb_prepare_seq_read(struct sk_buff
* of bytes already consumed and the next call to
* skb_seq_read() will return the remaining part of the block.
*
- * Note: The size of each block of data returned can be arbitary,
+ * Note 1: The size of each block of data returned can be arbitary,
* this limitation is the cost for zerocopy seqeuental
* reads of potentially non linear data.
*
- * Note: Fragment lists within fragments are not implemented
+ * Note 2: Fragment lists within fragments are not implemented
* at the moment, state->root_skb could be replaced with
* a stack for this purpose.
*/
--- linux-2.6.25-rc1.orig/Documentation/DocBook/Makefile
+++ linux-2.6.25-rc1/Documentation/DocBook/Makefile
@@ -8,7 +8,7 @@
DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
- procfs-guide.xml writing_usb_driver.xml \
+ procfs-guide.xml writing_usb_driver.xml networking.xml \
kernel-api.xml filesystems.xml lsm.xml usb.xml \
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml
--- /dev/null
+++ linux-2.6.25-rc1/Documentation/DocBook/networking.tmpl
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
+
+<book id="LinuxNetworking">
+ <bookinfo>
+ <title>Linux Networking and Network Devices APIs</title>
+
+ <legalnotice>
+ <para>
+ This documentation is free software; you can redistribute
+ it and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+ </para>
+
+ <para>
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ </para>
+
+ <para>
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307 USA
+ </para>
+
+ <para>
+ For more details see the file COPYING in the source
+ distribution of Linux.
+ </para>
+ </legalnotice>
+ </bookinfo>
+
+<toc></toc>
+
+ <chapter id="netcore">
+ <title>Linux Networking</title>
+ <sect1><title>Networking Base Types</title>
+!Iinclude/linux/net.h
+ </sect1>
+ <sect1><title>Socket Buffer Functions</title>
+!Iinclude/linux/skbuff.h
+!Iinclude/net/sock.h
+!Enet/socket.c
+!Enet/core/skbuff.c
+!Enet/core/sock.c
+!Enet/core/datagram.c
+!Enet/core/stream.c
+ </sect1>
+ <sect1><title>Socket Filter</title>
+!Enet/core/filter.c
+ </sect1>
+ <sect1><title>Generic Network Statistics</title>
+!Iinclude/linux/gen_stats.h
+!Enet/core/gen_stats.c
+!Enet/core/gen_estimator.c
+ </sect1>
+ <sect1><title>SUN RPC subsystem</title>
+<!-- The !D functionality is not perfect, garbage has to be protected by comments
+!Dnet/sunrpc/sunrpc_syms.c
+-->
+!Enet/sunrpc/xdr.c
+!Enet/sunrpc/svc_xprt.c
+!Enet/sunrpc/xprt.c
+!Enet/sunrpc/sched.c
+!Enet/sunrpc/socklib.c
+!Enet/sunrpc/stats.c
+!Enet/sunrpc/rpc_pipe.c
+!Enet/sunrpc/rpcb_clnt.c
+!Enet/sunrpc/clnt.c
+ </sect1>
+ </chapter>
+
+ <chapter id="netdev">
+ <title>Network device support</title>
+ <sect1><title>Driver Support</title>
+!Enet/core/dev.c
+!Enet/ethernet/eth.c
+!Enet/sched/sch_generic.c
+!Iinclude/linux/etherdevice.h
+!Iinclude/linux/netdevice.h
+ </sect1>
+ <sect1><title>PHY Support</title>
+!Edrivers/net/phy/phy.c
+!Idrivers/net/phy/phy.c
+!Edrivers/net/phy/phy_device.c
+!Idrivers/net/phy/phy_device.c
+!Edrivers/net/phy/mdio_bus.c
+!Idrivers/net/phy/mdio_bus.c
+ </sect1>
+<!-- FIXME: Removed for now since no structured comments in source
+ <sect1><title>Wireless</title>
+X!Enet/core/wireless.c
+ </sect1>
+-->
+ <sect1><title>Synchronous PPP</title>
+!Edrivers/net/wan/syncppp.c
+ </sect1>
+ </chapter>
+
+</book>
--- linux-2.6.25-rc1.orig/Documentation/DocBook/kernel-api.tmpl
+++ linux-2.6.25-rc1/Documentation/DocBook/kernel-api.tmpl
@@ -204,71 +204,6 @@ X!Ilib/string.c
</sect1>
</chapter>
- <chapter id="netcore">
- <title>Linux Networking</title>
- <sect1><title>Networking Base Types</title>
-!Iinclude/linux/net.h
- </sect1>
- <sect1><title>Socket Buffer Functions</title>
-!Iinclude/linux/skbuff.h
-!Iinclude/net/sock.h
-!Enet/socket.c
-!Enet/core/skbuff.c
-!Enet/core/sock.c
-!Enet/core/datagram.c
-!Enet/core/stream.c
- </sect1>
- <sect1><title>Socket Filter</title>
-!Enet/core/filter.c
- </sect1>
- <sect1><title>Generic Network Statistics</title>
-!Iinclude/linux/gen_stats.h
-!Enet/core/gen_stats.c
-!Enet/core/gen_estimator.c
- </sect1>
- <sect1><title>SUN RPC subsystem</title>
-<!-- The !D functionality is not perfect, garbage has to be protected by comments
-!Dnet/sunrpc/sunrpc_syms.c
--->
-!Enet/sunrpc/xdr.c
-!Enet/sunrpc/svc_xprt.c
-!Enet/sunrpc/xprt.c
-!Enet/sunrpc/sched.c
-!Enet/sunrpc/socklib.c
-!Enet/sunrpc/stats.c
-!Enet/sunrpc/rpc_pipe.c
-!Enet/sunrpc/rpcb_clnt.c
-!Enet/sunrpc/clnt.c
- </sect1>
- </chapter>
-
- <chapter id="netdev">
- <title>Network device support</title>
- <sect1><title>Driver Support</title>
-!Enet/core/dev.c
-!Enet/ethernet/eth.c
-!Enet/sched/sch_generic.c
-!Iinclude/linux/etherdevice.h
-!Iinclude/linux/netdevice.h
- </sect1>
- <sect1><title>PHY Support</title>
-!Edrivers/net/phy/phy.c
-!Idrivers/net/phy/phy.c
-!Edrivers/net/phy/phy_device.c
-!Idrivers/net/phy/phy_device.c
-!Edrivers/net/phy/mdio_bus.c
-!Idrivers/net/phy/mdio_bus.c
- </sect1>
-<!-- FIXME: Removed for now since no structured comments in source
- <sect1><title>Wireless</title>
-X!Enet/core/wireless.c
- </sect1>
--->
- <sect1><title>Synchronous PPP</title>
-!Edrivers/net/wan/syncppp.c
- </sect1>
- </chapter>
-
<chapter id="modload">
<title>Module Support</title>
<sect1><title>Module Loading</title>
^ permalink raw reply
* [PATCH 2/4] docbook: sunrpc filenames and notation fixes
From: Randy Dunlap @ 2008-02-12 1:28 UTC (permalink / raw)
To: lkml; +Cc: netdev, davem, akpm
From: Randy Dunlap <randy.dunlap@oracle.com>
Use updated file list for docbook files and
fix kernel-doc warnings in sunrpc:
Warning(linux-2.6.24-git12//net/sunrpc/rpc_pipe.c:689): No description found for parameter 'rpc_client'
Warning(linux-2.6.24-git12//net/sunrpc/rpc_pipe.c:765): No description found for parameter 'flags'
Warning(linux-2.6.24-git12//net/sunrpc/clnt.c:584): No description found for parameter 'tk_ops'
Warning(linux-2.6.24-git12//net/sunrpc/clnt.c:618): No description found for parameter 'bufsize'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
Documentation/DocBook/kernel-api.tmpl | 8 +++++++-
net/sunrpc/clnt.c | 10 +++++-----
net/sunrpc/rpc_pipe.c | 3 ++-
net/sunrpc/xprt.c | 2 +-
4 files changed, 15 insertions(+), 8 deletions(-)
--- linux-2.6.25-rc1.orig/Documentation/DocBook/kernel-api.tmpl
+++ linux-2.6.25-rc1/Documentation/DocBook/kernel-api.tmpl
@@ -231,8 +231,14 @@ X!Ilib/string.c
!Dnet/sunrpc/sunrpc_syms.c
-->
!Enet/sunrpc/xdr.c
-!Enet/sunrpc/svcsock.c
+!Enet/sunrpc/svc_xprt.c
+!Enet/sunrpc/xprt.c
!Enet/sunrpc/sched.c
+!Enet/sunrpc/socklib.c
+!Enet/sunrpc/stats.c
+!Enet/sunrpc/rpc_pipe.c
+!Enet/sunrpc/rpcb_clnt.c
+!Enet/sunrpc/clnt.c
</sect1>
</chapter>
--- linux-2.6.25-rc1.orig/net/sunrpc/clnt.c
+++ linux-2.6.25-rc1/net/sunrpc/clnt.c
@@ -464,9 +464,9 @@ rpc_release_client(struct rpc_clnt *clnt
/**
* rpc_bind_new_program - bind a new RPC program to an existing client
- * @old - old rpc_client
- * @program - rpc program to set
- * @vers - rpc program version
+ * @old: old rpc_client
+ * @program: rpc program to set
+ * @vers: rpc program version
*
* Clones the rpc client and sets up a new RPC program. This is mainly
* of use for enabling different RPC programs to share the same transport.
@@ -575,7 +575,7 @@ EXPORT_SYMBOL_GPL(rpc_call_sync);
* @clnt: pointer to RPC client
* @msg: RPC call parameters
* @flags: RPC call flags
- * @ops: RPC call ops
+ * @tk_ops: RPC call ops
* @data: user call data
*/
int
@@ -610,7 +610,7 @@ EXPORT_SYMBOL_GPL(rpc_call_start);
* rpc_peeraddr - extract remote peer address from clnt's xprt
* @clnt: RPC client structure
* @buf: target buffer
- * @size: length of target buffer
+ * @bufsize: length of target buffer
*
* Returns the number of bytes that are actually in the stored address.
*/
--- linux-2.6.25-rc1.orig/net/sunrpc/xprt.c
+++ linux-2.6.25-rc1/net/sunrpc/xprt.c
@@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(xprt_register_transpor
/**
* xprt_unregister_transport - unregister a transport implementation
- * transport: transport to unregister
+ * @transport: transport to unregister
*
* Returns:
* 0: transport successfully unregistered
--- linux-2.6.25-rc1.orig/net/sunrpc/rpc_pipe.c
+++ linux-2.6.25-rc1/net/sunrpc/rpc_pipe.c
@@ -677,7 +677,7 @@ rpc_lookup_negative(char *path, struct n
/**
* rpc_mkdir - Create a new directory in rpc_pipefs
* @path: path from the rpc_pipefs root to the new directory
- * @rpc_clnt: rpc client to associate with this directory
+ * @rpc_client: rpc client to associate with this directory
*
* This creates a directory at the given @path associated with
* @rpc_clnt, which will contain a file named "info" with some basic
@@ -748,6 +748,7 @@ rpc_rmdir(struct dentry *dentry)
* @private: private data to associate with the pipe, for the caller's use
* @ops: operations defining the behavior of the pipe: upcall, downcall,
* release_pipe, and destroy_msg.
+ * @flags: rpc_inode flags
*
* Data is made available for userspace to read by calls to
* rpc_queue_upcall(). The actual reads will result in calls to
^ permalink raw reply
* [PATCH] [RFC] Smack: unlabeled outgoing ambient packets - v2
From: Casey Schaufler @ 2008-02-11 18:29 UTC (permalink / raw)
To: paul.moore; +Cc: linux-kernel, netdev
From: Casey Schaufler <casey@schaufler-ca.com>
Smack uses CIPSO labeling, but allows for unlabeled packets
by specifying an "ambient" label that is applied to incoming
unlabeled packets. Because the other end of the connection
may dislike IP options, and ssh is one know application that
behaves thus, it is prudent to respond in kind. This patch
changes the network labeling behavior such that an outgoing
packet that would be given a CIPSO label that matches the
ambient label is left unlabeled. An "unlbl" domain is added
and the netlabel defaulting mechanism invoked rather than
assuming that everything is CIPSO. Locking has been added
around changes to the ambient label as the mechanisms used
to do so are more involved.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
---
This patch differs significantly from the previous version.
I think that I am using the netlbl interfaces more appropriately,
Paul, please let me know if there's a better approach.
It's inconvenient that netlbl_sock_setattr frees the domain passed.
I see that it makes sense for SELinux with the way SELinux treats
secctx's, but Smack is more careful about memory usage and I have
to do what I consider a gratuitous kalloc because of this behavior.
Would you be open to a patch to change this if it included the SELinux
changes?
Thank you.
security/smack/smack_lsm.c | 20 ++++++------
security/smack/smackfs.c | 54 +++++++++++++++++++++++++----------
2 files changed, 49 insertions(+), 25 deletions(-)
diff -uprN -X linux-2.6.25-g0210-base//Documentation/dontdiff linux-2.6.25-g0210-base/security/smack/smackfs.c linux-2.6.25-g0210/security/smack/smackfs.c
--- linux-2.6.25-g0210-base/security/smack/smackfs.c 2008-02-10 19:30:47.000000000 -0800
+++ linux-2.6.25-g0210/security/smack/smackfs.c 2008-02-11 07:14:54.000000000 -0800
@@ -45,6 +45,7 @@ enum smk_inos {
*/
static DEFINE_MUTEX(smack_list_lock);
static DEFINE_MUTEX(smack_cipso_lock);
+static DEFINE_MUTEX(smack_ambient_lock);
/*
* This is the "ambient" label for network traffic.
@@ -363,6 +364,27 @@ void smk_cipso_doi(void)
__func__, __LINE__, rc);
}
+/**
+ * smk_unlbl_ambient - initialize the unlabeled domain
+ */
+void smk_unlbl_ambient(char *oldambient)
+{
+ int rc;
+ struct netlbl_audit audit_info;
+
+ if (oldambient != NULL) {
+ rc = netlbl_cfg_map_del(oldambient, &audit_info);
+ if (rc != 0)
+ printk(KERN_WARNING "%s:%d remove rc = %d\n",
+ __func__, __LINE__, rc);
+ }
+
+ rc = netlbl_cfg_unlbl_add_map(smack_net_ambient, &audit_info);
+ if (rc != 0)
+ printk(KERN_WARNING "%s:%d add rc = %d\n",
+ __func__, __LINE__, rc);
+}
+
/*
* Seq_file read operations for /smack/cipso
*/
@@ -709,7 +731,6 @@ static ssize_t smk_read_ambient(struct f
size_t cn, loff_t *ppos)
{
ssize_t rc;
- char out[SMK_LABELLEN];
int asize;
if (*ppos != 0)
@@ -717,23 +738,18 @@ static ssize_t smk_read_ambient(struct f
/*
* Being careful to avoid a problem in the case where
* smack_net_ambient gets changed in midstream.
- * Since smack_net_ambient is always set with a value
- * from the label list, including initially, and those
- * never get freed, the worst case is that the pointer
- * gets changed just after this strncpy, in which case
- * the value passed up is incorrect. Locking around
- * smack_net_ambient wouldn't be any better than this
- * copy scheme as by the time the caller got to look
- * at the ambient value it would have cleared the lock
- * and been changed.
*/
- strncpy(out, smack_net_ambient, SMK_LABELLEN);
- asize = strlen(out) + 1;
+ mutex_lock(&smack_ambient_lock);
- if (cn < asize)
- return -EINVAL;
+ asize = strlen(smack_net_ambient) + 1;
- rc = simple_read_from_buffer(buf, cn, ppos, out, asize);
+ if (cn >= asize)
+ rc = simple_read_from_buffer(buf, cn, ppos,
+ smack_net_ambient, asize);
+ else
+ rc = -EINVAL;
+
+ mutex_unlock(&smack_ambient_lock);
return rc;
}
@@ -751,6 +767,7 @@ static ssize_t smk_write_ambient(struct
size_t count, loff_t *ppos)
{
char in[SMK_LABELLEN];
+ char *oldambient;
char *smack;
if (!capable(CAP_MAC_ADMIN))
@@ -766,7 +783,13 @@ static ssize_t smk_write_ambient(struct
if (smack == NULL)
return -EINVAL;
+ mutex_lock(&smack_ambient_lock);
+
+ oldambient = smack_net_ambient;
smack_net_ambient = smack;
+ smk_unlbl_ambient(oldambient);
+
+ mutex_unlock(&smack_ambient_lock);
return count;
}
@@ -974,6 +997,7 @@ static int __init init_smk_fs(void)
sema_init(&smack_write_sem, 1);
smk_cipso_doi();
+ smk_unlbl_ambient(NULL);
return err;
}
diff -uprN -X linux-2.6.25-g0210-base//Documentation/dontdiff linux-2.6.25-g0210-base/security/smack/smack_lsm.c linux-2.6.25-g0210/security/smack/smack_lsm.c
--- linux-2.6.25-g0210-base/security/smack/smack_lsm.c 2008-02-10 19:30:47.000000000 -0800
+++ linux-2.6.25-g0210/security/smack/smack_lsm.c 2008-02-10 20:10:47.000000000 -0800
@@ -1251,7 +1251,7 @@ static void smack_to_secattr(char *smack
switch (smack_net_nltype) {
case NETLBL_NLTYPE_CIPSOV4:
- nlsp->domain = NULL;
+ nlsp->domain = kstrdup(smack, GFP_ATOMIC);
nlsp->flags = NETLBL_SECATTR_DOMAIN;
nlsp->flags |= NETLBL_SECATTR_MLS_LVL;
@@ -1276,21 +1276,21 @@ static void smack_to_secattr(char *smack
* Convert the outbound smack value (smk_out) to a
* secattr and attach it to the socket.
*
- * Returns 0 on success or an error code
+ * The return from netlbl_sock_setattr is ignored because
+ * the defaulting label behavior provided by netlbl takes
+ * care of the error cases.
*/
-static int smack_netlabel(struct sock *sk)
+static void smack_netlabel(struct sock *sk)
{
struct socket_smack *ssp = sk->sk_security;
struct netlbl_lsm_secattr secattr;
- int rc = 0;
+ int rc;
netlbl_secattr_init(&secattr);
smack_to_secattr(ssp->smk_out, &secattr);
if (secattr.flags != NETLBL_SECATTR_NONE)
rc = netlbl_sock_setattr(sk, &secattr);
-
netlbl_secattr_destroy(&secattr);
- return rc;
}
/**
@@ -1340,7 +1340,7 @@ static int smack_inode_setsecurity(struc
ssp->smk_in = sp;
else if (strcmp(name, XATTR_SMACK_IPOUT) == 0) {
ssp->smk_out = sp;
- return smack_netlabel(sock->sk);
+ smack_netlabel(sock->sk);
} else
return -EOPNOTSUPP;
@@ -1367,7 +1367,8 @@ static int smack_socket_post_create(stru
/*
* Set the outbound netlbl.
*/
- return smack_netlabel(sock->sk);
+ smack_netlabel(sock->sk);
+ return 0;
}
/**
@@ -2199,7 +2200,6 @@ static int smack_socket_getpeersec_dgram
static void smack_sock_graft(struct sock *sk, struct socket *parent)
{
struct socket_smack *ssp;
- int rc;
if (sk == NULL)
return;
@@ -2212,7 +2212,7 @@ static void smack_sock_graft(struct sock
ssp->smk_out = current->security;
ssp->smk_packet[0] = '\0';
- rc = smack_netlabel(sk);
+ smack_netlabel(sk);
}
/**
^ permalink raw reply
* Re: [PATCH] fib_trie: rcu_assign_pointer warning fix
From: Paul E. McKenney @ 2008-02-12 1:27 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, netdev
In-Reply-To: <20080211165954.2f1b3a9b@extreme>
On Mon, Feb 11, 2008 at 04:59:54PM -0800, Stephen Hemminger wrote:
> Eliminate warnings when rcu_assign_pointer is used with unsigned long.
> It is reasonable to use RCU with non-pointer values so allow it for general
> use. Add a comment to explain the if test.
Good catch!!! (An apologies for the hassle!!!)
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> ---
> include/linux/rcupdate.h | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 37a642c..c44ac87 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -172,14 +172,15 @@ struct rcu_head {
> * structure after the pointer assignment. More importantly, this
> * call documents which pointers will be dereferenced by RCU read-side
> * code.
> + *
> + * If value is the NULL (constant 0), then no barrier is needed.
> */
>
> -#define rcu_assign_pointer(p, v) \
> - ({ \
> - if (!__builtin_constant_p(v) || \
> - ((v) != NULL)) \
> - smp_wmb(); \
> - (p) = (v); \
> +#define rcu_assign_pointer(p, v) \
> + ({ \
> + if (!(__builtin_constant_p(v) && v)) \
> + smp_wmb(); \
> + (p) = (v); \
> })
>
> /**
> --
> 1.5.3.8
>
^ permalink raw reply
* Re: [Bugme-new] [Bug 9937] New: Bug in bonding driver - Kernel oops whenever driver is loaded with max_bonds parameter
From: Jay Vosburgh @ 2008-02-12 1:21 UTC (permalink / raw)
To: Andrew Morton; +Cc: netdev, bugme-daemon, kantica, stable
In-Reply-To: <20080211155608.b60858d7.akpm@linux-foundation.org>
Andrew Morton <akpm@linux-foundation.org> wrote:
>> Problem Description: Kernel oops whenever bonding driver with max_bonds=2 (or >
>> 2) is loaded ...
I believe this is fixed by the following (from linux-2.6):
From: Jay Vosburgh <fubar@us.ibm.com>
Date: Tue, 29 Jan 2008 18:07:45 -0800
Subject: [PATCH] bonding: fix NULL pointer deref in startup processing
Fix the "are we creating a duplicate" check to not compare
the name if the name is NULL (meaning that the system should select
a name). Bug reported by Benny Amorsen <benny+usenet@amorsen.dk>.
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/bonding/bond_main.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 65c7eba..81b4574 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4896,14 +4896,16 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
down_write(&bonding_rwsem);
/* Check to see if the bond already exists. */
- list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
- if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
- printk(KERN_ERR DRV_NAME
+ if (name) {
+ list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
+ if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
+ printk(KERN_ERR DRV_NAME
": cannot add bond %s; it already exists\n",
- name);
- res = -EPERM;
- goto out_rtnl;
- }
+ name);
+ res = -EPERM;
+ goto out_rtnl;
+ }
+ }
bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
ether_setup);
--
1.5.2.4
^ permalink raw reply related
* Re: [PATCH] fib_trie: rcu_assign_pointer warning fix
From: David Miller @ 2008-02-12 1:16 UTC (permalink / raw)
To: shemminger; +Cc: paulmck, netdev, linux-kernel
In-Reply-To: <20080211165954.2f1b3a9b@extreme>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 11 Feb 2008 16:59:54 -0800
linux-kernel added to CC:, any change to generic kernel infrastructure
should be posted there
> Eliminate warnings when rcu_assign_pointer is used with unsigned long.
> It is reasonable to use RCU with non-pointer values so allow it for general
> use. Add a comment to explain the if test.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> ---
> include/linux/rcupdate.h | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 37a642c..c44ac87 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -172,14 +172,15 @@ struct rcu_head {
> * structure after the pointer assignment. More importantly, this
> * call documents which pointers will be dereferenced by RCU read-side
> * code.
> + *
> + * If value is the NULL (constant 0), then no barrier is needed.
> */
>
> -#define rcu_assign_pointer(p, v) \
> - ({ \
> - if (!__builtin_constant_p(v) || \
> - ((v) != NULL)) \
> - smp_wmb(); \
> - (p) = (v); \
> +#define rcu_assign_pointer(p, v) \
> + ({ \
> + if (!(__builtin_constant_p(v) && v)) \
> + smp_wmb(); \
> + (p) = (v); \
> })
>
> /**
> --
> 1.5.3.8
>
^ permalink raw reply
* Re: [Bugme-new] [Bug 9937] New: Bug in bonding driver - Kernel oops whenever driver is loaded with max_bonds parameter
From: Andrew Morton @ 2008-02-11 23:56 UTC (permalink / raw)
To: netdev, Jay Vosburgh; +Cc: bugme-daemon, kantica
In-Reply-To: <bug-9937-10286@http.bugzilla.kernel.org/>
On Mon, 11 Feb 2008 15:04:03 -0800 (PST)
bugme-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=9937
>
> Summary: Bug in bonding driver - Kernel oops whenever driver is
> loaded with max_bonds parameter
> Product: Networking
> Version: 2.5
> KernelVersion: 2.6.24.2
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: high
> Priority: P1
> Component: IPV4
> AssignedTo: shemminger@linux-foundation.org
> ReportedBy: kantica@gmail.com
>
>
> Latest working kernel version:
> Earliest failing kernel version: 2.6.24.2
> Distribution: Slackware / Debian GNU/Linux
> Hardware Environment: HP ProLiant DL380 G5 (Debian), Slackware Acer TravelMate
> 4001 Laptop
> Software Environment:
> Problem Description: Kernel oops whenever bonding driver with max_bonds=2 (or >
> 2) is loaded ...
>
> Steps to reproduce:
>
> modprobe bonding mode=0 miimon=100 max_bonds=2
> or
> modprobe bonding max_bonds=2
>
>
> dmesg output (from slackware laptop / x86):
>
> BUG: unable to handle kernel NULL pointer dereference at virtual address
> 00000000
> printing eip: c028eeaf *pde = 00000000
> Oops: 0000 [#1] SMP
> Modules linked in: bonding snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq
> snd_seq_device snd_pcm_oss snd_mixer_oss ntfs pcmcia yenta_socket
> rsrc_nonstatic tifm_7xx1 tifm_core pcmcia_core snd_intel8x0 snd_ac97_codec
> ac97_bus snd_pcm i2c_i801 snd_timer snd i2c_core shpchp snd_page_alloc ehci_hcd
> uhci_hcd pci_hotplug
>
> Pid: 2729, comm: modprobe Not tainted (2.6.24.2 #2)
> EIP: 0060:[<c028eeaf>] EFLAGS: 00010282 CPU: 0
> EIP is at strnicmp+0x17/0x61
> EAX: d8162800 EBX: 00000000 ECX: 00000010 EDX: 00000062
> ESI: 00000010 EDI: 00000000 EBP: d8162801 ESP: d82c9f60
> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
> Process modprobe (pid: 2729, ti=d82c8000 task=df926550 task.ti=d82c8000)
> Stack: d8162c80 00000000 e0c76814 00000000 e0c67170 00000001 df80b700 e0c77180
> 00000001 00000000 0000000c d82c8000 e0afe05e e0c6ed14 e0c6ce70 e0c76c00
> 0805c098 0000000c c014e355 b7e7a008 0805c098 c0106f12 b7e7a008 00019477
> Call Trace:
> [<e0c67170>] bond_create+0x4a/0x162 [bonding]
> [<e0afe05e>] bonding_init+0x5e/0xf0 [bonding]
> [<c014e355>] sys_init_module+0x91/0x11b
> [<c0106f12>] syscall_call+0x7/0xb
> [<c0470000>] sctp_setsockopt_bindx+0xe8/0x127
> =======================
> Code: 08 fe dc ba 98 c7 40 0c 76 54 32 10 c7 40 10 f0 e1 d2 c3 c3 55 89 c5 57
> 89 d7 31 d2 56 89 ce 53 31 db 85 c9 74 42 0f b6 55 00 45 <0f> b6 1f 47 84 d2 74
> 35 84 db 74 31 38 da 74 2a 0f b6 c2 88 d1
> EIP: [<c028eeaf>] strnicmp+0x17/0x61 SS:ESP 0068:d82c9f60
> ---[ end trace 75761717808bf4ee ]---
>
> dmesg output (from Debian x86_64 - HP ProLiant DL380):
>
> Unable to handle kernel NULL pointer dereference at 0000000000000000 RIP:
> [<ffffffff8030271e>] strnicmp+0x12/0x5f
> PGD 223005067 PUD 223b22067 PMD 0
> Oops: 0000 [1] SMP
> CPU 7
> Modules linked in: bonding mptctl mptbase fan ac battery ipv6 dm_snapshot
> dm_mirror dm_mod loop usbhid ide_cd cdrom bnx2 generic thermal ipmi_si piix
> serio_raw evdev shpchp
> psmouse pci_hotplug container pcspkr ide_core ipmi_msghandler uhci_hcd button
> processor ehci_hcd e1000 ext3 jbd mbcache reiserfs cciss
> Pid: 12469, comm: modprobe Not tainted 2.6.24.2 #1
> RIP: 0010:[<ffffffff8030271e>] [<ffffffff8030271e>] strnicmp+0x12/0x5f
> RSP: 0018:ffff81022339fe00 EFLAGS: 00010202
> RAX: ffff81022307e6c0 RBX: ffffffff88233918 RCX: 00000000000020e7
> RDX: 0000000000000010 RSI: 0000000000000000 RDI: ffff81022307e000
> RBP: 0000000000000000 R08: ffff810223b90362 R09: 0000000000000010
> R10: ffffffff8822d60b R11: 0000000000000001 R12: 0000000000000000
> R13: ffffffff88234b00 R14: ffff81022307e7c8 R15: 0000000000000000
> FS: 00002b07aa3166e0(0000) GS:ffff81022743bd00(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 0000000000000000 CR3: 000000022339c000 CR4: 00000000000006e0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process modprobe (pid: 12469, threadinfo ffff81022339e000, task
> ffff8102239aa000)
> Stack: ffffffff882200ce ffff8102239ad000 0000000000000001 ffff8102274273c0
> 0000000000000000 0000000000000001 ffffc20011bef960 ffff810225c88540
> ffffffff8809f7bf ffffffff882340c0 ffffffff882340c0 ffff8102263f7f00
> Call Trace:
> [<ffffffff882200ce>] :bonding:bond_create+0x4e/0x30e
> [<ffffffff8809f7bf>] :bonding:bonding_init+0x7bf/0x85d
> [<ffffffff8024f752>] sys_init_module+0x176d/0x183f
> [<ffffffff8020be8e>] system_call+0x7e/0x83
>
>
> Code: 8a 0e 48 ff c7 48 ff c6 45 84 c0 74 36 84 c9 74 32 41 38 c8
> RIP [<ffffffff8030271e>] strnicmp+0x12/0x5f
> RSP <ffff81022339fe00>
> CR2: 0000000000000000
> ---[ end trace ba3d7089e7da64fa ]---
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox