09 Dec, 2012
2 commits
-
Use the device model to get just the name, rather than using the
ethtool API to get all driver information.Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
In cfusbl_device_notify(), the usbnet and usbdev variables are
initialised before the driver name has been checked. In case the
device's driver is not cdc_ncm, this may result in reading beyond the
end of the netdev private area. Move the initialisation below the
driver name check.Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller
21 Nov, 2012
1 commit
-
kfree on a null pointer is a no-op.
Signed-off-by: Sachin Kamat
Acked-by: Sjur Brændeland
Signed-off-by: David S. Miller
11 Sep, 2012
1 commit
-
The dereference should be moved below the NULL test.
spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)Signed-off-by: Wei Yongjun
Signed-off-by: David S. Miller
20 Aug, 2012
1 commit
-
In net/caif/chnl_net.c::chnl_recv_cb() we call skb_header_pointer()
which may return NULL, but we do not check for a NULL pointer before
dereferencing it.
This patch adds such a NULL check and properly free's allocated memory
and return an error (-EINVAL) on failure - much better than crashing..Signed-off-by: Jesper Juhl
Acked-by: Sjur Brændeland
Signed-off-by: David S. Miller
01 Aug, 2012
1 commit
-
This patch series is based on top of "Swap-over-NBD without deadlocking
v15" as it depends on the same reservation of PF_MEMALLOC reserves logic.When a user or administrator requires swap for their application, they
create a swap partition and file, format it with mkswap and activate it
with swapon. In diskless systems this is not an option so if swap if
required then swapping over the network is considered. The two likely
scenarios are when blade servers are used as part of a cluster where the
form factor or maintenance costs do not allow the use of disks and thin
clients.The Linux Terminal Server Project recommends the use of the Network Block
Device (NBD) for swap but this is not always an option. There is no
guarantee that the network attached storage (NAS) device is running Linux
or supports NBD. However, it is likely that it supports NFS so there are
users that want support for swapping over NFS despite any performance
concern. Some distributions currently carry patches that support swapping
over NFS but it would be preferable to support it in the mainline kernel.Patch 1 avoids a stream-specific deadlock that potentially affects TCP.
Patch 2 is a small modification to SELinux to avoid using PFMEMALLOC
reserves.Patch 3 adds three helpers for filesystems to handle swap cache pages.
For example, page_file_mapping() returns page->mapping for
file-backed pages and the address_space of the underlying
swap file for swap cache pages.Patch 4 adds two address_space_operations to allow a filesystem
to pin all metadata relevant to a swapfile in memory. Upon
successful activation, the swapfile is marked SWP_FILE and
the address space operation ->direct_IO is used for writing
and ->readpage for reading in swap pages.Patch 5 notes that patch 3 is bolting
filesystem-specific-swapfile-support onto the side and that
the default handlers have different information to what
is available to the filesystem. This patch refactors the
code so that there are generic handlers for each of the new
address_space operations.Patch 6 adds an API to allow a vector of kernel addresses to be
translated to struct pages and pinned for IO.Patch 7 adds support for using highmem pages for swap by kmapping
the pages before calling the direct_IO handler.Patch 8 updates NFS to use the helpers from patch 3 where necessary.
Patch 9 avoids setting PF_private on PG_swapcache pages within NFS.
Patch 10 implements the new swapfile-related address_space operations
for NFS and teaches the direct IO handler how to manage
kernel addresses.Patch 11 prevents page allocator recursions in NFS by using GFP_NOIO
where appropriate.Patch 12 fixes a NULL pointer dereference that occurs when using
swap-over-NFS.With the patches applied, it is possible to mount a swapfile that is on an
NFS filesystem. Swap performance is not great with a swap stress test
taking roughly twice as long to complete than if the swap device was
backed by NBD.This patch: netvm: prevent a stream-specific deadlock
It could happen that all !SOCK_MEMALLOC sockets have buffered so much data
that we're over the global rmem limit. This will prevent SOCK_MEMALLOC
buffers from receiving data, which will prevent userspace from running,
which is needed to reduce the buffered data.Fix this by exempting the SOCK_MEMALLOC sockets from the rmem limit. Once
this change it applied, it is important that sockets that set
SOCK_MEMALLOC do not clear the flag until the socket is being torn down.
If this happens, a warning is generated and the tokens reclaimed to avoid
accounting errors until the bug is fixed.[davem@davemloft.net: Warning about clearing SOCK_MEMALLOC]
Signed-off-by: Peter Zijlstra
Signed-off-by: Mel Gorman
Acked-by: David S. Miller
Acked-by: Rik van Riel
Cc: Trond Myklebust
Cc: Neil Brown
Cc: Christoph Hellwig
Cc: Mike Christie
Cc: Eric B Munson
Cc: Sebastian Andrzej Siewior
Cc: Mel Gorman
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Jul, 2012
1 commit
-
Conflicts:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
17 Jul, 2012
1 commit
-
unregister_netdevice_notifier() must be called before
unregister_pernet_subsys() to avoid accessing already freed
pernet memory. This fixes the following oops when doing rmmod:Call Trace:
[] caif_device_notify+0x4d/0x5a0 [caif]
[] unregister_netdevice_notifier+0xb9/0x100
[] caif_device_exit+0x1c/0x250 [caif]
[] sys_delete_module+0x1a4/0x300
[] ? trace_hardirqs_on_caller+0x15d/0x1e0
[] ? trace_hardirqs_on_thunk+0x3a/0x3
[] system_call_fastpath+0x1a/0x1fRIP
[] caif_get+0x51/0xb0 [caif]Signed-off-by: Sjur Brændeland
Acked-by: "Eric W. Biederman"
Signed-off-by: David S. Miller
29 Jun, 2012
1 commit
-
Conflicts:
drivers/net/caif/caif_hsi.c
drivers/net/usb/qmi_wwan.cThe qmi_wwan merge was trivial.
The caif_hsi.c, on the other hand, was not. It's a conflict between
1c385f1fdf6f9c66d982802cd74349c040980b50 ("caif-hsi: Replace platform
device with ops structure.") in the net-next tree and commit
39abbaef19cd0a30be93794aa4773c779c3eb1f3 ("caif-hsi: Postpone init of
HIS until open()") in the net tree.I did my best with that one and will ask Sjur to check it out.
Signed-off-by: David S. Miller
26 Jun, 2012
4 commits
-
Rearranged the allocation and packet creations to
avoid potential leaks in error path.Signed-off-by: Kim Lilliestierna
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
Add check on NULL return from caif_get().
Signed-off-by: Kim Lilliestierna
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
Removed surplus call to caif_device_list() in caif_dev.c
Signed-off-by: Kim Lilliestierna
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
Clear caif sockets's shutdown mask at (re)connect.
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
18 Jun, 2012
1 commit
-
Signed-off-by: Rémi Denis-Courmont
Cc: Sakari Ailus
Signed-off-by: David S. Miller
23 May, 2012
1 commit
-
Pull trivial updates from Jiri Kosina:
"As usual, it's mostly typo fixes, redundant code elimination and some
documentation updates."* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits)
edac, mips: don't change code that has been removed in edac/mips tree
xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer
lib: Change mail address of Oskar Schirmer
net: Change mail address of Oskar Schirmer
arm/m68k: Change mail address of Sebastian Hess
i2c: Change mail address of Oskar Schirmer
net: Fix tcp_build_and_update_options comment in struct tcp_sock
atomic64_32.h: fix parameter naming mismatch
Kconfig: replace "--- help ---" with "---help---"
c2port: fix bogus Kconfig "default no"
edac: Fix spelling errors.
qla1280: Remove redundant NULL check before release_firmware() call
remoteproc: remove redundant NULL check before release_firmware()
qla2xxx: Remove redundant NULL check before release_firmware() call.
aic94xx: Get rid of redundant NULL check before release_firmware() call
tehuti: delete redundant NULL check before release_firmware()
qlogic: get rid of a redundant test for NULL before call to release_firmware()
bna: remove redundant NULL test before release_firmware()
tg3: remove redundant NULL test before release_firmware() call
typhoon: get rid of redundant conditional before all to release_firmware()
...
16 May, 2012
1 commit
-
Standardize the net core ratelimited logging functions.
Coalesce formats, align arguments.
Change a printk then vprintk sequence to use printf extension %pV.Signed-off-by: Joe Perches
Signed-off-by: David S. Miller
07 May, 2012
1 commit
-
There are three Kconfig entries with "--- help ---" attributes, and over
2000 Kconfig entries with "---help---" attributes. Apparently the three
attributes with embedded spaces are valid. Still, I see little reason
for using this obscure variant. And replacing those three attributes
with the common variant makes grepping Kconfig files for help texts a
bit easier too.Signed-off-by: Paul Bolle
Signed-off-by: Jiri Kosina
16 Apr, 2012
1 commit
-
Use of "unsigned int" is preferred to bare "unsigned" in net tree.
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
13 Apr, 2012
3 commits
-
Set traffic class for CAIF packets, based on socket
priority, CAIF protocol type, or type of message.Traffic class mapping for different packet types:
- control: TC_PRIO_CONTROL;
- flow control: TC_PRIO_CONTROL;
- at: TC_PRIO_CONTROL;
- rfm: TC_PRIO_INTERACTIVE_BULK;
- other sockets: equals to socket's TC;
- network data: no change.Signed-off-by: Dmitry Tarnyagin
Signed-off-by: David S. Miller -
Pull in the 'net' tree to get CAIF bug fixes upon which
the following set of CAIF feature patches depend.Signed-off-by: David S. Miller
-
Added kfree_skb() calls in the chnk_net.c file on
the error paths.Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
02 Apr, 2012
1 commit
-
These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.Signed-off-by: David S. Miller
12 Mar, 2012
2 commits
-
Connection ID configured through RTNL must allow zero as
connection id. If connection-id is not given when creating the
interface, configure a loopback interface using ifindex as
connection-id.Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
Kill faulty checks on flow-off leading to connection drop at race conditions.
caif_socket checks for flow-on before transmitting and goes to sleep or
return -EAGAIN upon flow stop. Remove faulty subsequent checks on flow-off
leading to connection drop. Also fix memory leaks on some of the errors paths.Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
08 Feb, 2012
1 commit
-
"priv" is initialized twice. I kept the second one, because it is next
to the check for NULL.Signed-off-by: Dan Carpenter
Signed-off-by: David S. Miller
06 Feb, 2012
1 commit
-
Signed-off-by: Jesper Juhl
Signed-off-by: David S. Miller
05 Feb, 2012
3 commits
-
Count dropped packets in CAIF Netdevice.
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
Kill off the debug-fs exposed varaibles from caif_socket.
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
03 Feb, 2012
2 commits
-
SKB is freed twice upon send error. The Network stack consumes SKB even
when it returns error code.Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
Always use cfmuxl_remove_uplayer when removing a up-layer.
cfmuxl_ctrlcmd() can be called independently and in parallel with
cfmuxl_remove_uplayer(). The race between them could cause list_del_rcu
to be called on a node which has been already taken out from the list.
That lead to a (rare) crash on accessing poisoned node->prev inside
list_del_rcu.This fix ensures that deletion are done holding the same lock.
Reported-by: Dmitry Tarnyagin
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
28 Jan, 2012
1 commit
-
caif is a subsystem and as such it needs to register with
register_pernet_subsys instead of register_pernet_device.Among other problems using register_pernet_device was resulting in
net_generic being called before the caif_net structure was allocated.
Which has been causing net_generic to fail with either BUG_ON's or by
return NULL pointers.A more ugly problem that could be caused is packets in flight why the
subsystem is shutting down.To remove confusion also remove the cruft cause by inappropriately
trying to fix this bug.With the aid of the previous patch I have tested this patch and
confirmed that using register_pernet_subsys makes the failure go away as
it should.Signed-off-by: Eric W. Biederman
Acked-by: Sjur Brændeland
Tested-by: Sasha Levin
Signed-off-by: David S. Miller
17 Jan, 2012
3 commits
-
Remove WARN_ON and bad handling of SKB without destructor callback
in caif_flow_cb. SKB without destructor cannot be handled as an
error case.Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
Fix typo for the Vendor/Product Id for ST-Ericsson CAIF modems.
Discovery is based on fixed USB vendor 0x04cc (ST-Ericsson),
product-id 0x230f (NCM).Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
For net part, remove duplicate included header.
Signed-off-by: Shan Wei
Signed-off-by: David S. Miller
10 Jan, 2012
1 commit
-
* 'for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
percpu: Remove irqsafe_cpu_xxx variantsFix up conflict in arch/x86/include/asm/percpu.h due to clash with
cebef5beed3d ("x86: Fix and improve percpu_cmpxchg{8,16}b_double()")
which edited the (now removed) irqsafe_cpu_cmpxchg*_double code.
23 Dec, 2011
1 commit
-
We simply say that regular this_cpu use must be safe regardless of
preemption and interrupt state. That has no material change for x86
and s390 implementations of this_cpu operations. However, arches that
do not provide their own implementation for this_cpu operations will
now get code generated that disables interrupts instead of preemption.-tj: This is part of on-going percpu API cleanup. For detailed
discussion of the subject, please refer to the following thread.http://thread.gmane.org/gmane.linux.kernel/1222078
Signed-off-by: Christoph Lameter
Signed-off-by: Tejun Heo
LKML-Reference:
20 Dec, 2011
1 commit
-
DaveM said:
Please, this kind of stuff rots forever and not using bool properly
drives me crazy.Joe Perches gave me the spatch script:
@@
bool b;
@@
-b = 0
+b = false
@@
bool b;
@@
-b = 1
+b = trueI merely installed coccinelle, read the documentation and took credit.
Signed-off-by: Rusty Russell
Signed-off-by: David S. Miller
07 Dec, 2011
2 commits
-
BUG_ON is too strict in a number of circumstances,
use WARN_ON instead. Protocol errors should not halt the system.Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
Fix bad assert on fragment size triggering false positive.
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller