06 Oct, 2009

1 commit

  • Commit 7069331 (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
    Signed-off-by: David S. Miller

    Stephen Boyd
     

03 Oct, 2009

3 commits


23 Sep, 2009

1 commit

  • 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
    Acked-by: Matt Helsley
    Cc: Oleg Nesterov
    Cc: Evgeniy Polyakov
    Acked-by: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Scott James Remnant
     

24 Jul, 2009

1 commit


22 Jul, 2009

1 commit


18 Jul, 2009

1 commit

  • 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
    Signed-off-by: David S. Miller

    Mike Frysinger
     

13 Jun, 2009

1 commit


03 Feb, 2009

1 commit

  • 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
    Acked-by: Evgeniy Polyakov
    Signed-off-by: David S. Miller

    Frederic Weisbecker
     

14 Nov, 2008

2 commits

  • 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
    Acked-by: James Morris
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris

    David Howells
     
  • 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

    Signed-off-by: David Howells
    Acked-by: James Morris
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris

    David Howells
     

28 Jun, 2008

1 commit

  • 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
    Acked-by: Evgeniy Polyakov
    Signed-off-by: David S. Miller

    Li Zefan
     

24 Mar, 2008

1 commit


27 Feb, 2008

1 commit


29 Jan, 2008

5 commits


09 Jan, 2008

1 commit


04 Jan, 2008

1 commit


31 Oct, 2007

1 commit


11 Oct, 2007

2 commits

  • 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
    Acked-by: Alexey Kuznetsov
    Signed-off-by: David S. Miller

    Denis V. Lunev
     
  • 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
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

17 Jul, 2007

1 commit


26 Apr, 2007

2 commits


08 Mar, 2007

1 commit

  • 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
    Signed-off-by: Lars Ellenberg
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: David S. Miller

    Philipp Reisner
     

06 Jan, 2007

1 commit

  • 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
    Cc: Evgeniy Polyakov
    Cc: "Luck, Tony"
    Cc:
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Erik Jacobson
     

18 Dec, 2006

2 commits


22 Nov, 2006

1 commit


01 Aug, 2006

1 commit

  • 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
    Signed-off-by: Matt Helsley
    Cc: Evgeniy Polyakov
    Cc: Guillaume Thouvenin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chandra Seetharaman
     

23 Jun, 2006

2 commits

  • Put the connector exports at the functions so people can see them in context.

    Cc: Evgeniy Polyakov
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • 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
    Cc: Guillaume Thouvenin
    Cc: Nguyen Anh Quynh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Helsley
     

20 Jun, 2006

1 commit


18 Jun, 2006

1 commit

  • 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
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: David S. Miller

    Andreas Schwab
     

23 Mar, 2006

1 commit


21 Mar, 2006

1 commit