- Feb 02, 2010
-
-
Evgeniy Polyakov authored
On Tue, Feb 02, 2010 at 02:57:14PM -0800, Greg KH (gregkh@suse.de) wrote: > > There are at least two ways to fix it: using a big cannon and a small > > one. The former way is to disable notification registration, since it is > > not used by anyone at all. Second way is to check whether calling > > process is root and its destination group is -1 (kind of priveledged > > one) before command is dispatched to workqueue. > > Well if no one is using it, removing it makes the most sense, right? > > No objection from me, care to make up a patch either way for this? Getting it is not used, let's drop support for notifications about (un)registered events from connector. Another option was to check credentials on receiving, but we can always restore it without bugs if needed, but genetlink has a wider code base and none complained, that userspace can not get notification when some other clients were (un)registered. Kudos for Sebastian Krahmer <krahmer@suse.de>, who found a bug in the code. Signed-off-by:
Evgeniy Polyakov <zbr@ioremap.net> Acked-by:
Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Oct 06, 2009
-
-
Stephen Boyd authored
Commit 7069331d (connector: Provide the sender's credentials to the callback, 2009-10-02) changed callbacks to take two arguments but missed this one. drivers/connector/cn_proc.c: In function ‘cn_proc_init’: drivers/connector/cn_proc.c:263: warning: passing argument 3 of ‘cn_add_callback’ from incompatible pointer type Signed-off-by:
Stephen Boyd <bebarino@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Oct 02, 2009
-
-
Philipp Reisner authored
Signed-off-by:
Philipp Reisner <philipp.reisner@linbit.com> Acked-by:
Lars Ellenberg <lars.ellenberg@linbit.com> Acked-by:
Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Philipp Reisner authored
Signed-off-by:
Philipp Reisner <philipp.reisner@linbit.com> Acked-by:
Lars Ellenberg <lars.ellenberg@linbit.com> Acked-by:
Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Philipp Reisner authored
Signed-off-by:
Philipp Reisner <philipp.reisner@linbit.com> Acked-by:
Lars Ellenberg <lars.ellenberg@linbit.com> Acked-by:
Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Sep 23, 2009
-
-
Scott James Remnant authored
The act of a process becoming a session leader is a useful signal to a supervising init daemon such as Upstart. While a daemon will normally do this as part of the process of becoming a daemon, it is rare for its children to do so. When the children do, it is nearly always a sign that the child should be considered detached from the parent and not supervised along with it. The poster-child example is OpenSSH; the per-login children call setsid() so that they may control the pty connected to them. If the primary daemon dies or is restarted, we do not want to consider the per-login children and want to respawn the primary daemon without killing the children. This patch adds a new PROC_SID_EVENT and associated structure to the proc_event event_data union, it arranges for this to be emitted when the special PIDTYPE_SID pid is set. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by:
Scott James Remnant <scott@ubuntu.com> Acked-by:
Matt Helsley <matthltc@us.ibm.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Acked-by:
"David S. Miller" <davem@davemloft.net> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Jul 21, 2009
-
-
Evgeniy Polyakov authored
Signed-off-by:
Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jul 17, 2009
-
-
Mike Frysinger authored
The connector documentation states that the argument to the callback function is always a pointer to a struct cn_msg, but rather than encode it in the API itself, it uses a void pointer everywhere. This doesn't make much sense to encode the pointer in documentation as it prevents proper C type checking from occurring and can easily allow people to use the wrong pointer type. So convert the argument type to an explicit struct cn_msg pointer. Signed-off-by:
Mike Frysinger <vapier@gentoo.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jun 12, 2009
-
-
Pavel Machek authored
.ko is normally not included in Kconfig help, make it consistent. Signed-off-by:
Pavel Machek <pavel@ucw.cz> Signed-off-by:
Jiri Kosina <jkosina@suse.cz>
-
- Feb 03, 2009
-
-
Frederic Weisbecker authored
The netlink connector uses its own workqueue to relay the datas sent from userspace to the appropriate callback. If you launch the test from Documentation/connector and change it a bit to send a high flow of data, you will see thousands of events coming to the "cqueue" workqueue by looking at the workqueue tracer. This flow of events can be sent very quickly. So, to not encumber the kevent workqueue and delay other jobs, the "cqueue" workqueue should remain. But this workqueue is pointless most of the time, it will always be created (assuming you have built it of course) although only developpers with specific needs will use it. So avoid this "most of the time useless task", this patch proposes to create this workqueue only when needed once. The first jobs to be sent to connector callbacks will be sent to kevent while the "cqueue" thread creation will be scheduled to kevent too. The following jobs will continue to be scheduled to keventd until the cqueue workqueue is created, and then the rest of the jobs will continue to perform as usual, through this dedicated workqueue. Each time I tested this patch, only the first event was sent to keventd, the rest has been sent to cqueue which have been created quickly. Also, this patch fixes some trailing whitespaces on the connector files. Signed-off-by:
Frederic Weisbecker <fweisbec@gmail.com> Acked-by:
Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Nov 13, 2008
-
-
David Howells authored
Use RCU to access another task's creds and to release a task's own creds. This means that it will be possible for the credentials of a task to be replaced without another task (a) requiring a full lock to read them, and (b) seeing deallocated memory. Signed-off-by:
David Howells <dhowells@redhat.com> Acked-by:
James Morris <jmorris@namei.org> Acked-by:
Serge Hallyn <serue@us.ibm.com> Signed-off-by:
James Morris <jmorris@namei.org>
-
David Howells authored
Separate the task security context from task_struct. At this point, the security data is temporarily embedded in the task_struct with two pointers pointing to it. Note that the Alpha arch is altered as it refers to (E)UID and (E)GID in entry.S via asm-offsets. With comment fixes Signed-off-by:
Marc Dionne <marc.c.dionne@gmail.com> Signed-off-by:
David Howells <dhowells@redhat.com> Acked-by:
James Morris <jmorris@namei.org> Acked-by:
Serge Hallyn <serue@us.ibm.com> Signed-off-by:
James Morris <jmorris@namei.org>
-
- Jun 27, 2008
-
-
Li Zefan authored
I got a problem when I wanted to check if the kernel supports process event connector, and It seems there's no way to do this check. At best I can check if the kernel supports connector or not, by looking into /proc/net/netlink, or maybe checking the return value of bind() to see if it's ENOENT. So it would be useful to add /proc/net/connector to list all supported connectors: # cat /proc/net/connector Name ID connector 4294967295:4294967295 cn_proc 1:1 w1 3:1 Changelog: - fix memory leak: s/seq_release/single_release - use spin_lock_bh instead of spin_lock_irqsave Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Acked-by:
Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Mar 23, 2008
-
-
Evgeniy Polyakov authored
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru> We don't need one cqueue thread for each CPU. cqueue is used for receiving userspace datagrams, which are very rare and thus will happily live with a single queue. Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Feb 26, 2008
-
-
Li Zefan authored
It is used in connector.c only, so make it static. Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jan 28, 2008
-
-
Denis V. Lunev authored
Create a specific helper for netlink kernel socket disposal. This just let the code look better and provides a ground for proper disposal inside a namespace. Signed-off-by:
Denis V. Lunev <den@openvz.org> Tested-by:
Alexey Dobriyan <adobriyan@openvz.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Li Zefan authored
- 'cb' is a fake struct member. In a previous patch struct cn_callback was renamed to cn_callback_id, so 'cb' should have been deleted at that time. - 'nls' isn't used and is redundant, we can retrieve this data through cn_callback_entry.pdev->nls. - 'seq' and 'group' should be u32, as they are declared to be u32 in other places. Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Li Zefan authored
Struct member netlink_groups is never used, and I don't see how it can be useful. Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Li Zefan authored
- __cn_rx_skb() does nothing but calls cn_call_callback(), it doesn't check skb and msg sizes as the comment suggests, but cn_rx_skb() checks those sizes. - In cn_rx_skb() Local variable 'len' is not used. 'len' is probably intended to be passed to skb_pull(), but here skb_pull() is not needed, instead skb_free() is called. Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Li Zefan authored
Each entry in the list has a unique id, so just break out of the loop if the matched id is found. Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jan 09, 2008
-
-
Li Zefan authored
cn_queue_free_callback() will touch 'dev'(i.e. cbq->pdev), so it should be called before atomic_dec(&dev->refcnt). Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jan 04, 2008
-
-
Li Zefan authored
Error code should be set to EINVAL instead of ENODEV if !queue_work(). There's another call of queue_work() which may set err to EINVAL. Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Oct 30, 2007
-
-
Michal Januszewski authored
Remove a spurious call to kfree_skb() in the connector rx_skb handler. This fixes a regression introduced by the '[NET]: make netlink user -> kernel interface synchronious' patch (cd40b7d3) Signed-off-by:
Michal Januszewski <spock@gentoo.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Oct 10, 2007
-
-
Denis V. Lunev authored
This patch make processing netlink user -> kernel messages synchronious. This change was inspired by the talk with Alexey Kuznetsov about current netlink messages processing. He says that he was badly wrong when introduced asynchronious user -> kernel communication. The call netlink_unicast is the only path to send message to the kernel netlink socket. But, unfortunately, it is also used to send data to the user. Before this change the user message has been attached to the socket queue and sk->sk_data_ready was called. The process has been blocked until all pending messages were processed. The bad thing is that this processing may occur in the arbitrary process context. This patch changes nlk->data_ready callback to get 1 skb and force packet processing right in the netlink_unicast. Kernel -> user path in netlink_unicast remains untouched. EINTR processing for in netlink_run_queue was changed. It forces rtnl_lock drop, but the process remains in the cycle until the message will be fully processed. So, there is no need to use this kludges now. Signed-off-by:
Denis V. Lunev <den@openvz.org> Acked-by:
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Eric W. Biederman authored
Each netlink socket will live in exactly one network namespace, this includes the controlling kernel sockets. This patch updates all of the existing netlink protocols to only support the initial network namespace. Request by clients in other namespaces will get -ECONREFUSED. As they would if the kernel did not have the support for that netlink protocol compiled in. As each netlink protocol is updated to be multiple network namespace safe it can register multiple kernel sockets to acquire a presence in the rest of the network namespaces. The implementation in af_netlink is a simple filter implementation at hash table insertion and hash table look up time. Signed-off-by:
Eric W. Biederman <ebiederm@xmission.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jul 16, 2007
-
-
Jan Engelhardt authored
Use menuconfigs instead of menus, so the whole menu can be disabled at once instead of going through all options. Signed-off-by:
Jan Engelhardt <jengelh@gmx.de> Acked-by:
Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Apr 25, 2007
-
-
Patrick McHardy authored
Switch cb_lock to mutex and allow netlink kernel users to override it with a subsystem specific mutex for consistent locking in dump callbacks. All netlink_dump_start users have been audited not to rely on any side-effects of the previously used spinlock. Signed-off-by:
Patrick McHardy <kaber@trash.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Arnaldo Carvalho de Melo authored
For the common "(struct nlmsghdr *)skb->data" sequence, so that we reduce the number of direct accesses to skb->data and for consistency with all the other cast skb member helpers. Signed-off-by:
Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Mar 07, 2007
-
-
Philipp Reisner authored
When system under heavy stress and must allocate new work instead of reusing old one, new work must use correct completion callback. Patch is based on Philipp's and Lars' work. I only cleaned small stuff (and removed spaces instead of tabs). Signed-off-by:
Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by:
Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by:
Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jan 06, 2007
-
-
Erik Jacobson authored
On ia64, the various functions that make up cn_proc.c cause kernel unaligned access errors. If you are using these, for example, to get notification about all tasks forking and exiting, you get multiple unaligned access errors per process. Use put_unaligned() in the appropriate palces to fix this. Signed-off-by:
Erik Jacobson <erikj@sgi.com> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: <stable@kernel.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
- Dec 18, 2006
-
-
Evgeniy Polyakov authored
Signed-off-by:
Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Dec 17, 2006
-
-
Evgeniy Polyakov authored
Linus has changed work queue structure and has not tested it with connector compiled in, his changes break the build. Attached patch fixes compilation error. Patch is against commit 99f5e971. Thanks to Toralf Förster for pointing this out. Signed-off-by:
Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Nov 22, 2006
-
-
David Howells authored
Fix up for make allyesconfig. Signed-Off-By:
David Howells <dhowells@redhat.com>
-
- Jul 31, 2006
-
-
Chandra Seetharaman authored
Events sent by Process Events Connector from a 64-bit kernel are not binary compatible with a 32-bit userspace program because the "timestamp" field (struct timespec) is not arch independent. This affects the fields that follow "timestamp" as they will be be off by 8 bytes. This is a problem for 32-bit userspace programs running with 64-bit kernels on ppc64, s390, x86-64.. any "biarch" system. Matt had submitted a different solution to lkml as an RFC earlier. We have since switched to a solution recommended by Evgeniy Polyakov. This patch fixes the problem by changing the timestamp to be a __u64, which stores the number of nanoseconds. Tested on a x86_64 system with both 32 bit application and 64 bit application and on a i386 system. Signed-off-by:
Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by:
Matt Helsley <matthltc@us.ibm.com> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
- Jun 23, 2006
-
-
Andrew Morton authored
Put the connector exports at the functions so people can see them in context. Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: Greg KH <greg@kroah.com> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
Matt Helsley authored
Move connector header include to precisely where it's needed. Remove unused time.h header file as well. This was leftover from previous iterations of the process events patches. Signed-off-by:
Matt Helsley <matthltc@us.ibm.com> Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net> Cc: Nguyen Anh Quynh <aquynh@gmail.com> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
- Jun 20, 2006
-
-
Evgeniy Polyakov authored
Attached patch declares connector init function as subsys_init() and returns -EAGAIN in case connector is not initialized yet. Signed-off-by:
Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jun 17, 2006
-
-
Andreas Schwab authored
cn_queue.c:130: warning: value computed is not used There is no point in testing the atomic value if the result is thrown away. From Evgeniy: It was created to put implicit smp barrier, but it is not needed there. Signed-off-by:
Andreas Schwab <schwab@suse.de> Signed-off-by:
Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Mar 23, 2006
-
-
Arjan van de Ven authored
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by:
Arjan van de Ven <arjan@infradead.org> Signed-off-by:
Ingo Molnar <mingo@elte.hu> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
- Mar 20, 2006
-
-
Evgeniy Polyakov authored
Return -ESRCH from cn_netlink_send() when there are not listeners, just as it could be done by netlink_broadcast(). Propagate netlink_broadcast() error back to the caller. Signed-off-by:
Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by:
David S. Miller <davem@davemloft.net>
-