<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/proc/proc_sysctl.c, branch v3.4.96</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/proc/proc_sysctl.c?h=v3.4.96</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/proc/proc_sysctl.c?h=v3.4.96'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-10-02T17:29:54Z</updated>
<entry>
<title>fs/proc: fix potential unregister_sysctl_table hang</title>
<updated>2012-10-02T17:29:54Z</updated>
<author>
<name>Francesco Ruggeri</name>
<email>fruggeri@aristanetworks.com</email>
</author>
<published>2012-09-13T22:03:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2ad98b042313307859bf2f332b95b6588ec0ba0d'/>
<id>urn:sha1:2ad98b042313307859bf2f332b95b6588ec0ba0d</id>
<content type='text'>
commit 6bf6104573482570f7103d3e5ddf9574db43a363 upstream.

The unregister_sysctl_table() function hangs if all references to its
ctl_table_header structure are not dropped.

This can happen sometimes because of a leak in proc_sys_lookup():
proc_sys_lookup() gets a reference to the table via lookup_entry(), but
it does not release it when a subsequent call to sysctl_follow_link()
fails.

This patch fixes this leak by making sure the reference is always
dropped on return.

See also commit 076c3eed2c31 ("sysctl: Rewrite proc_sys_lookup
introducing find_entry and lookup_entry") which reorganized this code in
3.4.

Tested in Linux 3.4.4.

Signed-off-by: Francesco Ruggeri &lt;fruggeri@aristanetworks.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl</title>
<updated>2012-03-24T01:08:58Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-24T01:08:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f1d38e423a697b7aa06e12d3ca4753bcc1aa3531'/>
<id>urn:sha1:f1d38e423a697b7aa06e12d3ca4753bcc1aa3531</id>
<content type='text'>
Pull sysctl updates from Eric Biederman:

 - Rewrite of sysctl for speed and clarity.

   Insert/remove/Lookup in sysctl are all now O(NlogN) operations, and
   are no longer bottlenecks in the process of adding and removing
   network devices.

   sysctl is now focused on being a filesystem instead of system call
   and the code can all be found in fs/proc/proc_sysctl.c.  Hopefully
   this means the code is now approachable.

   Much thanks is owed to Lucian Grinjincu for keeping at this until
   something was found that was usable.

 - The recent proc_sys_poll oops found by the fuzzer during hibernation
   is fixed.

* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl: (36 commits)
  sysctl: protect poll() in entries that may go away
  sysctl: Don't call sysctl_follow_link unless we are a link.
  sysctl: Comments to make the code clearer.
  sysctl: Correct error return from get_subdir
  sysctl: An easier to read version of find_subdir
  sysctl: fix memset parameters in setup_sysctl_set()
  sysctl: remove an unused variable
  sysctl: Add register_sysctl for normal sysctl users
  sysctl: Index sysctl directories with rbtrees.
  sysctl: Make the header lists per directory.
  sysctl: Move sysctl_check_dups into insert_header
  sysctl: Modify __register_sysctl_paths to take a set instead of a root and an nsproxy
  sysctl: Replace root_list with links between sysctl_table_sets.
  sysctl: Add sysctl_print_dir and use it in get_subdir
  sysctl: Stop requiring explicit management of sysctl directories
  sysctl: Add a root pointer to ctl_table_set
  sysctl: Rewrite proc_sys_readdir in terms of first_entry and next_entry
  sysctl: Rewrite proc_sys_lookup introducing find_entry and lookup_entry.
  sysctl: Normalize the root_table data structure.
  sysctl: Factor out insert_header and erase_header
  ...
</content>
</entry>
<entry>
<title>sysctl: protect poll() in entries that may go away</title>
<updated>2012-03-22T21:46:56Z</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@profusion.mobi</email>
</author>
<published>2012-03-22T21:42:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4e474a00d7ff746ed177ddae14fa8b2d4bad7a00'/>
<id>urn:sha1:4e474a00d7ff746ed177ddae14fa8b2d4bad7a00</id>
<content type='text'>
Protect code accessing ctl_table by grabbing the header with grab_header()
and after releasing with sysctl_head_finish().  This is needed if poll()
is called in entries created by modules: currently only hostname and
domainname support poll(), but this bug may be triggered when/if modules
use it and if user called poll() in a file that doesn't support it.

Dave Jones reported the following when using a syscall fuzzer while
hibernating/resuming:

RIP: 0010:[&lt;ffffffff81233e3e&gt;]  [&lt;ffffffff81233e3e&gt;] proc_sys_poll+0x4e/0x90
RAX: 0000000000000145 RBX: ffff88020cab6940 RCX: 0000000000000000
RDX: ffffffff81233df0 RSI: 6b6b6b6b6b6b6b6b RDI: ffff88020cab6940
[ ... ]
Code: 00 48 89 fb 48 89 f1 48 8b 40 30 4c 8b 60 e8 b8 45 01 00 00 49 83
7c 24 28 00 74 2e 49 8b 74 24 30 48 85 f6 74 24 48 85 c9 75 32 &lt;8b&gt; 16
b8 45 01 00 00 48 63 d2 49 39 d5 74 10 8b 06 48 98 48 89

If an entry goes away while we are polling() it, ctl_table may not exist
anymore.

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>security: trim security.h</title>
<updated>2012-02-13T23:45:42Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ftp.linux.org.uk</email>
</author>
<published>2012-02-13T03:58:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4040153087478993cbf0809f444400a3c808074c'/>
<id>urn:sha1:4040153087478993cbf0809f444400a3c808074c</id>
<content type='text'>
Trim security.h

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>sysctl: Don't call sysctl_follow_link unless we are a link.</title>
<updated>2012-02-02T03:21:38Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2012-01-31T05:24:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4e75732035d7e97e001bdf6e3149d3967c0221de'/>
<id>urn:sha1:4e75732035d7e97e001bdf6e3149d3967c0221de</id>
<content type='text'>
There are no functional changes.  Just code motion to make it
clear that we don't follow a link between sysctl roots unless the
directory entry actually is a link.

Suggested-by:  Lucian Adrian Grijincu &lt;lucian.grijincu@gmail.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>sysctl: Comments to make the code clearer.</title>
<updated>2012-02-02T03:20:57Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2012-01-31T05:23:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=60f126d93b210ae708e2a5bb4a3be2121831f2a0'/>
<id>urn:sha1:60f126d93b210ae708e2a5bb4a3be2121831f2a0</id>
<content type='text'>
Document get_subdir and that find_subdir alwasy takes a reference.

Suggested-by:  Lucian Adrian Grijincu &lt;lucian.grijincu@gmail.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>sysctl: Correct error return from get_subdir</title>
<updated>2012-02-02T03:20:40Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2012-01-31T04:37:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0eb97f38d2bfaea289b44c5140a7b04e7b369bad'/>
<id>urn:sha1:0eb97f38d2bfaea289b44c5140a7b04e7b369bad</id>
<content type='text'>
When insert_header fails ensure we return the proper error value
from get_subdir.  In practice nothing cares, but there is no
need to be sloppy.

Reported-by: Lucian Adrian Grijincu &lt;lucian.grijincu@gmail.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>sysctl: An easier to read version of find_subdir</title>
<updated>2012-02-02T03:20:30Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2012-01-31T04:09:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=51f72f4a0f92e4abde33a8bca0fac9667575d035'/>
<id>urn:sha1:51f72f4a0f92e4abde33a8bca0fac9667575d035</id>
<content type='text'>
Suggested-by:  Lucian Adrian Grijincu &lt;lucian.grijincu@gmail.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>sysctl: fix memset parameters in setup_sysctl_set()</title>
<updated>2012-01-31T03:14:08Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2012-01-30T13:40:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1347440db6f76ec5ae0af8d8558387f571a5e1dd'/>
<id>urn:sha1:1347440db6f76ec5ae0af8d8558387f571a5e1dd</id>
<content type='text'>
The current code is a nop.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>sysctl: remove an unused variable</title>
<updated>2012-01-31T03:13:46Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2012-01-30T13:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=47981787092aecb87dc3cb2d478455dcfb77516a'/>
<id>urn:sha1:47981787092aecb87dc3cb2d478455dcfb77516a</id>
<content type='text'>
"links" is never used, so we can remove it.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
</feed>
