- Apr 11, 2014
-
-
David S. Miller authored
Several spots in the kernel perform a sequence like: skb_queue_tail(&sk->s_receive_queue, skb); sk->sk_data_ready(sk, skb->len); But at the moment we place the SKB onto the socket receive queue it can be consumed and freed up. So this skb->len access is potentially to freed up memory. Furthermore, the skb->len can be modified by the consumer so it is possible that the value isn't accurate. And finally, no actual implementation of this callback actually uses the length argument. And since nobody actually cared about it's value, lots of call sites pass arbitrary values in such as '0' and even '1'. So just remove the length argument from the callback, that way there is no confusion whatsoever and all of these use-after-free cases get fixed as a side effect. Based upon a patch by Eric Dumazet and his suggestion to audit this issue tree-wide. Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Apr 04, 2014
-
-
Tariq Saeed authored
Orabug: 17330860 When accepting an incomming connection o2net_accept_one clones a child data socket from the parent listening socket. It then proceeds to setup the child with callback o2net_data_ready() and sk_user_data to NULL. If data arrives in this window, o2net_listen_data_ready will be called with some non-deterministic value in sk_user_data (not inherited). We panic when we page fault on sk_user_data -- in parent it is sock_def_readable(). The fix is to recognize that this is a data socket being set up by looking at the socket state and do nothing. Signed-off-by:
Tariq Saseed <tariq.x.saeed@oracle.com> Signed-off-by:
Srinivas Eeda <srinivas.eeda@oracle.com> Reviewed-by:
Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Joseph Qi authored
In o2nm_cluster, cl_idle_timeout_ms, cl_keepalive_delay_ms, as well as cl_reconnect_delay_ms, are defined as type of unsigned int. So we should also use unsigned int in the helper functions. Signed-off-by:
Joseph Qi <joseph.qi@huawei.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Mark Fasheh <mfasheh@suse.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Sep 12, 2013
-
-
Joseph Qi authored
Since o2nm_get_node_by_num() may return NULL, we add this check in o2net_accept_one() to avoid possible NULL pointer dereference. Signed-off-by:
Joseph Qi <joseph.qi@huawei.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Joseph Qi authored
Code in o2net_handler_tree_lookup() may be corrupted by mistake. So adjust it to promote readability. Signed-off-by:
Joseph Qi <joseph.qi@huawei.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Sunil Mushran authored
Fix some possible null pointer dereferences that were detected by the static code analyser, smatch. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Reported-by:
Dan Carpenter <error27@gmail.com> Reported-by:
Guozhonghua <guozhonghua@h3c.com> Cc: Sunil Mushran <sunil.mushran@gmail.com> Cc: Joseph Qi <joseph.qi@huawei.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Jul 04, 2013
-
-
Jie Liu authored
Adjust switch..case syntax at o2net_state_change to meet the kernel coding standard. s/printk/pr_info/. [akpm@linux-foundation.org: revert pr_foo() change] Signed-off-by:
Jie Liu <jeff.liu@oracle.com> Acked-by:
Joel Becker <jlbec@evilplan.org> Cc: Gurudas Pai <gurudas.pai@oracle.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com> Cc: Srinivas Eeeda <srinivas.eeda@oracle.com> Cc: Sunil Mushran <sunil.mushran@gmail.com> Cc: Tao Ma <tm@tao.ma> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Younger Liu authored
There is a memory leak in sc_kref_release(). When free struct o2net_sock_container (sc), we should release sc->sc_page. Signed-off-by:
Younger Liu <younger.liu@huawei.com> Reviewed-by:
Jie Liu <jeff.liu@oracle.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Mark Fasheh <mfasheh@suse.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Feb 28, 2013
-
-
Tejun Heo authored
Convert to the much saner new idr interface. Signed-off-by:
Tejun Heo <tj@kernel.org> Cc: Mark Fasheh <mfasheh@suse.com> Acked-by:
Joel Becker <jlbec@evilplan.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Feb 22, 2013
-
-
Tim Gardner authored
smatch analysis indicates a number of redundant NULL checks before calling kfree(), eg: fs/ocfs2/alloc.c:6138 ocfs2_begin_truncate_log_recovery() info: redundant null check on *tl_copy calling kfree() fs/ocfs2/alloc.c:6755 ocfs2_zero_range_for_truncate() info: redundant null check on pages calling kfree() etc.... [akpm@linux-foundation.org: revert dubious change in ocfs2_begin_truncate_log_recovery()] Signed-off-by:
Tim Gardner <tim.gardner@canonical.com> Cc: Mark Fasheh <mfasheh@suse.com> Acked-by:
Joel Becker <jlbec@evilplan.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Jan 09, 2013
-
-
Masanari Iida authored
Correct spelling typo in printk within various drivers. Signed-off-by:
Masanari Iida <standby24x7@gmail.com> Signed-off-by:
Jiri Kosina <jkosina@suse.cz>
-
- Apr 21, 2012
-
-
Pavel Emelyanov authored
Name them in a "backward compatible" manner, i.e. reuse or not are still 1 and 0 respectively. The reuse value of 2 means that the socket with it will forcibly reuse everyone else's port. Signed-off-by:
Pavel Emelyanov <xemul@openvz.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Nov 01, 2011
-
-
Paul Gortmaker authored
These files were getting <linux/module.h> via an implicit include path, but we want to crush those out of existence since they cost time during compiles of processing thousands of lines of headers for no reason. Give them the lightweight header that just contains the EXPORT_SYMBOL infrastructure. Signed-off-by:
Paul Gortmaker <paul.gortmaker@windriver.com>
-
- Jul 24, 2011
-
-
Sunil Mushran authored
Patch adds function o2net_fill_node_map() to return the bitmap of nodes that it is connected to. This bitmap is also accessible by the user via the debugfs file, /sys/kernel/debug/o2net/connected_nodes. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com>
-
Sunil Mushran authored
o2net messages needed a facelift. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com>
-
- Mar 31, 2011
-
-
Lucas De Marchi authored
Fixes generated by 'codespell' and manually reviewed. Signed-off-by:
Lucas De Marchi <lucas.demarchi@profusion.mobi>
-
- Mar 28, 2011
-
-
Rakib Mullick authored
When CONFIG_DEBUG_FS=y and CONFIG_OCFS2_FS_STATS=n, we get the following warning: fs/ocfs2/cluster/tcp.c:213:16: warning: ‘o2net_get_func_run_time’ defined but not used Since o2net_get_func_run_time is only called from o2net_update_recv_stats, so move it under CONFIG_OCFS2_FS_STATS. Signed-off-by:
Rakib Mullick <rakib.mullick@gmail.com> Signed-off-by:
jlbec <jlbec@evilplan.org>
-
- Jan 08, 2011
-
-
Randy Dunlap authored
When CONFIG_OCFS2_FS_STATS is not enabled: fs/ocfs2/cluster/tcp.c:1254: error: implicit declaration of function 'o2net_update_recv_stats' Signed-off-by:
Randy Dunlap <randy.dunlap@oracle.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <joel.becker@oracle.com> Cc: ocfs2-devel@oss.oracle.com Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- Dec 23, 2010
-
-
Sunil Mushran authored
Tracks total time taken to process messages received on a socket. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
Sunil Mushran authored
Tracks total send and status times for all messages sent on a socket. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
Sunil Mushran authored
Replace time trackers in struct o2net_sock_container from struct timeval to union ktime. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
Sunil Mushran authored
Replace time trackers in struct o2net_send_tracking from struct timeval to union ktime. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- Dec 16, 2010
-
-
Sunil Mushran authored
o2net pins the node item of the remote node in configfs before initiating the connection. It is unpinned on disconnect. This is to prevent the node item from being unlinked while it is still in use. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- Oct 08, 2010
-
-
Sunil Mushran authored
ocfs2/cluster: Check slots for unconfigured live nodes o2hb currently checks slots for configured nodes only. This patch makes it check the slots for the live nodes too to take care of a race in which a node is removed from the configuration but not from the live map. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com>
-
- Sep 18, 2010
-
-
Wu Fengguang authored
mmotm/fs/ocfs2/cluster/tcp.c: In function ‘o2net_send_message_vec’: mmotm/fs/ocfs2/cluster/tcp.c:980:6: warning: ‘ret’ may be used uninitialized in this function It seems a real bug introduced by commit 9af0b38f (ocfs2/net: Use wait_event() in o2net_send_message_vec()). cc: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Wu Fengguang <fengguang.wu@intel.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- Aug 07, 2010
-
-
Tristan Ye authored
Currently, o2net_accept_one() is allowed to accept a connection from listening node itself, such a fake connection will not be successfully established due to no handshake detected afterwards, and later end up with triggering connecting worker in a loop. We're going to fix this by treating such connection request as 'invalid', since we've got no chance of requesting connection from a node to itself in a OCFS2 cluster. The fix doesn't hurt user's scan for o2net-listener, it always gets a successful connection from userpace. Signed-off-by:
Tristan Ye <tristan.ye@oracle.com> Acked-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- May 06, 2010
-
-
Srinivas Eeda authored
This patch logs socket state changes that lead to socket shutdown. Signed-off-by:
Srinivas Eeda <srinivas.eeda@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- Mar 13, 2010
-
-
Joe Perches authored
Signed-off-by:
Joe Perches <joe@perches.com> Cc: Mark Fasheh <mfasheh@suse.com> Acked-by:
Joel Becker <joel.becker@oracle.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Feb 08, 2010
-
-
Sunil Mushran authored
Connect and disconnect messages are more than informational as they are required during root cause analysis for failures. This patch changes them from KERN_INFO to KERN_NOTICE. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Acked-by:
Mark Faseh <mfasheh@suse.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- Jan 26, 2010
-
-
Sunil Mushran authored
Patch removes trailing whitespaces. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- Jun 15, 2009
-
-
Sunil Mushran authored
Replace wait_event_interruptible() with wait_event() in o2net_send_message_vec(). This is because this function is called by the dlm that expects signals to be blocked. Fixes oss bugzilla#1126 http://oss.oracle.com/bugzilla/show_bug.cgi?id=1126 Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Joel Becker <joel.becker@oracle.com>
-
- Oct 31, 2008
-
-
Harvey Harrison authored
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by:
Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Aug 22, 2008
-
-
Adrian Bunk authored
Commit 0f475b2a (ocfs2/net: Silence build warnings) made sense as far as it fixed compile warnings, but it was not required that it made the functions global. Signed-off-by:
Adrian Bunk <bunk@kernel.org> Signed-off-by:
Mark Fasheh <mfasheh@suse.com>
-
- May 31, 2008
-
-
Sunil Mushran authored
This patch silences the build warnings concerning o2net_init_nst() and friends when building without CONFIG_DEBUG_FS enabled. Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by:
Mark Fasheh <mfasheh@suse.com>
-
- Apr 18, 2008
-
-
Sunil Mushran authored
This patch exposes o2net information via debugfs. The information includes the list of sockets (sock_containers) as well as the list of outstanding messages (send_tracking). Useful for o2dlm debugging. (This patch is derived from an earlier one written by Zach Brown that exposed the same information via /proc.) [Mark: checkpatch fixes] Signed-off-by:
Sunil Mushran <sunil.mushran@oracle.com> Reviewed-by:
Joel Becker <joel.becker@oracle.com> Signed-off-by:
Mark Fasheh <mfasheh@suse.com>
-
Jeff Mahoney authored
We keep seeing bug reports related to NULL pointer derefs in o2net_set_nn_state(). When I originally wrote up the configurable timeout patch, I had tried to plan for multiple clusters. This was silly. The timeout routines all use o2nm_single_cluster so there's no point in passing an argument at all. This patch removes the arguments and kills those bugs dead. Signed-off-by:
Jeff Mahoney <jeffm@suse.com> Signed-off-by:
Mark Fasheh <mfasheh@suse.com>
-
Tao Ma authored
Currently, o2net connects to a node on hb_up and disconnects on hb_down and net timeout. It disconnects on net timeout is ok, but it should attempt to reconnect back. This is because sometimes nodes get overloaded enough that the network connection breaks but the disk hb does not. And if we get into that situation, we either fence (unnecessarily) or wait for its disk hb to die (and sometimes hang in the process). So in this updated scheme, when the network disconnects, we keep attempting to reconnect till we succeed or we get a disk hb down event. If the other node is really dead, then we will eventually get a node down event. If not, we should be able to connect again and continue. Signed-off-by:
Tao Ma <tao.ma@oracle.com> Signed-off-by:
Mark Fasheh <mfasheh@suse.com>
-
- Mar 10, 2008
-
-
Tao Ma authored
In some situations, ocfs2_set_nn_state might get called with sc = NULL and valid = 0. If sc = NULL, we can't dereference it to get the o2nm_node member. Instead, do what o2net_initialize_handshake does and use NULL when calling o2net_reconnect_delay and o2net_idle_timeout. Signed-off-by:
Tao Ma <tao.ma@oracle.com> Signed-off-by:
Mark Fasheh <mark.fasheh@oracle.com>
-
- Dec 05, 2007
-
-
Al Viro authored
endianness annotations in networking code had been in place for quite a while; in particular, sin_port and s_addr are annotated as big-endian. Code in ocfs2 had __force casts added apparently to shut the sparse warnings up; of course, these days they only serve to *produce* warnings for no reason whatsoever... Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Nov 13, 2007
-
-
Trond Myklebust authored
...and fix a couple of bugs in the NBD, CIFS and OCFS2 socket handlers. Looking at the sock->op->shutdown() handlers, it looks as if all of them take a SHUT_RD/SHUT_WR/SHUT_RDWR argument instead of the RCV_SHUTDOWN/SEND_SHUTDOWN arguments. Add a helper, and then define the SHUT_* enum to ensure that kernel users of shutdown() don't get confused. Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by:
Mark Fasheh <mark.fasheh@oracle.com> Acked-by:
David Howells <dhowells@redhat.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-