<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/nfc, branch v3.2.59</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/nfc?h=v3.2.59</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/nfc?h=v3.2.59'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-01-03T04:33:33Z</updated>
<entry>
<title>net: rework recvmsg handler msg_name and msg_namelen logic</title>
<updated>2014-01-03T04:33:33Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2013-11-21T02:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a598f7fa9c24c3ef458043d59c237b8fc5d1adad'/>
<id>urn:sha1:a598f7fa9c24c3ef458043d59c237b8fc5d1adad</id>
<content type='text'>
[ Upstream commit f3d3342602f8bcbf37d7c46641cb9bca7618eb1c ]

This patch now always passes msg-&gt;msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size &lt;= sizeof(struct sockaddr_storage)
to return msg_name to the user.

This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers and makes it harder for new code to accidentally leak
uninitialized memory.

Optimize for the case recvfrom is called with NULL as address. We don't
need to copy the address at all, so set it to NULL before invoking the
recvmsg handler. We can do so, because all the recvmsg handlers must
cope with the case a plain read() is called on them. read() also sets
msg_name to NULL.

Also document these changes in include/linux/net.h as suggested by David
Miller.

Changes since RFC:

Set msg-&gt;msg_name = NULL if user specified a NULL in msg_name but had a
non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't
affect sendto as it would bail out earlier while trying to copy-in the
address. It also more naturally reflects the logic by the callers of
verify_iovec.

With this change in place I could remove "
if (!uaddr || msg_sys-&gt;msg_namelen == 0)
	msg-&gt;msg_name = NULL
".

This change does not alter the user visible error logic as we ignore
msg_namelen as long as msg_name is NULL.

Also remove two unnecessary curly brackets in ___sys_recvmsg and change
comments to netdev style.

Cc: David Miller &lt;davem@davemloft.net&gt;
Suggested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>NFC: Return from rawsock_release when sk is NULL</title>
<updated>2012-07-12T03:32:02Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-06-11T22:47:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b82b566a46ef61f26f461f0c55e6588b2cc93384'/>
<id>urn:sha1:b82b566a46ef61f26f461f0c55e6588b2cc93384</id>
<content type='text'>
commit 03e934f620101ca2cfc9383bd76172dd3e1f8567 upstream.

Sasha Levin reported following panic :

[ 2136.383310] BUG: unable to handle kernel NULL pointer dereference at
00000000000003b0
[ 2136.384022] IP: [&lt;ffffffff8114e400&gt;] __lock_acquire+0xc0/0x4b0
[ 2136.384022] PGD 131c4067 PUD 11c0c067 PMD 0
[ 2136.388106] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[ 2136.388106] CPU 1
[ 2136.388106] Pid: 24855, comm: trinity-child1 Tainted: G        W
3.5.0-rc2-sasha-00015-g7b268f7 #374
[ 2136.388106] RIP: 0010:[&lt;ffffffff8114e400&gt;]  [&lt;ffffffff8114e400&gt;]
__lock_acquire+0xc0/0x4b0
[ 2136.388106] RSP: 0018:ffff8800130b3ca8  EFLAGS: 00010046
[ 2136.388106] RAX: 0000000000000086 RBX: ffff88001186b000 RCX:
0000000000000000
[ 2136.388106] RDX: 0000000000000000 RSI: 0000000000000000 RDI:
0000000000000000
[ 2136.388106] RBP: ffff8800130b3d08 R08: 0000000000000001 R09:
0000000000000000
[ 2136.388106] R10: 0000000000000000 R11: 0000000000000001 R12:
0000000000000002
[ 2136.388106] R13: 00000000000003b0 R14: 0000000000000000 R15:
0000000000000000
[ 2136.388106] FS:  00007fa5b1bd4700(0000) GS:ffff88001b800000(0000)
knlGS:0000000000000000
[ 2136.388106] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2136.388106] CR2: 00000000000003b0 CR3: 0000000011d1f000 CR4:
00000000000406e0
[ 2136.388106] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[ 2136.388106] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[ 2136.388106] Process trinity-child1 (pid: 24855, threadinfo
ffff8800130b2000, task ffff88001186b000)
[ 2136.388106] Stack:
[ 2136.388106]  ffff8800130b3cd8 ffffffff81121785 ffffffff81236774
000080d000000001
[ 2136.388106]  ffff88001b9d6c00 00000000001d6c00 ffffffff130b3d08
ffff88001186b000
[ 2136.388106]  0000000000000000 0000000000000002 0000000000000000
0000000000000000
[ 2136.388106] Call Trace:
[ 2136.388106]  [&lt;ffffffff81121785&gt;] ? sched_clock_local+0x25/0x90
[ 2136.388106]  [&lt;ffffffff81236774&gt;] ? get_empty_filp+0x74/0x220
[ 2136.388106]  [&lt;ffffffff8114e97a&gt;] lock_acquire+0x18a/0x1e0
[ 2136.388106]  [&lt;ffffffff836b37df&gt;] ? rawsock_release+0x4f/0xa0
[ 2136.388106]  [&lt;ffffffff837c0ef0&gt;] _raw_write_lock_bh+0x40/0x80
[ 2136.388106]  [&lt;ffffffff836b37df&gt;] ? rawsock_release+0x4f/0xa0
[ 2136.388106]  [&lt;ffffffff836b37df&gt;] rawsock_release+0x4f/0xa0
[ 2136.388106]  [&lt;ffffffff8321cfe8&gt;] sock_release+0x18/0x70
[ 2136.388106]  [&lt;ffffffff8321d069&gt;] sock_close+0x29/0x30
[ 2136.388106]  [&lt;ffffffff81236bca&gt;] __fput+0x11a/0x2c0
[ 2136.388106]  [&lt;ffffffff81236d85&gt;] fput+0x15/0x20
[ 2136.388106]  [&lt;ffffffff8321de34&gt;] sys_accept4+0x1b4/0x200
[ 2136.388106]  [&lt;ffffffff837c165c&gt;] ? _raw_spin_unlock_irq+0x4c/0x80
[ 2136.388106]  [&lt;ffffffff837c1669&gt;] ? _raw_spin_unlock_irq+0x59/0x80
[ 2136.388106]  [&lt;ffffffff837c2565&gt;] ? sysret_check+0x22/0x5d
[ 2136.388106]  [&lt;ffffffff8321de8b&gt;] sys_accept+0xb/0x10
[ 2136.388106]  [&lt;ffffffff837c2539&gt;] system_call_fastpath+0x16/0x1b
[ 2136.388106] Code: ec 04 00 0f 85 ea 03 00 00 be d5 0b 00 00 48 c7 c7
8a c1 40 84 e8 b1 a5 f8 ff 31 c0 e9 d4 03 00 00 66 2e 0f 1f 84 00 00 00
00 00 &lt;49&gt; 81 7d 00 60 73 5e 85 b8 01 00 00 00 44 0f 44 e0 83 fe 01 77
[ 2136.388106] RIP  [&lt;ffffffff8114e400&gt;] __lock_acquire+0xc0/0x4b0
[ 2136.388106]  RSP &lt;ffff8800130b3ca8&gt;
[ 2136.388106] CR2: 00000000000003b0
[ 2136.388106] ---[ end trace 6d450e935ee18982 ]---
[ 2136.388106] Kernel panic - not syncing: Fatal exception in interrupt

rawsock_release() should test if sock-&gt;sk is NULL before calling
sock_orphan()/sock_put()

Reported-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Tested-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
[bwh: Backported to 3.2: keep using nfc_dbg(), not pr_debug()]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>NFC: Prevent multiple buffer overflows in NCI</title>
<updated>2012-07-12T03:32:01Z</updated>
<author>
<name>Dan Rosenberg</name>
<email>dan.j.rosenberg@gmail.com</email>
</author>
<published>2012-06-25T14:05:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ec5b2b02eedb2c3471d5a87ba0f72d11b04c2af1'/>
<id>urn:sha1:ec5b2b02eedb2c3471d5a87ba0f72d11b04c2af1</id>
<content type='text'>
commit 67de956ff5dc1d4f321e16cfbd63f5be3b691b43 upstream.

Fix multiple remotely-exploitable stack-based buffer overflows due to
the NCI code pulling length fields directly from incoming frames and
copying too much data into statically-sized arrays.

Signed-off-by: Dan Rosenberg &lt;dan.j.rosenberg@gmail.com&gt;
Cc: security@kernel.org
Cc: Lauro Ramos Venancio &lt;lauro.venancio@openbossa.org&gt;
Cc: Aloisio Almeida Jr &lt;aloisio.almeida@openbossa.org&gt;
Cc: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Ilan Elias &lt;ilane@ti.com&gt;
Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
[bwh: Backported to 3.2:
 - Drop changes to parsing of tech B and tech F parameters
 - Various renaming]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem</title>
<updated>2011-12-15T18:47:58Z</updated>
<author>
<name>John W. Linville</name>
<email>linville@tuxdriver.com</email>
</author>
<published>2011-12-15T18:47:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=42a3b63bb2ca4996a3d1210a004eae2333f1119e'/>
<id>urn:sha1:42a3b63bb2ca4996a3d1210a004eae2333f1119e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nfc: signedness bug in __nci_request()</title>
<updated>2011-12-12T19:23:27Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2011-12-09T06:35:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f8c141c3e915e3a040d4c1badde28e23f8cbe255'/>
<id>urn:sha1:f8c141c3e915e3a040d4c1badde28e23f8cbe255</id>
<content type='text'>
wait_for_completion_interruptible_timeout() returns -ERESTARTSYS if
interrupted so completion_rc needs to be signed.  The current code
probably returns -ETIMEDOUT if we hit this situation, but after this
patch is applied it will return -ERESTARTSYS.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux</title>
<updated>2011-11-07T03:44:47Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-11-07T03:44:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=32aaeffbd4a7457bf2f7448b33b5946ff2a960eb'/>
<id>urn:sha1:32aaeffbd4a7457bf2f7448b33b5946ff2a960eb</id>
<content type='text'>
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
  Revert "tracing: Include module.h in define_trace.h"
  irq: don't put module.h into irq.h for tracking irqgen modules.
  bluetooth: macroize two small inlines to avoid module.h
  ip_vs.h: fix implicit use of module_get/module_put from module.h
  nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
  include: replace linux/module.h with "struct module" wherever possible
  include: convert various register fcns to macros to avoid include chaining
  crypto.h: remove unused crypto_tfm_alg_modname() inline
  uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
  pm_runtime.h: explicitly requires notifier.h
  linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
  miscdevice.h: fix up implicit use of lists and types
  stop_machine.h: fix implicit use of smp.h for smp_processor_id
  of: fix implicit use of errno.h in include/linux/of.h
  of_platform.h: delete needless include &lt;linux/module.h&gt;
  acpi: remove module.h include from platform/aclinux.h
  miscdevice.h: delete unnecessary inclusion of module.h
  device_cgroup.h: delete needless include &lt;linux/module.h&gt;
  net: sch_generic remove redundant use of &lt;linux/module.h&gt;
  net: inet_timewait_sock doesnt need &lt;linux/module.h&gt;
  ...

Fix up trivial conflicts (other header files, and  removal of the ab3550 mfd driver) in
 - drivers/media/dvb/frontends/dibx000_common.c
 - drivers/media/video/{mt9m111.c,ov6650.c}
 - drivers/mfd/ab3550-core.c
 - include/linux/dmaengine.h
</content>
</entry>
<entry>
<title>treewide: use __printf not __attribute__((format(printf,...)))</title>
<updated>2011-11-01T00:30:54Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2011-11-01T00:11:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b9075fa968a0a4347aef35e235e2995c0e57dddd'/>
<id>urn:sha1:b9075fa968a0a4347aef35e235e2995c0e57dddd</id>
<content type='text'>
Standardize the style for compiler based printf format verification.
Standardized the location of __printf too.

Done via script and a little typing.

$ grep -rPl --include=*.[ch] -w "__attribute__" * | \
  grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
  xargs perl -n -i -e 'local $/; while (&lt;&gt;) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

[akpm@linux-foundation.org: revert arch bits]
Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: "Kirill A. Shutemov" &lt;kirill@shutemov.name&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules</title>
<updated>2011-10-31T23:30:30Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-07-15T15:47:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bc3b2d7fb9b014d75ebb79ba371a763dbab5e8cf'/>
<id>urn:sha1:bc3b2d7fb9b014d75ebb79ba371a763dbab5e8cf</id>
<content type='text'>
These files are non modular, but need to export symbols using
the macros now living in export.h -- call out the include so
that things won't break when we remove the implicit presence
of module.h from everywhere.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>net: Fix files explicitly needing to include module.h</title>
<updated>2011-10-31T23:30:28Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-05-27T13:12:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3a9a231d977222eea36eae091df2c358e03ac839'/>
<id>urn:sha1:3a9a231d977222eea36eae091df2c358e03ac839</id>
<content type='text'>
With calls to modular infrastructure, these files really
needs the full module.h header.  Call it out so some of the
cleanups of implicit and unrequired includes elsewhere can be
cleaned up.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>NFC: use after free on error</title>
<updated>2011-09-27T18:34:10Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2011-09-23T06:14:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8ebafde00ed0c682fed8c34ac5ba90160ea0bb30'/>
<id>urn:sha1:8ebafde00ed0c682fed8c34ac5ba90160ea0bb30</id>
<content type='text'>
We returned a freed variable on some error paths when the intent was
to return a NULL.  Part of the reason this was missed was that the
code was confusing because it had too many gotos so I removed them
and simplified the flow a bit.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Lauro Ramos Venancio &lt;lauro.venancio@openbossa.org&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
</entry>
</feed>
