<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/ecryptfs/miscdev.c, branch v6.12.80</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>ecryptfs: miscdev: File headers are not good kernel-doc candidates</title>
<updated>2021-04-19T04:42:13+00:00</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2021-03-30T16:44:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=65bbb7b84611c59725276ed1e03105fa002da9af'/>
<id>65bbb7b84611c59725276ed1e03105fa002da9af</id>
<content type='text'>
Supply description for the 'daemon' param too.

Fixes the following W=1 kernel build warning(s):

 fs/ecryptfs/miscdev.c:19: warning: cannot understand function prototype: 'atomic_t ecryptfs_num_miscdev_opens; '
 fs/ecryptfs/miscdev.c:323: warning: Function parameter or member 'daemon' not described in 'ecryptfs_miscdev_response'

Cc: Tyler Hicks &lt;code@tyhicks.com&gt;
Cc: "Michael A. Halcrow" &lt;mhalcrow@us.ibm.com&gt;
Cc: ecryptfs@vger.kernel.org
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Tyler Hicks &lt;code@tyhicks.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Supply description for the 'daemon' param too.

Fixes the following W=1 kernel build warning(s):

 fs/ecryptfs/miscdev.c:19: warning: cannot understand function prototype: 'atomic_t ecryptfs_num_miscdev_opens; '
 fs/ecryptfs/miscdev.c:323: warning: Function parameter or member 'daemon' not described in 'ecryptfs_miscdev_response'

Cc: Tyler Hicks &lt;code@tyhicks.com&gt;
Cc: "Michael A. Halcrow" &lt;mhalcrow@us.ibm.com&gt;
Cc: ecryptfs@vger.kernel.org
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Tyler Hicks &lt;code@tyhicks.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333</title>
<updated>2019-06-05T15:37:06+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-29T23:57:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=4505153954fdb1465d2b178288a9bf646f2a2166'/>
<id>4505153954fdb1465d2b178288a9bf646f2a2166</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation this program is
  distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details you should have received a copy of the gnu general
  public license along with this program if not write to the free
  software foundation inc 59 temple place suite 330 boston ma 02111
  1307 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 136 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000436.384967451@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation this program is
  distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details you should have received a copy of the gnu general
  public license along with this program if not write to the free
  software foundation inc 59 temple place suite 330 boston ma 02111
  1307 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 136 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000436.384967451@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: do bulk POLL* -&gt; EPOLL* replacement</title>
<updated>2018-02-11T22:34:03+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2018-02-11T22:34:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=a9a08845e9acbd224e4ee466f5c1275ed50054e8'/>
<id>a9a08845e9acbd224e4ee466f5c1275ed50054e8</id>
<content type='text'>
This is the mindless scripted replacement of kernel use of POLL*
variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
        L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
        for f in $L; do sed -i "-es/^\([^\"]*\)\(\&lt;POLL$V\&gt;\)/\\1E\\2/" $f; done
    done

with de-mangling cleanups yet to come.

NOTE! On almost all architectures, the EPOLL* constants have the same
values as the POLL* constants do.  But they keyword here is "almost".
For various bad reasons they aren't the same, and epoll() doesn't
actually work quite correctly in some cases due to this on Sparc et al.

The next patch from Al will sort out the final differences, and we
should be all done.

Scripted-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the mindless scripted replacement of kernel use of POLL*
variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
        L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
        for f in $L; do sed -i "-es/^\([^\"]*\)\(\&lt;POLL$V\&gt;\)/\\1E\\2/" $f; done
    done

with de-mangling cleanups yet to come.

NOTE! On almost all architectures, the EPOLL* constants have the same
values as the POLL* constants do.  But they keyword here is "almost".
For various bad reasons they aren't the same, and epoll() doesn't
actually work quite correctly in some cases due to this on Sparc et al.

The next patch from Al will sort out the final differences, and we
should be all done.

Scripted-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: annotate -&gt;poll() instances</title>
<updated>2017-11-27T21:20:05+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2017-07-03T05:02:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=076ccb76e1a6cf0aa5371132efdd502a11e806f1'/>
<id>076ccb76e1a6cf0aa5371132efdd502a11e806f1</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: Delete 21 error messages for a failed memory allocation</title>
<updated>2017-11-06T18:23:29+00:00</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2017-08-19T15:37:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=1a0bba4ff086d73a88f9dbadaf4831aefce55f27'/>
<id>1a0bba4ff086d73a88f9dbadaf4831aefce55f27</id>
<content type='text'>
Omit extra messages for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Omit extra messages for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: add missing \n to end of various error messages</title>
<updated>2017-11-04T22:16:39+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2016-09-27T12:18:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=0996b67df6c1354f2df09c33ac652c37e2e2471f'/>
<id>0996b67df6c1354f2df09c33ac652c37e2e2471f</id>
<content type='text'>
Trival fix, some error messages are missing a \n, so add it.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trival fix, some error messages are missing a \n, so add it.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: close rmmod race</title>
<updated>2013-04-09T18:08:16+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-03-28T17:30:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=52f21999c7b921a0390708b66ed286282c2e4bee'/>
<id>52f21999c7b921a0390708b66ed286282c2e4bee</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: Make all miscdev functions use daemon ptr in file private_data</title>
<updated>2012-07-08T17:51:44+00:00</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-06-11T16:47:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=2ecaf55db6dcf4dd25e1ef8d5eb6068e3286a20f'/>
<id>2ecaf55db6dcf4dd25e1ef8d5eb6068e3286a20f</id>
<content type='text'>
Now that a pointer to a valid struct ecryptfs_daemon is stored in the
private_data of an opened /dev/ecryptfs file, the remaining miscdev
functions can utilize the pointer rather than looking up the
ecryptfs_daemon at the beginning of each operation.

The security model of /dev/ecryptfs is simplified a little bit with this
patch. Upon opening /dev/ecryptfs, a per-user ecryptfs_daemon is
registered. Another daemon cannot be registered for that user until the
last file reference is released. During the lifetime of the
ecryptfs_daemon, access checks are not performed on the /dev/ecryptfs
operations because it is assumed that the application securely handles
the opened file descriptor and does not unintentionally leak it to
processes that are not trusted.

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Cc: Sasha Levin &lt;levinsasha928@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that a pointer to a valid struct ecryptfs_daemon is stored in the
private_data of an opened /dev/ecryptfs file, the remaining miscdev
functions can utilize the pointer rather than looking up the
ecryptfs_daemon at the beginning of each operation.

The security model of /dev/ecryptfs is simplified a little bit with this
patch. Upon opening /dev/ecryptfs, a per-user ecryptfs_daemon is
registered. Another daemon cannot be registered for that user until the
last file reference is released. During the lifetime of the
ecryptfs_daemon, access checks are not performed on the /dev/ecryptfs
operations because it is assumed that the application securely handles
the opened file descriptor and does not unintentionally leak it to
processes that are not trusted.

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Cc: Sasha Levin &lt;levinsasha928@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: Gracefully refuse miscdev file ops on inherited/passed files</title>
<updated>2012-07-06T20:51:12+00:00</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-06-11T16:24:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=8dc6780587c99286c0d3de747a2946a76989414a'/>
<id>8dc6780587c99286c0d3de747a2946a76989414a</id>
<content type='text'>
File operations on /dev/ecryptfs would BUG() when the operations were
performed by processes other than the process that originally opened the
file. This could happen with open files inherited after fork() or file
descriptors passed through IPC mechanisms. Rather than calling BUG(), an
error code can be safely returned in most situations.

In ecryptfs_miscdev_release(), eCryptfs still needs to handle the
release even if the last file reference is being held by a process that
didn't originally open the file. ecryptfs_find_daemon_by_euid() will not
be successful, so a pointer to the daemon is stored in the file's
private_data. The private_data pointer is initialized when the miscdev
file is opened and only used when the file is released.

https://launchpad.net/bugs/994247

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reported-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Tested-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
File operations on /dev/ecryptfs would BUG() when the operations were
performed by processes other than the process that originally opened the
file. This could happen with open files inherited after fork() or file
descriptors passed through IPC mechanisms. Rather than calling BUG(), an
error code can be safely returned in most situations.

In ecryptfs_miscdev_release(), eCryptfs still needs to handle the
release even if the last file reference is being held by a process that
didn't originally open the file. ecryptfs_find_daemon_by_euid() will not
be successful, so a pointer to the daemon is stored in the file's
private_data. The private_data pointer is initialized when the miscdev
file is opened and only used when the file is released.

https://launchpad.net/bugs/994247

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reported-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Tested-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: Fix lockdep warning in miscdev operations</title>
<updated>2012-07-03T23:34:10+00:00</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-06-11T17:21:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=60d65f1f07a7d81d3eb3b91fc13fca80f2fdbb12'/>
<id>60d65f1f07a7d81d3eb3b91fc13fca80f2fdbb12</id>
<content type='text'>
Don't grab the daemon mutex while holding the message context mutex.
Addresses this lockdep warning:

 ecryptfsd/2141 is trying to acquire lock:
  (&amp;ecryptfs_msg_ctx_arr[i].mux){+.+.+.}, at: [&lt;ffffffffa029c213&gt;] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs]

 but task is already holding lock:
  (&amp;(*daemon)-&gt;mux){+.+...}, at: [&lt;ffffffffa029c2ec&gt;] ecryptfs_miscdev_read+0x21c/0x470 [ecryptfs]

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (&amp;(*daemon)-&gt;mux){+.+...}:
        [&lt;ffffffff810a3b8d&gt;] lock_acquire+0x9d/0x220
        [&lt;ffffffff8151c6da&gt;] __mutex_lock_common+0x5a/0x4b0
        [&lt;ffffffff8151cc64&gt;] mutex_lock_nested+0x44/0x50
        [&lt;ffffffffa029c5d7&gt;] ecryptfs_send_miscdev+0x97/0x120 [ecryptfs]
        [&lt;ffffffffa029b744&gt;] ecryptfs_send_message+0x134/0x1e0 [ecryptfs]
        [&lt;ffffffffa029a24e&gt;] ecryptfs_generate_key_packet_set+0x2fe/0xa80 [ecryptfs]
        [&lt;ffffffffa02960f8&gt;] ecryptfs_write_metadata+0x108/0x250 [ecryptfs]
        [&lt;ffffffffa0290f80&gt;] ecryptfs_create+0x130/0x250 [ecryptfs]
        [&lt;ffffffff811963a4&gt;] vfs_create+0xb4/0x120
        [&lt;ffffffff81197865&gt;] do_last+0x8c5/0xa10
        [&lt;ffffffff811998f9&gt;] path_openat+0xd9/0x460
        [&lt;ffffffff81199da2&gt;] do_filp_open+0x42/0xa0
        [&lt;ffffffff81187998&gt;] do_sys_open+0xf8/0x1d0
        [&lt;ffffffff81187a91&gt;] sys_open+0x21/0x30
        [&lt;ffffffff81527d69&gt;] system_call_fastpath+0x16/0x1b

 -&gt; #0 (&amp;ecryptfs_msg_ctx_arr[i].mux){+.+.+.}:
        [&lt;ffffffff810a3418&gt;] __lock_acquire+0x1bf8/0x1c50
        [&lt;ffffffff810a3b8d&gt;] lock_acquire+0x9d/0x220
        [&lt;ffffffff8151c6da&gt;] __mutex_lock_common+0x5a/0x4b0
        [&lt;ffffffff8151cc64&gt;] mutex_lock_nested+0x44/0x50
        [&lt;ffffffffa029c213&gt;] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs]
        [&lt;ffffffff811887d3&gt;] vfs_read+0xb3/0x180
        [&lt;ffffffff811888ed&gt;] sys_read+0x4d/0x90
        [&lt;ffffffff81527d69&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't grab the daemon mutex while holding the message context mutex.
Addresses this lockdep warning:

 ecryptfsd/2141 is trying to acquire lock:
  (&amp;ecryptfs_msg_ctx_arr[i].mux){+.+.+.}, at: [&lt;ffffffffa029c213&gt;] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs]

 but task is already holding lock:
  (&amp;(*daemon)-&gt;mux){+.+...}, at: [&lt;ffffffffa029c2ec&gt;] ecryptfs_miscdev_read+0x21c/0x470 [ecryptfs]

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (&amp;(*daemon)-&gt;mux){+.+...}:
        [&lt;ffffffff810a3b8d&gt;] lock_acquire+0x9d/0x220
        [&lt;ffffffff8151c6da&gt;] __mutex_lock_common+0x5a/0x4b0
        [&lt;ffffffff8151cc64&gt;] mutex_lock_nested+0x44/0x50
        [&lt;ffffffffa029c5d7&gt;] ecryptfs_send_miscdev+0x97/0x120 [ecryptfs]
        [&lt;ffffffffa029b744&gt;] ecryptfs_send_message+0x134/0x1e0 [ecryptfs]
        [&lt;ffffffffa029a24e&gt;] ecryptfs_generate_key_packet_set+0x2fe/0xa80 [ecryptfs]
        [&lt;ffffffffa02960f8&gt;] ecryptfs_write_metadata+0x108/0x250 [ecryptfs]
        [&lt;ffffffffa0290f80&gt;] ecryptfs_create+0x130/0x250 [ecryptfs]
        [&lt;ffffffff811963a4&gt;] vfs_create+0xb4/0x120
        [&lt;ffffffff81197865&gt;] do_last+0x8c5/0xa10
        [&lt;ffffffff811998f9&gt;] path_openat+0xd9/0x460
        [&lt;ffffffff81199da2&gt;] do_filp_open+0x42/0xa0
        [&lt;ffffffff81187998&gt;] do_sys_open+0xf8/0x1d0
        [&lt;ffffffff81187a91&gt;] sys_open+0x21/0x30
        [&lt;ffffffff81527d69&gt;] system_call_fastpath+0x16/0x1b

 -&gt; #0 (&amp;ecryptfs_msg_ctx_arr[i].mux){+.+.+.}:
        [&lt;ffffffff810a3418&gt;] __lock_acquire+0x1bf8/0x1c50
        [&lt;ffffffff810a3b8d&gt;] lock_acquire+0x9d/0x220
        [&lt;ffffffff8151c6da&gt;] __mutex_lock_common+0x5a/0x4b0
        [&lt;ffffffff8151cc64&gt;] mutex_lock_nested+0x44/0x50
        [&lt;ffffffffa029c213&gt;] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs]
        [&lt;ffffffff811887d3&gt;] vfs_read+0xb3/0x180
        [&lt;ffffffff811888ed&gt;] sys_read+0x4d/0x90
        [&lt;ffffffff81527d69&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
