<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/reiserfs/procfs.c, branch linux-3.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-12-16T15:20:06Z</updated>
<entry>
<title>reiserfs: don't compile procfs.o at all if no support</title>
<updated>2009-12-16T15:20:06Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2009-12-16T00:46:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3c96f53ac132743fda1384910feb863a2eab916'/>
<id>urn:sha1:e3c96f53ac132743fda1384910feb863a2eab916</id>
<content type='text'>
* small define cleanup in header
* fix #ifdeffery in procfs.c via Kconfig

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Jeff Mahoney &lt;jeffm@suse.com&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>reiserfs: remove /proc/fs/reiserfs/version</title>
<updated>2009-12-16T15:20:06Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2009-12-16T00:46:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=904e812931f001b984912b2d2f653ea69520313c'/>
<id>urn:sha1:904e812931f001b984912b2d2f653ea69520313c</id>
<content type='text'>
/proc/fs/reiserfs/version is on the way of removing -&gt;read_proc interface.
 It's empty however, so simply remove it instead of doing dummy
conversion.  It's hard to see what information userspace can extract from
empty file.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Jeff Mahoney &lt;jeffm@suse.com&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>proc 2/2: remove struct proc_dir_entry::owner</title>
<updated>2009-03-30T21:14:44Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2009-03-25T19:48:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99b76233803beab302123d243eea9e41149804f3'/>
<id>urn:sha1:99b76233803beab302123d243eea9e41149804f3</id>
<content type='text'>
Setting -&gt;owner as done currently (pde-&gt;owner = THIS_MODULE) is racy
as correctly noted at bug #12454. Someone can lookup entry with NULL
-&gt;owner, thus not pinning enything, and release it later resulting
in module refcount underflow.

We can keep -&gt;owner and supply it at registration time like -&gt;proc_fops
and -&gt;data.

But this leaves -&gt;owner as easy-manipulative field (just one C assignment)
and somebody will forget to unpin previous/pin current module when
switching -&gt;owner. -&gt;proc_fops is declared as "const" which should give
some thoughts.

-&gt;read_proc/-&gt;write_proc were just fixed to not require -&gt;owner for
protection.

rmmod'ed directories will be empty and return "." and ".." -- no harm.
And directories with tricky enough readdir and lookup shouldn't be modular.
We definitely don't want such modular code.

Removing -&gt;owner will also make PDE smaller.

So, let's nuke it.

Kudos to Jeff Layton for reminding about this, let's say, oversight.

http://bugzilla.kernel.org/show_bug.cgi?id=12454

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
</content>
</entry>
<entry>
<title>reiserfs: strip trailing whitespace</title>
<updated>2009-03-30T19:16:39Z</updated>
<author>
<name>Jeff Mahoney</name>
</author>
<published>2009-03-30T18:02:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0222e6571c332563a48d4cf5487b67feabe60b5e'/>
<id>urn:sha1:0222e6571c332563a48d4cf5487b67feabe60b5e</id>
<content type='text'>
This patch strips trailing whitespace from the reiserfs code.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>reiserfs: rework reiserfs_warning</title>
<updated>2009-03-30T19:16:36Z</updated>
<author>
<name>Jeff Mahoney</name>
</author>
<published>2009-03-30T18:02:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=45b03d5e8e674eb6555b767e1c8eb40b671ff892'/>
<id>urn:sha1:45b03d5e8e674eb6555b767e1c8eb40b671ff892</id>
<content type='text'>
ReiserFS warnings can be somewhat inconsistent.
In some cases:
 * a unique identifier may be associated with it
 * the function name may be included
 * the device may be printed separately

This patch aims to make warnings more consistent. reiserfs_warning() prints
the device name, so printing it a second time is not required. The function
name for a warning is always helpful in debugging, so it is now automatically
inserted into the output. Hans has stated that every warning should have
a unique identifier. Some cases lack them, others really shouldn't have them.
reiserfs_warning() now expects an id associated with each message. In the
rare case where one isn't needed, "" will suffice.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>reiserfs: audit transaction ids to always be unsigned ints</title>
<updated>2009-03-30T19:16:35Z</updated>
<author>
<name>Jeff Mahoney</name>
</author>
<published>2009-03-30T18:02:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=600ed41675d8c384519d8f0b3c76afed39ef2f4b'/>
<id>urn:sha1:600ed41675d8c384519d8f0b3c76afed39ef2f4b</id>
<content type='text'>
This patch fixes up the reiserfs code such that transaction ids are
always unsigned ints.  In places they can currently be signed ints or
unsigned longs.

The former just causes an annoying clm-2200 warning and may join a
transaction when it should wait.

The latter is just for correctness since the disk format uses a 32-bit
transaction id.  There aren't any runtime problems that result from it
not wrapping at the correct location since the value is truncated
correctly even on big endian systems.  The 0 value might make it to
disk, but the mount-time checks will bump it to 10 itself.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>reiserfs/procfs.c: remove CVS keywords</title>
<updated>2008-10-16T18:21:46Z</updated>
<author>
<name>Adrian Bunk</name>
</author>
<published>2008-10-16T05:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b23ea7679978e6e1148aae9245021dfbcd989d7'/>
<id>urn:sha1:6b23ea7679978e6e1148aae9245021dfbcd989d7</id>
<content type='text'>
Remove CVS keywords that weren't updated for a long time from comments.

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&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>reiserfs: use non-racy method for proc entries creation</title>
<updated>2008-04-29T15:06:20Z</updated>
<author>
<name>Denis V. Lunev</name>
</author>
<published>2008-04-29T08:02:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19b4fc52d63b77adf700a215bfbabd680a8f1718'/>
<id>urn:sha1:19b4fc52d63b77adf700a215bfbabd680a8f1718</id>
<content type='text'>
Use proc_create()/proc_create_data() to make sure that -&gt;proc_fops and -&gt;data
be setup before gluing PDE to main tree.

/proc entry owner is also added.

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
Cc: Jeff Mahoney &lt;jeffm@suse.com&gt;
Cc: Chris Mason &lt;chris.mason@oracle.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&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>reiserfs: constify function pointer tables</title>
<updated>2008-02-08T17:22:38Z</updated>
<author>
<name>Jan Engelhardt</name>
</author>
<published>2008-02-08T12:21:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec26e11740cdff8c3c8330ea235478704ffb4a71'/>
<id>urn:sha1:ec26e11740cdff8c3c8330ea235478704ffb4a71</id>
<content type='text'>
Signed-off-by: Jan Engelhardt &lt;jengelh@computergmbh.de&gt;
Acked-by: Jeff Mahoney &lt;jeffm@suse.com&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>proc: fix proc_dir_entry refcounting</title>
<updated>2007-12-05T17:21:20Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2007-12-05T07:45:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a622f2d0f86b316b07b55a4866ecb5518dd1cf7'/>
<id>urn:sha1:5a622f2d0f86b316b07b55a4866ecb5518dd1cf7</id>
<content type='text'>
Creating PDEs with refcount 0 and "deleted" flag has problems (see below).
Switch to usual scheme:
* PDE is created with refcount 1
* every de_get does +1
* every de_put() and remove_proc_entry() do -1
* once refcount reaches 0, PDE is freed.

This elegantly fixes at least two following races (both observed) without
introducing new locks, without abusing old locks, without spreading
lock_kernel():

1) PDE leak

remove_proc_entry			de_put
-----------------			------
			[refcnt = 1]
if (atomic_read(&amp;de-&gt;count) == 0)
					if (atomic_dec_and_test(&amp;de-&gt;count))
						if (de-&gt;deleted)
							/* also not taken! */
							free_proc_entry(de);
else
	de-&gt;deleted = 1;
		[refcount=0, deleted=1]

2) use after free

remove_proc_entry			de_put
-----------------			------
			[refcnt = 1]

					if (atomic_dec_and_test(&amp;de-&gt;count))
if (atomic_read(&amp;de-&gt;count) == 0)
	free_proc_entry(de);
						/* boom! */
						if (de-&gt;deleted)
							free_proc_entry(de);

BUG: unable to handle kernel paging request at virtual address 6b6b6b6b
printing eip: c10acdda *pdpt = 00000000338f8001 *pde = 0000000000000000
Oops: 0000 [#1] PREEMPT SMP
Modules linked in: af_packet ipv6 cpufreq_ondemand loop serio_raw psmouse k8temp hwmon sr_mod cdrom
Pid: 23161, comm: cat Not tainted (2.6.24-rc2-8c0863403f109a43d7000b4646da4818220d501f #4)
EIP: 0060:[&lt;c10acdda&gt;] EFLAGS: 00210097 CPU: 1
EIP is at strnlen+0x6/0x18
EAX: 6b6b6b6b EBX: 6b6b6b6b ECX: 6b6b6b6b EDX: fffffffe
ESI: c128fa3b EDI: f380bf34 EBP: ffffffff ESP: f380be44
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process cat (pid: 23161, ti=f380b000 task=f38f2570 task.ti=f380b000)
Stack: c10ac4f0 00000278 c12ce000 f43cd2a8 00000163 00000000 7da86067 00000400
       c128fa20 00896b18 f38325a8 c128fe20 ffffffff 00000000 c11f291e 00000400
       f75be300 c128fa20 f769c9a0 c10ac779 f380bf34 f7bfee70 c1018e6b f380bf34
Call Trace:
 [&lt;c10ac4f0&gt;] vsnprintf+0x2ad/0x49b
 [&lt;c10ac779&gt;] vscnprintf+0x14/0x1f
 [&lt;c1018e6b&gt;] vprintk+0xc5/0x2f9
 [&lt;c10379f1&gt;] handle_fasteoi_irq+0x0/0xab
 [&lt;c1004f44&gt;] do_IRQ+0x9f/0xb7
 [&lt;c117db3b&gt;] preempt_schedule_irq+0x3f/0x5b
 [&lt;c100264e&gt;] need_resched+0x1f/0x21
 [&lt;c10190ba&gt;] printk+0x1b/0x1f
 [&lt;c107c8ad&gt;] de_put+0x3d/0x50
 [&lt;c107c8f8&gt;] proc_delete_inode+0x38/0x41
 [&lt;c107c8c0&gt;] proc_delete_inode+0x0/0x41
 [&lt;c1066298&gt;] generic_delete_inode+0x5e/0xc6
 [&lt;c1065aa9&gt;] iput+0x60/0x62
 [&lt;c1063c8e&gt;] d_kill+0x2d/0x46
 [&lt;c1063fa9&gt;] dput+0xdc/0xe4
 [&lt;c10571a1&gt;] __fput+0xb0/0xcd
 [&lt;c1054e49&gt;] filp_close+0x48/0x4f
 [&lt;c1055ee9&gt;] sys_close+0x67/0xa5
 [&lt;c10026b6&gt;] sysenter_past_esp+0x5f/0x85
=======================
Code: c9 74 0c f2 ae 74 05 bf 01 00 00 00 4f 89 fa 5f 89 d0 c3 85 c9 57 89 c7 89 d0 74 05 f2 ae 75 01 4f 89 f8 5f c3 89 c1 89 c8 eb 06 &lt;80&gt; 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 c3 90 90 90 57 83 c9
EIP: [&lt;c10acdda&gt;] strnlen+0x6/0x18 SS:ESP 0068:f380be44

Also, remove broken usage of -&gt;deleted from reiserfs: if sget() succeeds,
module is already pinned and remove_proc_entry() can't happen =&gt; nobody
can mark PDE deleted.

Dummy proc root in netns code is not marked with refcount 1. AFAICS, we
never get it, it's just for proper /proc/net removal. I double checked
CLONE_NETNS continues to work.

Patch survives many hours of modprobe/rmmod/cat loops without new bugs
which can be attributed to refcounting.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@sw.ru&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&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>
</feed>
