<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/orangefs, 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>2025-12-06T21:12:27+00:00</updated>
<entry>
<title>orangefs: fix xattr related buffer overflow...</title>
<updated>2025-12-06T21:12:27+00:00</updated>
<author>
<name>Mike Marshall</name>
<email>hubcap@omnibond.com</email>
</author>
<published>2025-09-15T21:40:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bc812574de633cf9a9ad6974490e45f6a4bb5126'/>
<id>urn:sha1:bc812574de633cf9a9ad6974490e45f6a4bb5126</id>
<content type='text'>
[ Upstream commit 025e880759c279ec64d0f754fe65bf45961da864 ]

Willy Tarreau &lt;w@1wt.eu&gt; forwarded me a message from
Disclosure &lt;disclosure@aisle.com&gt; with the following
warning:

&gt; The helper `xattr_key()` uses the pointer variable in the loop condition
&gt; rather than dereferencing it. As `key` is incremented, it remains non-NULL
&gt; (until it runs into unmapped memory), so the loop does not terminate on
&gt; valid C strings and will walk memory indefinitely, consuming CPU or hanging
&gt; the thread.

I easily reproduced this with setfattr and getfattr, causing a kernel
oops, hung user processes and corrupted orangefs files. Disclosure
sent along a diff (not a patch) with a suggested fix, which I based
this patch on.

After xattr_key started working right, xfstest generic/069 exposed an
xattr related memory leak that lead to OOM. xattr_key returns
a hashed key.  When adding xattrs to the orangefs xattr cache, orangefs
used hash_add, a kernel hashing macro. hash_add also hashes the key using
hash_log which resulted in additions to the xattr cache going to the wrong
hash bucket. generic/069 tortures a single file and orangefs does a
getattr for the xattr "security.capability" every time. Orangefs
negative caches on xattrs which includes a kmalloc. Since adds to the
xattr cache were going to the wrong bucket, every getattr for
"security.capability" resulted in another kmalloc, none of which were
ever freed.

I changed the two uses of hash_add to hlist_add_head instead
and the memory leak ceased and generic/069 quit throwing furniture.

Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Reported-by: Stanislav Fort of Aisle Research &lt;stanislav.fort@aisle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs/orangefs: use snprintf() instead of sprintf()</title>
<updated>2025-08-28T14:25:59+00:00</updated>
<author>
<name>Amir Mohammad Jahangirzad</name>
<email>a.jahangirzad@gmail.com</email>
</author>
<published>2025-06-08T16:35:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3799bec649b698aead6b2106160fd23ca3168a4e'/>
<id>urn:sha1:3799bec649b698aead6b2106160fd23ca3168a4e</id>
<content type='text'>
[ Upstream commit cdfa1304657d6f23be8fd2bb0516380a3c89034e ]

sprintf() is discouraged for use with bounded destination buffers
as it does not prevent buffer overflows when the formatted output
exceeds the destination buffer size. snprintf() is a safer
alternative as it limits the number of bytes written and ensures
NUL-termination.

Replace sprintf() with snprintf() for copying the debug string
into a temporary buffer, using ORANGEFS_MAX_DEBUG_STRING_LEN as
the maximum size to ensure safe formatting and prevent memory
corruption in edge cases.

EDIT: After this patch sat on linux-next for a few days, Dan
Carpenter saw it and suggested that I use scnprintf instead of
snprintf. I made the change and retested.

Signed-off-by: Amir Mohammad Jahangirzad &lt;a.jahangirzad@gmail.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs/orangefs: Allow 2 more characters in do_c_string()</title>
<updated>2025-08-15T10:05:04+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@linaro.org</email>
</author>
<published>2025-07-19T14:19:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0dd6f32d47a994514b2cf09c288c5e47095dc08d'/>
<id>urn:sha1:0dd6f32d47a994514b2cf09c288c5e47095dc08d</id>
<content type='text'>
[ Upstream commit 2138e89cb066b40386b1d9ddd61253347d356474 ]

The do_k_string() and do_c_string() functions do essentially the same
thing which is they add a string and a comma onto the end of an existing
string.  At the end, the caller will overwrite the last comma with a
newline.  Later, in orangefs_kernel_debug_init(), we add a newline to
the string.

The change to do_k_string() is just cosmetic.  I moved the "- 1" to
the other side of the comparison and made it "+ 1".  This has no
effect on runtime, I just wanted the functions to match each other
and the rest of the file.

However in do_c_string(), I removed the "- 2" which allows us to print
two extra characters.  I noticed this issue while reviewing the code
and I doubt affects anything in real life.  My guess is that this was
double counting the comma and the newline.  The "+ 1" accounts for
the newline, and the caller will delete the final comma which ensures
there is enough space for the newline.

Removing the "- 2" lets us print 2 more characters, but mainly it makes
the code more consistent and understandable for reviewers.

Fixes: 44f4641073f1 ("orangefs: clean up debugfs globals")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>orangefs: Do not truncate file size</title>
<updated>2025-06-04T12:40:08+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2025-03-05T20:47:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=15602508ad2f923e228b9521960b4addcd27d9c4'/>
<id>urn:sha1:15602508ad2f923e228b9521960b4addcd27d9c4</id>
<content type='text'>
[ Upstream commit 062e8093592fb866b8e016641a8b27feb6ac509d ]

'len' is used to store the result of i_size_read(), so making 'len'
a size_t results in truncation to 4GiB on 32-bit systems.

Signed-off-by: "Matthew Wilcox (Oracle)" &lt;willy@infradead.org&gt;
Link: https://lore.kernel.org/r/20250305204734.1475264-2-willy@infradead.org
Tested-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>orangefs: fix a oob in orangefs_debug_write</title>
<updated>2025-02-21T12:50:00+00:00</updated>
<author>
<name>Mike Marshall</name>
<email>hubcap@omnibond.com</email>
</author>
<published>2025-01-08T19:21:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1da2697307dad281dd690a19441b5ca4af92d786'/>
<id>urn:sha1:1da2697307dad281dd690a19441b5ca4af92d786</id>
<content type='text'>
[ Upstream commit f7c848431632598ff9bce57a659db6af60d75b39 ]

I got a syzbot report: slab-out-of-bounds Read in
orangefs_debug_write... several people suggested fixes,
I tested Al Viro's suggestion and made this patch.

Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Reported-by: syzbot+fc519d7875f2d9186c1f@syzkaller.appspotmail.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>orangefs: fix out-of-bounds fsid access</title>
<updated>2024-07-11T10:47:08+00:00</updated>
<author>
<name>Mike Marshall</name>
<email>hubcap@omnibond.com</email>
</author>
<published>2024-05-01T20:20:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=74159d409da82269311a60256aad8ae8753da450'/>
<id>urn:sha1:74159d409da82269311a60256aad8ae8753da450</id>
<content type='text'>
[ Upstream commit 53e4efa470d5fc6a96662d2d3322cfc925818517 ]

Arnd Bergmann sent a patch to fsdevel, he says:

"orangefs_statfs() copies two consecutive fields of the superblock into
the statfs structure, which triggers a warning from the string fortification
helpers"

Jan Kara suggested an alternate way to do the patch to make it more readable.

I ran both ideas through xfstests and both seem fine. This patch
is based on Jan Kara's suggestion.

Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Julia Lawall reported this null pointer dereference, this should fix it.</title>
<updated>2024-04-13T11:05:08+00:00</updated>
<author>
<name>Mike Marshall</name>
<email>hubcap@omnibond.com</email>
</author>
<published>2024-02-14T20:57:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2e2177f94c0e0bc41323d7b6975a5f4820ed347e'/>
<id>urn:sha1:2e2177f94c0e0bc41323d7b6975a5f4820ed347e</id>
<content type='text'>
[ Upstream commit 9bf93dcfc453fae192fe5d7874b89699e8f800ac ]

Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>use less confusing names for iov_iter direction initializers</title>
<updated>2023-02-09T10:28:04+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2022-09-16T00:25:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5a1909510387ddf6c2bf58836dc844f66e8a9efb'/>
<id>urn:sha1:5a1909510387ddf6c2bf58836dc844f66e8a9efb</id>
<content type='text'>
[ Upstream commit de4eda9de2d957ef2d6a8365a01e26a435e958cb ]

READ/WRITE proved to be actively confusing - the meanings are
"data destination, as used with read(2)" and "data source, as
used with write(2)", but people keep interpreting those as
"we read data from it" and "we write data to it", i.e. exactly
the wrong way.

Call them ITER_DEST and ITER_SOURCE - at least that is harder
to misinterpret...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Stable-dep-of: 6dd88fd59da8 ("vhost-scsi: unbreak any layout for response")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>orangefs: Fix kmemleak in orangefs_{kernel,client}_debug_init()</title>
<updated>2022-12-31T12:33:06+00:00</updated>
<author>
<name>Zhang Xiaoxu</name>
<email>zhangxiaoxu5@huawei.com</email>
</author>
<published>2022-10-18T04:40:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0cd303aad220fafa595e0ed593e99aa51b90412b'/>
<id>urn:sha1:0cd303aad220fafa595e0ed593e99aa51b90412b</id>
<content type='text'>
[ Upstream commit 31720a2b109b3080eb77e97b8f6f50a27b4ae599 ]

When insert and remove the orangefs module, there are memory leaked
as below:

unreferenced object 0xffff88816b0cc000 (size 2048):
  comm "insmod", pid 783, jiffies 4294813439 (age 65.512s)
  hex dump (first 32 bytes):
    6e 6f 6e 65 0a 00 00 00 00 00 00 00 00 00 00 00  none............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;0000000031ab7788&gt;] kmalloc_trace+0x27/0xa0
    [&lt;000000005b405fee&gt;] orangefs_debugfs_init.cold+0xaf/0x17f
    [&lt;00000000e5a0085b&gt;] 0xffffffffa02780f9
    [&lt;000000004232d9f7&gt;] do_one_initcall+0x87/0x2a0
    [&lt;0000000054f22384&gt;] do_init_module+0xdf/0x320
    [&lt;000000003263bdea&gt;] load_module+0x2f98/0x3330
    [&lt;0000000052cd4153&gt;] __do_sys_finit_module+0x113/0x1b0
    [&lt;00000000250ae02b&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000f11c03c7&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

Use the golbal variable as the buffer rather than dynamic allocate to
slove the problem.

Signed-off-by: Zhang Xiaoxu &lt;zhangxiaoxu5@huawei.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>orangefs: Fix kmemleak in orangefs_sysfs_init()</title>
<updated>2022-12-31T12:33:06+00:00</updated>
<author>
<name>Zhang Xiaoxu</name>
<email>zhangxiaoxu5@huawei.com</email>
</author>
<published>2022-10-18T04:40:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=22409490294180c39be7dd0e5b2667d41556307d'/>
<id>urn:sha1:22409490294180c39be7dd0e5b2667d41556307d</id>
<content type='text'>
[ Upstream commit 1f2c0e8a587bcafad85019a2d80f158d8d41a868 ]

When insert and remove the orangefs module, there are kobjects memory
leaked as below:

unreferenced object 0xffff88810f95af00 (size 64):
  comm "insmod", pid 783, jiffies 4294813439 (age 65.512s)
  hex dump (first 32 bytes):
    a0 83 af 01 81 88 ff ff 08 af 95 0f 81 88 ff ff  ................
    08 af 95 0f 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;0000000031ab7788&gt;] kmalloc_trace+0x27/0xa0
    [&lt;000000005a6e4dfe&gt;] orangefs_sysfs_init+0x42/0x3a0
    [&lt;00000000722645ca&gt;] 0xffffffffa02780fe
    [&lt;000000004232d9f7&gt;] do_one_initcall+0x87/0x2a0
    [&lt;0000000054f22384&gt;] do_init_module+0xdf/0x320
    [&lt;000000003263bdea&gt;] load_module+0x2f98/0x3330
    [&lt;0000000052cd4153&gt;] __do_sys_finit_module+0x113/0x1b0
    [&lt;00000000250ae02b&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000f11c03c7&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

unreferenced object 0xffff88810f95ae80 (size 64):
  comm "insmod", pid 783, jiffies 4294813439 (age 65.512s)
  hex dump (first 32 bytes):
    c8 90 0f 02 81 88 ff ff 88 ae 95 0f 81 88 ff ff  ................
    88 ae 95 0f 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;0000000031ab7788&gt;] kmalloc_trace+0x27/0xa0
    [&lt;000000001a4841fa&gt;] orangefs_sysfs_init+0xc7/0x3a0
    [&lt;00000000722645ca&gt;] 0xffffffffa02780fe
    [&lt;000000004232d9f7&gt;] do_one_initcall+0x87/0x2a0
    [&lt;0000000054f22384&gt;] do_init_module+0xdf/0x320
    [&lt;000000003263bdea&gt;] load_module+0x2f98/0x3330
    [&lt;0000000052cd4153&gt;] __do_sys_finit_module+0x113/0x1b0
    [&lt;00000000250ae02b&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000f11c03c7&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

unreferenced object 0xffff88810f95ae00 (size 64):
  comm "insmod", pid 783, jiffies 4294813440 (age 65.511s)
  hex dump (first 32 bytes):
    60 87 a1 00 81 88 ff ff 08 ae 95 0f 81 88 ff ff  `...............
    08 ae 95 0f 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;0000000031ab7788&gt;] kmalloc_trace+0x27/0xa0
    [&lt;000000005915e797&gt;] orangefs_sysfs_init+0x12b/0x3a0
    [&lt;00000000722645ca&gt;] 0xffffffffa02780fe
    [&lt;000000004232d9f7&gt;] do_one_initcall+0x87/0x2a0
    [&lt;0000000054f22384&gt;] do_init_module+0xdf/0x320
    [&lt;000000003263bdea&gt;] load_module+0x2f98/0x3330
    [&lt;0000000052cd4153&gt;] __do_sys_finit_module+0x113/0x1b0
    [&lt;00000000250ae02b&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000f11c03c7&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

unreferenced object 0xffff88810f95ad80 (size 64):
  comm "insmod", pid 783, jiffies 4294813440 (age 65.511s)
  hex dump (first 32 bytes):
    78 90 0f 02 81 88 ff ff 88 ad 95 0f 81 88 ff ff  x...............
    88 ad 95 0f 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;0000000031ab7788&gt;] kmalloc_trace+0x27/0xa0
    [&lt;000000007a14eb35&gt;] orangefs_sysfs_init+0x1ac/0x3a0
    [&lt;00000000722645ca&gt;] 0xffffffffa02780fe
    [&lt;000000004232d9f7&gt;] do_one_initcall+0x87/0x2a0
    [&lt;0000000054f22384&gt;] do_init_module+0xdf/0x320
    [&lt;000000003263bdea&gt;] load_module+0x2f98/0x3330
    [&lt;0000000052cd4153&gt;] __do_sys_finit_module+0x113/0x1b0
    [&lt;00000000250ae02b&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000f11c03c7&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

unreferenced object 0xffff88810f95ac00 (size 64):
  comm "insmod", pid 783, jiffies 4294813440 (age 65.531s)
  hex dump (first 32 bytes):
    e0 ff 67 02 81 88 ff ff 08 ac 95 0f 81 88 ff ff  ..g.............
    08 ac 95 0f 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;0000000031ab7788&gt;] kmalloc_trace+0x27/0xa0
    [&lt;000000001f38adcb&gt;] orangefs_sysfs_init+0x291/0x3a0
    [&lt;00000000722645ca&gt;] 0xffffffffa02780fe
    [&lt;000000004232d9f7&gt;] do_one_initcall+0x87/0x2a0
    [&lt;0000000054f22384&gt;] do_init_module+0xdf/0x320
    [&lt;000000003263bdea&gt;] load_module+0x2f98/0x3330
    [&lt;0000000052cd4153&gt;] __do_sys_finit_module+0x113/0x1b0
    [&lt;00000000250ae02b&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000f11c03c7&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

unreferenced object 0xffff88810f95ab80 (size 64):
  comm "insmod", pid 783, jiffies 4294813441 (age 65.530s)
  hex dump (first 32 bytes):
    50 bf 2f 02 81 88 ff ff 88 ab 95 0f 81 88 ff ff  P./.............
    88 ab 95 0f 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;0000000031ab7788&gt;] kmalloc_trace+0x27/0xa0
    [&lt;000000009cc7d95b&gt;] orangefs_sysfs_init+0x2f5/0x3a0
    [&lt;00000000722645ca&gt;] 0xffffffffa02780fe
    [&lt;000000004232d9f7&gt;] do_one_initcall+0x87/0x2a0
    [&lt;0000000054f22384&gt;] do_init_module+0xdf/0x320
    [&lt;000000003263bdea&gt;] load_module+0x2f98/0x3330
    [&lt;0000000052cd4153&gt;] __do_sys_finit_module+0x113/0x1b0
    [&lt;00000000250ae02b&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000f11c03c7&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

Should add release function for each kobject_type to free the memory.

Signed-off-by: Zhang Xiaoxu &lt;zhangxiaoxu5@huawei.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
