<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/acct.c, branch v4.9.147</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.147</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.147'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-01-10T08:29:51Z</updated>
<entry>
<title>kernel/acct.c: fix the acct-&gt;needcheck check in check_free_space()</title>
<updated>2018-01-10T08:29:51Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2018-01-05T00:17:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=790080ce0e3288c2d289d0771aa63814949c6da5'/>
<id>urn:sha1:790080ce0e3288c2d289d0771aa63814949c6da5</id>
<content type='text'>
commit 4d9570158b6260f449e317a5f9ed030c2504a615 upstream.

As Tsukada explains, the time_is_before_jiffies(acct-&gt;needcheck) check
is very wrong, we need time_is_after_jiffies() to make sys_acct() work.

Ignoring the overflows, the code should "goto out" if needcheck &gt;
jiffies, while currently it checks "needcheck &lt; jiffies" and thus in the
likely case check_free_space() does nothing until jiffies overflow.

In particular this means that sys_acct() is simply broken, acct_on()
sets acct-&gt;needcheck = jiffies and expects that check_free_space()
should set acct-&gt;active = 1 after the free-space check, but this won't
happen if jiffies increments in between.

This was broken by commit 32dc73086015 ("get rid of timer in
kern/acct.c") in 2011, then another (correct) commit 795a2f22a8ea
("acct() should honour the limits from the very beginning") made the
problem more visible.

Link: http://lkml.kernel.org/r/20171213133940.GA6554@redhat.com
Fixes: 32dc73086015 ("get rid of timer in kern/acct.c")
Reported-by: TSUKADA Koutaro &lt;tsukada@ascade.co.jp&gt;
Suggested-by: TSUKADA Koutaro &lt;tsukada@ascade.co.jp&gt;
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&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>acct: check FMODE_CAN_WRITE</title>
<updated>2015-04-12T02:27:55Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-03-31T16:30:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d0f88f8d5da674445f23ace60bb1896f4a3a3783'/>
<id>urn:sha1:d0f88f8d5da674445f23ace60bb1896f4a3a3783</id>
<content type='text'>
it's not calling -&gt;write() directly anymore.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>new fs_pin killing logics</title>
<updated>2015-01-26T04:17:28Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-01-10T22:53:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=59eda0e07f43c950d31756213b607af673e551f0'/>
<id>urn:sha1:59eda0e07f43c950d31756213b607af673e551f0</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>get rid of the second argument of acct_kill()</title>
<updated>2015-01-26T04:17:27Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-01-10T22:18:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3b994d98a815d934ab6a77a380882865982c14f9'/>
<id>urn:sha1:3b994d98a815d934ab6a77a380882865982c14f9</id>
<content type='text'>
Replace the old ns-&gt;bacct only with NULL and only if it still points
to acct.  And assign the new value to it *before* calling acct_kill()
in acct_on().  That way we don't need to pass the new acct to acct_kill().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>take count and rcu_head out of fs_pin</title>
<updated>2015-01-26T04:17:27Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-01-10T17:47:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=34cece2e8a1d2b66f00e153a19b80b4d4cec4eb8'/>
<id>urn:sha1:34cece2e8a1d2b66f00e153a19b80b4d4cec4eb8</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>pull bumping refcount into -&gt;kill()</title>
<updated>2015-01-26T04:16:29Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-01-10T05:07:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=32426f6653cbfde1ca16aff27a530ee36332f796'/>
<id>urn:sha1:32426f6653cbfde1ca16aff27a530ee36332f796</id>
<content type='text'>
there will be one more change of -&gt;kill() calling conventions; this
isn't final.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>kill pin_put()</title>
<updated>2015-01-26T04:16:28Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-01-10T01:40:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9e251d02041432487d89cb340e72490c4bbc198a'/>
<id>urn:sha1:9e251d02041432487d89cb340e72490c4bbc198a</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>acct: eliminate compile warning</title>
<updated>2014-10-10T02:26:04Z</updated>
<author>
<name>Ying Xue</name>
<email>ying.xue@windriver.com</email>
</author>
<published>2014-10-09T22:30:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=067b722faf98adbe1e94581f39c06a7c82b58676'/>
<id>urn:sha1:067b722faf98adbe1e94581f39c06a7c82b58676</id>
<content type='text'>
If ACCT_VERSION is not defined to 3, below warning appears:
  CC      kernel/acct.o
  kernel/acct.c: In function `do_acct_process':
  kernel/acct.c:475:24: warning: unused variable `ns' [-Wunused-variable]

[akpm@linux-foundation.org: retain the local for code size improvements
Signed-off-by: Ying Xue &lt;ying.xue@windriver.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>kernel/acct.c: fix coding style warnings and errors</title>
<updated>2014-08-07T18:40:09Z</updated>
<author>
<name>Ionut Alexa</name>
<email>ionut.m.alexa@gmail.com</email>
</author>
<published>2014-07-30T23:28:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2577d92ebd28dd9b3dacdfad6dcd81be0d21bbdf'/>
<id>urn:sha1:2577d92ebd28dd9b3dacdfad6dcd81be0d21bbdf</id>
<content type='text'>
Signed-off-by: Ionut Alexa &lt;ionut.m.alexa@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>death to mnt_pinned</title>
<updated>2014-08-07T18:40:09Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-08-07T13:12:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3064c3563ba4c23e2c7a47254ec056ed9ba0098a'/>
<id>urn:sha1:3064c3563ba4c23e2c7a47254ec056ed9ba0098a</id>
<content type='text'>
Rather than playing silly buggers with vfsmount refcounts, just have
acct_on() ask fs/namespace.c for internal clone of file-&gt;f_path.mnt
and replace it with said clone.  Then attach the pin to original
vfsmount.  Voila - the clone will be alive until the file gets closed,
making sure that underlying superblock remains active, etc., and
we can drop the original vfsmount, so that it's not kept busy.
If the file lives until the final mntput of the original vfsmount,
we'll notice that there's an fs_pin (one in bsd_acct_struct that
holds that file) and mnt_pin_kill() will take it out.  Since
-&gt;kill() is synchronous, we won't proceed past that point until
these files are closed (and private clones of our vfsmount are
gone), so we get the same ordering warranties we used to get.

mnt_pin()/mnt_unpin()/-&gt;mnt_pinned is gone now, and good riddance -
it never became usable outside of kernel/acct.c (and racy wrt
umount even there).

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
