<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/core/scm.c, branch linux-2.6.33.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.33.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.33.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-11-07T21:47:36Z</updated>
<entry>
<title>scm: lower SCM_MAX_FD</title>
<updated>2011-11-07T21:47:36Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2010-11-23T14:09:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa0a1136645f7a31c789d46272af3b298390c4e0'/>
<id>urn:sha1:fa0a1136645f7a31c789d46272af3b298390c4e0</id>
<content type='text'>
commit bba14de98753cb6599a2dae0e520714b2153522d upstream.

Lower SCM_MAX_FD from 255 to 253 so that allocations for scm_fp_list are
halved. (commit f8d570a4 added two pointers in this structure)

scm_fp_dup() should not copy whole structure (and trigger kmemcheck
warnings), but only the used part. While we are at it, only allocate
needed size.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>scm: Only support SCM_RIGHTS on unix domain sockets.</title>
<updated>2010-03-15T16:06:34Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2010-02-28T01:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=709a1e560b23235706a504323aafc9f1a9a05eb6'/>
<id>urn:sha1:709a1e560b23235706a504323aafc9f1a9a05eb6</id>
<content type='text'>
commit 76dadd76c265a0cdb5a76aa4eef03fcc9639b388 upstream.

We use scm_send and scm_recv on both unix domain and
netlink sockets, but only unix domain sockets support
everything required for file descriptor passing,
so error if someone attempts to pass file descriptors
over netlink sockets.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Merge branch 'master' into next</title>
<updated>2008-11-18T07:52:37Z</updated>
<author>
<name>James Morris</name>
</author>
<published>2008-11-18T07:52:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3a5c547012a09f38f7c27b17a8e3150b69cd259'/>
<id>urn:sha1:f3a5c547012a09f38f7c27b17a8e3150b69cd259</id>
<content type='text'>
Conflicts:
	fs/cifs/misc.c

Merge to resolve above, per the patch below.

Signed-off-by: James Morris &lt;jmorris@namei.org&gt;

diff --cc fs/cifs/misc.c
index ec36410,addd1dc..0000000
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@@ -347,13 -338,13 +338,13 @@@ header_assemble(struct smb_hdr *buffer
  		/*  BB Add support for establishing new tCon and SMB Session  */
  		/*      with userid/password pairs found on the smb session   */
  		/*	for other target tcp/ip addresses 		BB    */
 -				if (current-&gt;fsuid != treeCon-&gt;ses-&gt;linux_uid) {
 +				if (current_fsuid() != treeCon-&gt;ses-&gt;linux_uid) {
  					cFYI(1, ("Multiuser mode and UID "
  						 "did not match tcon uid"));
- 					read_lock(&amp;GlobalSMBSeslock);
- 					list_for_each(temp_item, &amp;GlobalSMBSessionList) {
- 						ses = list_entry(temp_item, struct cifsSesInfo, cifsSessionList);
+ 					read_lock(&amp;cifs_tcp_ses_lock);
+ 					list_for_each(temp_item, &amp;treeCon-&gt;ses-&gt;server-&gt;smb_ses_list) {
+ 						ses = list_entry(temp_item, struct cifsSesInfo, smb_ses_list);
 -						if (ses-&gt;linux_uid == current-&gt;fsuid) {
 +						if (ses-&gt;linux_uid == current_fsuid()) {
  							if (ses-&gt;server == treeCon-&gt;ses-&gt;server) {
  								cFYI(1, ("found matching uid substitute right smb_uid"));
  								buffer-&gt;Uid = ses-&gt;Suid;
</content>
</entry>
<entry>
<title>scm: fix scm_fp_list-&gt;list initialization made in wrong place</title>
<updated>2008-11-14T22:51:45Z</updated>
<author>
<name>Pavel Emelyanov</name>
</author>
<published>2008-11-14T22:51:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5421ae0153b4ba0469967cfd8de96144e3bf3979'/>
<id>urn:sha1:5421ae0153b4ba0469967cfd8de96144e3bf3979</id>
<content type='text'>
This is the next page of the scm recursion story (the commit 
f8d570a4 net: Fix recursive descent in __scm_destroy()).

In function scm_fp_dup(), the INIT_LIST_HEAD(&amp;fpl-&gt;list) of newly
created fpl is done *before* the subsequent memcpy from the old 
structure and thus the freshly initialized list is overwritten.

But that's OK, since this initialization is not required at all,
since the fpl-&gt;list is list_add-ed at the destruction time in any
case (and is unused in other code), so I propose to drop both
initializations, rather than moving it after the memcpy.

Please, correct me if I miss something significant.

Signed-off-by: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'master' into next</title>
<updated>2008-11-14T00:29:12Z</updated>
<author>
<name>James Morris</name>
</author>
<published>2008-11-14T00:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b828925652340277a889cbc11b2d0637f7cdaf7'/>
<id>urn:sha1:2b828925652340277a889cbc11b2d0637f7cdaf7</id>
<content type='text'>
Conflicts:
	security/keys/internal.h
	security/keys/process_keys.c
	security/keys/request_key.c

Fixed conflicts above by using the non 'tsk' versions.

Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>CRED: Wrap current-&gt;cred and a few other accessors</title>
<updated>2008-11-13T23:39:18Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2008-11-13T23:39:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=86a264abe542cfececb4df129bc45a0338d8cdb9'/>
<id>urn:sha1:86a264abe542cfececb4df129bc45a0338d8cdb9</id>
<content type='text'>
Wrap current-&gt;cred and a few other accessors to hide their actual
implementation.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>CRED: Separate task security context from task_struct</title>
<updated>2008-11-13T23:39:16Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2008-11-13T23:39:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b6dff3ec5e116e3af6f537d4caedcad6b9e5082a'/>
<id>urn:sha1:b6dff3ec5e116e3af6f537d4caedcad6b9e5082a</id>
<content type='text'>
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 &lt;marc.c.dionne@gmail.com&gt;

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>CRED: Wrap task credential accesses in the networking subsystem</title>
<updated>2008-11-13T23:39:10Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2008-11-13T23:39:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8192b0c482d7078fcdcb4854341b977426f6f09b'/>
<id>urn:sha1:8192b0c482d7078fcdcb4854341b977426f6f09b</id>
<content type='text'>
Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.

Change most current-&gt;(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

Change some task-&gt;e?[ug]id to task_e?[ug]id().  In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: James Morris &lt;jmorris@namei.org&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Cc: netdev@vger.kernel.org
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>net: Fix recursive descent in __scm_destroy().</title>
<updated>2008-11-06T21:51:50Z</updated>
<author>
<name>David Miller</name>
</author>
<published>2008-11-06T08:37:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8d570a4745835f2238a33b537218a1bb03fc671'/>
<id>urn:sha1:f8d570a4745835f2238a33b537218a1bb03fc671</id>
<content type='text'>
__scm_destroy() walks the list of file descriptors in the scm_fp_list
pointed to by the scm_cookie argument.

Those, in turn, can close sockets and invoke __scm_destroy() again.

There is nothing which limits how deeply this can occur.

The idea for how to fix this is from Linus.  Basically, we do all of
the fput()s at the top level by collecting all of the scm_fp_list
objects hit by an fput().  Inside of the initial __scm_destroy() we
keep running the list until it is empty.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[NET]: Fix function put_cmsg() which may cause usr application memory overflow</title>
<updated>2007-12-20T22:36:44Z</updated>
<author>
<name>Wei Yongjun</name>
</author>
<published>2007-12-20T22:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1ac70e7ad24a88710cf9b6d7ababaefa2b575df0'/>
<id>urn:sha1:1ac70e7ad24a88710cf9b6d7ababaefa2b575df0</id>
<content type='text'>
When used function put_cmsg() to copy kernel information to user 
application memory, if the memory length given by user application is 
not enough, by the bad length calculate of msg.msg_controllen, 
put_cmsg() function may cause the msg.msg_controllen to be a large 
value, such as 0xFFFFFFF0, so the following put_cmsg() can also write 
data to usr application memory even usr has no valid memory to store 
this. This may cause usr application memory overflow.

int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
{
    struct cmsghdr __user *cm
        = (__force struct cmsghdr __user *)msg-&gt;msg_control;
    struct cmsghdr cmhdr;
    int cmlen = CMSG_LEN(len);
    ~~~~~~~~~~~~~~~~~~~~~
    int err;

    if (MSG_CMSG_COMPAT &amp; msg-&gt;msg_flags)
        return put_cmsg_compat(msg, level, type, len, data);

    if (cm==NULL || msg-&gt;msg_controllen &lt; sizeof(*cm)) {
        msg-&gt;msg_flags |= MSG_CTRUNC;
        return 0; /* XXX: return error? check spec. */
    }
    if (msg-&gt;msg_controllen &lt; cmlen) {
    ~~~~~~~~~~~~~~~~~~~~~~~~
        msg-&gt;msg_flags |= MSG_CTRUNC;
        cmlen = msg-&gt;msg_controllen;
    }
    cmhdr.cmsg_level = level;
    cmhdr.cmsg_type = type;
    cmhdr.cmsg_len = cmlen;

    err = -EFAULT;
    if (copy_to_user(cm, &amp;cmhdr, sizeof cmhdr))
        goto out;
    if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr)))
        goto out;
    cmlen = CMSG_SPACE(len);
~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If MSG_CTRUNC flags is set, msg-&gt;msg_controllen is less than 
CMSG_SPACE(len), "msg-&gt;msg_controllen -= cmlen" will cause unsinged int 
type msg-&gt;msg_controllen to be a large value.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
    msg-&gt;msg_control += cmlen;
    msg-&gt;msg_controllen -= cmlen;
    ~~~~~~~~~~~~~~~~~~~~~
    err = 0;
out:
    return err;
}

The same promble exists in put_cmsg_compat(). This patch can fix this 
problem.

Signed-off-by: Wei Yongjun &lt;yjwei@cn.fujitsu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
