<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/udf/ialloc.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-12-15T12:08:34+00:00</updated>
<entry>
<title>udf: Fix error handling in udf_new_inode()</title>
<updated>2021-12-15T12:08:34+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2021-12-14T10:04:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f05f2429eec60851b98bdde213de31dab697c01b'/>
<id>urn:sha1:f05f2429eec60851b98bdde213de31dab697c01b</id>
<content type='text'>
When memory allocation of iinfo or block allocation fails, already
allocated struct udf_inode_info gets freed with iput() and
udf_evict_inode() may look at inode fields which are not properly
initialized. Fix it by marking inode bad before dropping reference to it
in udf_new_inode().

Reported-by: syzbot+9ca499bb57a2b9e4c652@syzkaller.appspotmail.com
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>inode: make init and permission helpers idmapped mount aware</title>
<updated>2021-01-24T13:27:16+00:00</updated>
<author>
<name>Christian Brauner</name>
<email>christian.brauner@ubuntu.com</email>
</author>
<published>2021-01-21T13:19:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=21cb47be6fb9ece7e6ee63f6780986faa384a77c'/>
<id>urn:sha1:21cb47be6fb9ece7e6ee63f6780986faa384a77c</id>
<content type='text'>
The inode_owner_or_capable() helper determines whether the caller is the
owner of the inode or is capable with respect to that inode. Allow it to
handle idmapped mounts. If the inode is accessed through an idmapped
mount it according to the mount's user namespace. Afterwards the checks
are identical to non-idmapped mounts. If the initial user namespace is
passed nothing changes so non-idmapped mounts will see identical
behavior as before.

Similarly, allow the inode_init_owner() helper to handle idmapped
mounts. It initializes a new inode on idmapped mounts by mapping the
fsuid and fsgid of the caller from the mount's user namespace. If the
initial user namespace is passed nothing changes so non-idmapped mounts
will see identical behavior as before.

Link: https://lore.kernel.org/r/20210121131959.646623-7-christian.brauner@ubuntu.com
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: James Morris &lt;jamorris@linux.microsoft.com&gt;
Signed-off-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
</content>
</entry>
<entry>
<title>udf: Remove pointless union in udf_inode_info</title>
<updated>2020-09-29T15:21:54+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2020-09-25T10:29:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=382a2287bf9cd283206764572f66ab12657218aa'/>
<id>urn:sha1:382a2287bf9cd283206764572f66ab12657218aa</id>
<content type='text'>
We use only a single member out of the i_ext union in udf_inode_info.
Just remove the pointless union.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>udf: augment UDF permissions on new inodes</title>
<updated>2019-08-27T13:38:46+00:00</updated>
<author>
<name>Steven J. Magnani</name>
<email>steve.magnani@digidescorp.com</email>
</author>
<published>2019-08-27T12:13:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3367a1b47d590f97109cd4b5189e750fb26c0f1'/>
<id>urn:sha1:c3367a1b47d590f97109cd4b5189e750fb26c0f1</id>
<content type='text'>
Windows presents files created within Linux as read-only, even when
permissions in Linux indicate the file should be writable.

UDF defines a slightly different set of basic file permissions than Linux.
Specifically, UDF has "delete" and "change attribute" permissions for each
access class (user/group/other). Linux has no equivalents for these.

When the Linux UDF driver creates a file (or directory), no UDF delete or
change attribute permissions are granted. The lack of delete permission
appears to cause Windows to mark an item read-only when its permissions
otherwise indicate that it should be read-write.

Fix this by having UDF delete permissions track Linux write permissions.
Also grant UDF change attribute permission to the owner when creating a
new inode.

Reported by: Ty Young
Signed-off-by: Steven J. Magnani &lt;steve@digidescorp.com&gt;
Link: https://lore.kernel.org/r/20190827121359.9954-1-steve@digidescorp.com
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>udf: convert inode stamps to timespec64</title>
<updated>2018-06-27T11:58:00+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-06-20T08:15:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3b9cecd89b806e14544af596396e18abd00f145'/>
<id>urn:sha1:c3b9cecd89b806e14544af596396e18abd00f145</id>
<content type='text'>
The VFS structures are finally converted to always use 64-bit timestamps,
and this file system can represent a long range of on-disk timestamps
already, so now let's fit in the missing bits for udf.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>vfs: change inode times to use struct timespec64</title>
<updated>2018-06-05T23:57:31+00:00</updated>
<author>
<name>Deepa Dinamani</name>
<email>deepa.kernel@gmail.com</email>
</author>
<published>2018-05-09T02:36:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=95582b00838837fc07e042979320caf917ce3fe6'/>
<id>urn:sha1:95582b00838837fc07e042979320caf917ce3fe6</id>
<content type='text'>
struct timespec is not y2038 safe. Transition vfs to use
y2038 safe struct timespec64 instead.

The change was made with the help of the following cocinelle
script. This catches about 80% of the changes.
All the header file and logic changes are included in the
first 5 rules. The rest are trivial substitutions.
I avoid changing any of the function signatures or any other
filesystem specific data structures to keep the patch simple
for review.

The script can be a little shorter by combining different cases.
But, this version was sufficient for my usecase.

virtual patch

@ depends on patch @
identifier now;
@@
- struct timespec
+ struct timespec64
  current_time ( ... )
  {
- struct timespec now = current_kernel_time();
+ struct timespec64 now = current_kernel_time64();
  ...
- return timespec_trunc(
+ return timespec64_trunc(
  ... );
  }

@ depends on patch @
identifier xtime;
@@
 struct \( iattr \| inode \| kstat \) {
 ...
-       struct timespec xtime;
+       struct timespec64 xtime;
 ...
 }

@ depends on patch @
identifier t;
@@
 struct inode_operations {
 ...
int (*update_time) (...,
-       struct timespec t,
+       struct timespec64 t,
...);
 ...
 }

@ depends on patch @
identifier t;
identifier fn_update_time =~ "update_time$";
@@
 fn_update_time (...,
- struct timespec *t,
+ struct timespec64 *t,
 ...) { ... }

@ depends on patch @
identifier t;
@@
lease_get_mtime( ... ,
- struct timespec *t
+ struct timespec64 *t
  ) { ... }

@te depends on patch forall@
identifier ts;
local idexpression struct inode *inode_node;
identifier i_xtime =~ "^i_[acm]time$";
identifier ia_xtime =~ "^ia_[acm]time$";
identifier fn_update_time =~ "update_time$";
identifier fn;
expression e, E3;
local idexpression struct inode *node1;
local idexpression struct inode *node2;
local idexpression struct iattr *attr1;
local idexpression struct iattr *attr2;
local idexpression struct iattr attr;
identifier i_xtime1 =~ "^i_[acm]time$";
identifier i_xtime2 =~ "^i_[acm]time$";
identifier ia_xtime1 =~ "^ia_[acm]time$";
identifier ia_xtime2 =~ "^ia_[acm]time$";
@@
(
(
- struct timespec ts;
+ struct timespec64 ts;
|
- struct timespec ts = current_time(inode_node);
+ struct timespec64 ts = current_time(inode_node);
)

&lt;+... when != ts
(
- timespec_equal(&amp;inode_node-&gt;i_xtime, &amp;ts)
+ timespec64_equal(&amp;inode_node-&gt;i_xtime, &amp;ts)
|
- timespec_equal(&amp;ts, &amp;inode_node-&gt;i_xtime)
+ timespec64_equal(&amp;ts, &amp;inode_node-&gt;i_xtime)
|
- timespec_compare(&amp;inode_node-&gt;i_xtime, &amp;ts)
+ timespec64_compare(&amp;inode_node-&gt;i_xtime, &amp;ts)
|
- timespec_compare(&amp;ts, &amp;inode_node-&gt;i_xtime)
+ timespec64_compare(&amp;ts, &amp;inode_node-&gt;i_xtime)
|
ts = current_time(e)
|
fn_update_time(..., &amp;ts,...)
|
inode_node-&gt;i_xtime = ts
|
node1-&gt;i_xtime = ts
|
ts = inode_node-&gt;i_xtime
|
&lt;+... attr1-&gt;ia_xtime ...+&gt; = ts
|
ts = attr1-&gt;ia_xtime
|
ts.tv_sec
|
ts.tv_nsec
|
btrfs_set_stack_timespec_sec(..., ts.tv_sec)
|
btrfs_set_stack_timespec_nsec(..., ts.tv_nsec)
|
- ts = timespec64_to_timespec(
+ ts =
...
-)
|
- ts = ktime_to_timespec(
+ ts = ktime_to_timespec64(
...)
|
- ts = E3
+ ts = timespec_to_timespec64(E3)
|
- ktime_get_real_ts(&amp;ts)
+ ktime_get_real_ts64(&amp;ts)
|
fn(...,
- ts
+ timespec64_to_timespec(ts)
,...)
)
...+&gt;
(
&lt;... when != ts
- return ts;
+ return timespec64_to_timespec(ts);
...&gt;
)
|
- timespec_equal(&amp;node1-&gt;i_xtime1, &amp;node2-&gt;i_xtime2)
+ timespec64_equal(&amp;node1-&gt;i_xtime2, &amp;node2-&gt;i_xtime2)
|
- timespec_equal(&amp;node1-&gt;i_xtime1, &amp;attr2-&gt;ia_xtime2)
+ timespec64_equal(&amp;node1-&gt;i_xtime2, &amp;attr2-&gt;ia_xtime2)
|
- timespec_compare(&amp;node1-&gt;i_xtime1, &amp;node2-&gt;i_xtime2)
+ timespec64_compare(&amp;node1-&gt;i_xtime1, &amp;node2-&gt;i_xtime2)
|
node1-&gt;i_xtime1 =
- timespec_trunc(attr1-&gt;ia_xtime1,
+ timespec64_trunc(attr1-&gt;ia_xtime1,
...)
|
- attr1-&gt;ia_xtime1 = timespec_trunc(attr2-&gt;ia_xtime2,
+ attr1-&gt;ia_xtime1 =  timespec64_trunc(attr2-&gt;ia_xtime2,
...)
|
- ktime_get_real_ts(&amp;attr1-&gt;ia_xtime1)
+ ktime_get_real_ts64(&amp;attr1-&gt;ia_xtime1)
|
- ktime_get_real_ts(&amp;attr.ia_xtime1)
+ ktime_get_real_ts64(&amp;attr.ia_xtime1)
)

@ depends on patch @
struct inode *node;
struct iattr *attr;
identifier fn;
identifier i_xtime =~ "^i_[acm]time$";
identifier ia_xtime =~ "^ia_[acm]time$";
expression e;
@@
(
- fn(node-&gt;i_xtime);
+ fn(timespec64_to_timespec(node-&gt;i_xtime));
|
 fn(...,
- node-&gt;i_xtime);
+ timespec64_to_timespec(node-&gt;i_xtime));
|
- e = fn(attr-&gt;ia_xtime);
+ e = fn(timespec64_to_timespec(attr-&gt;ia_xtime));
)

@ depends on patch forall @
struct inode *node;
struct iattr *attr;
identifier i_xtime =~ "^i_[acm]time$";
identifier ia_xtime =~ "^ia_[acm]time$";
identifier fn;
@@
{
+ struct timespec ts;
&lt;+...
(
+ ts = timespec64_to_timespec(node-&gt;i_xtime);
fn (...,
- &amp;node-&gt;i_xtime,
+ &amp;ts,
...);
|
+ ts = timespec64_to_timespec(attr-&gt;ia_xtime);
fn (...,
- &amp;attr-&gt;ia_xtime,
+ &amp;ts,
...);
)
...+&gt;
}

@ depends on patch forall @
struct inode *node;
struct iattr *attr;
struct kstat *stat;
identifier ia_xtime =~ "^ia_[acm]time$";
identifier i_xtime =~ "^i_[acm]time$";
identifier xtime =~ "^[acm]time$";
identifier fn, ret;
@@
{
+ struct timespec ts;
&lt;+...
(
+ ts = timespec64_to_timespec(node-&gt;i_xtime);
ret = fn (...,
- &amp;node-&gt;i_xtime,
+ &amp;ts,
...);
|
+ ts = timespec64_to_timespec(node-&gt;i_xtime);
ret = fn (...,
- &amp;node-&gt;i_xtime);
+ &amp;ts);
|
+ ts = timespec64_to_timespec(attr-&gt;ia_xtime);
ret = fn (...,
- &amp;attr-&gt;ia_xtime,
+ &amp;ts,
...);
|
+ ts = timespec64_to_timespec(attr-&gt;ia_xtime);
ret = fn (...,
- &amp;attr-&gt;ia_xtime);
+ &amp;ts);
|
+ ts = timespec64_to_timespec(stat-&gt;xtime);
ret = fn (...,
- &amp;stat-&gt;xtime);
+ &amp;ts);
)
...+&gt;
}

@ depends on patch @
struct inode *node;
struct inode *node2;
identifier i_xtime1 =~ "^i_[acm]time$";
identifier i_xtime2 =~ "^i_[acm]time$";
identifier i_xtime3 =~ "^i_[acm]time$";
struct iattr *attrp;
struct iattr *attrp2;
struct iattr attr ;
identifier ia_xtime1 =~ "^ia_[acm]time$";
identifier ia_xtime2 =~ "^ia_[acm]time$";
struct kstat *stat;
struct kstat stat1;
struct timespec64 ts;
identifier xtime =~ "^[acmb]time$";
expression e;
@@
(
( node-&gt;i_xtime2 \| attrp-&gt;ia_xtime2 \| attr.ia_xtime2 \) = node-&gt;i_xtime1  ;
|
 node-&gt;i_xtime2 = \( node2-&gt;i_xtime1 \| timespec64_trunc(...) \);
|
 node-&gt;i_xtime2 = node-&gt;i_xtime1 = node-&gt;i_xtime3 = \(ts \| current_time(...) \);
|
 node-&gt;i_xtime1 = node-&gt;i_xtime3 = \(ts \| current_time(...) \);
|
 stat-&gt;xtime = node2-&gt;i_xtime1;
|
 stat1.xtime = node2-&gt;i_xtime1;
|
( node-&gt;i_xtime2 \| attrp-&gt;ia_xtime2 \) = attrp-&gt;ia_xtime1  ;
|
( attrp-&gt;ia_xtime1 \| attr.ia_xtime1 \) = attrp2-&gt;ia_xtime2;
|
- e = node-&gt;i_xtime1;
+ e = timespec64_to_timespec( node-&gt;i_xtime1 );
|
- e = attrp-&gt;ia_xtime1;
+ e = timespec64_to_timespec( attrp-&gt;ia_xtime1 );
|
node-&gt;i_xtime1 = current_time(...);
|
 node-&gt;i_xtime2 = node-&gt;i_xtime1 = node-&gt;i_xtime3 =
- e;
+ timespec_to_timespec64(e);
|
 node-&gt;i_xtime1 = node-&gt;i_xtime3 =
- e;
+ timespec_to_timespec64(e);
|
- node-&gt;i_xtime1 = e;
+ node-&gt;i_xtime1 = timespec_to_timespec64(e);
)

Signed-off-by: Deepa Dinamani &lt;deepa.kernel@gmail.com&gt;
Cc: &lt;anton@tuxera.com&gt;
Cc: &lt;balbi@kernel.org&gt;
Cc: &lt;bfields@fieldses.org&gt;
Cc: &lt;darrick.wong@oracle.com&gt;
Cc: &lt;dhowells@redhat.com&gt;
Cc: &lt;dsterba@suse.com&gt;
Cc: &lt;dwmw2@infradead.org&gt;
Cc: &lt;hch@lst.de&gt;
Cc: &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: &lt;hubcap@omnibond.com&gt;
Cc: &lt;jack@suse.com&gt;
Cc: &lt;jaegeuk@kernel.org&gt;
Cc: &lt;jaharkes@cs.cmu.edu&gt;
Cc: &lt;jslaby@suse.com&gt;
Cc: &lt;keescook@chromium.org&gt;
Cc: &lt;mark@fasheh.com&gt;
Cc: &lt;miklos@szeredi.hu&gt;
Cc: &lt;nico@linaro.org&gt;
Cc: &lt;reiserfs-devel@vger.kernel.org&gt;
Cc: &lt;richard@nod.at&gt;
Cc: &lt;sage@redhat.com&gt;
Cc: &lt;sfrench@samba.org&gt;
Cc: &lt;swhiteho@redhat.com&gt;
Cc: &lt;tj@kernel.org&gt;
Cc: &lt;trond.myklebust@primarydata.com&gt;
Cc: &lt;tytso@mit.edu&gt;
Cc: &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>udf: Apply uid/gid mount options also to new inodes &amp; chown</title>
<updated>2018-02-27T09:25:33+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2018-02-21T16:59:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ecd10aa42819cd5dcf639d25575e95a5bda8d08a'/>
<id>urn:sha1:ecd10aa42819cd5dcf639d25575e95a5bda8d08a</id>
<content type='text'>
Currently newly created files belong to current user despite
uid=&lt;number&gt; / gid=&lt;number&gt; mount options. This is confusing to users
(as owner of the file will change after remount / eviction from cache)
and also inconsistent with e.g. FAT with the same mount option. So apply
uid=&lt;number&gt; and gid=&lt;number&gt; also to newly created inodes and similarly
as FAT disallow to change owner of the file in this case.

Reported-by: Steve Kenton &lt;skenton@ou.edu&gt;
Reviewed-by: Pali Rohár &lt;pali.rohar@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>udf: Fix 64-bit sign extension issues affecting blocks &gt; 0x7FFFFFFF</title>
<updated>2017-10-17T09:56:45+00:00</updated>
<author>
<name>Steve Magnani</name>
<email>steve.magnani@digidescorp.com</email>
</author>
<published>2017-10-12T13:48:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b490bdd630cc43a5725e76c7c23f8a7e55551145'/>
<id>urn:sha1:b490bdd630cc43a5725e76c7c23f8a7e55551145</id>
<content type='text'>
Large (&gt; 1 TiB) UDF filesystems appear subject to several problems when
mounted on 64-bit systems:

* readdir() can fail on a directory containing File Identifiers residing
  above 0x7FFFFFFF. This manifests as a 'ls' command failing with EIO.

* FIBMAP on a file block located above 0x7FFFFFFF can return a negative
  value. The low 32 bits are correct, but applications that don't mask the
  high 32 bits of the result can perform incorrectly.

Per suggestion by Jan Kara, introduce a udf_pblk_t type for representation
of UDF block addresses. Ultimately, all driver functions that manipulate
UDF block addresses should use this type; for now, deployment is limited
to functions with actual or potential sign extension issues.

Changes to udf_readdir() and udf_block_map() address the issues noted
above; other changes address potential similar issues uncovered during
audit of the driver code.

Signed-off-by: Steven J. Magnani &lt;steve@digidescorp.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fs: Replace current_fs_time() with current_time()</title>
<updated>2016-09-28T01:06:22+00:00</updated>
<author>
<name>Deepa Dinamani</name>
<email>deepa.kernel@gmail.com</email>
</author>
<published>2016-09-14T14:48:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c2050a454c7f123d7a57fa1d76ff61bd43643abb'/>
<id>urn:sha1:c2050a454c7f123d7a57fa1d76ff61bd43643abb</id>
<content type='text'>
current_fs_time() uses struct super_block* as an argument.
As per Linus's suggestion, this is changed to take struct
inode* as a parameter instead. This is because the function
is primarily meant for vfs inode timestamps.
Also the function was renamed as per Arnd's suggestion.

Change all calls to current_fs_time() to use the new
current_time() function instead. current_fs_time() will be
deleted.

Signed-off-by: Deepa Dinamani &lt;deepa.kernel@gmail.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>udf: saner calling conventions for udf_new_inode()</title>
<updated>2014-09-04T19:37:41+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-09-04T13:47:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0b93a92be4cb48f22b78c95dea84089a1e72f860'/>
<id>urn:sha1:0b93a92be4cb48f22b78c95dea84089a1e72f860</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
</feed>
