<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/orangefs, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-11-13T20:34:31+00:00</updated>
<entry>
<title>orangefs: fix xattr related buffer overflow...</title>
<updated>2025-11-13T20:34:31+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=9127d1e90c90e5960c8bc72a4ce2c209691a7021'/>
<id>urn:sha1:9127d1e90c90e5960c8bc72a4ce2c209691a7021</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-20T16:30:41+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=62b4f6c6abe495e507103cfd00293730a7d54e6a'/>
<id>urn:sha1:62b4f6c6abe495e507103cfd00293730a7d54e6a</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:13:56+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=39c4454ed6698d21e3e04b95625ea9179293a93c'/>
<id>urn:sha1:39c4454ed6698d21e3e04b95625ea9179293a93c</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-05-29T09:02:28+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=cd918ec24168fe08c6aafc077dd3b6d88364c5cf'/>
<id>urn:sha1:cd918ec24168fe08c6aafc077dd3b6d88364c5cf</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-21T13:01:27+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=897f496b946fdcfab5983c983e4b513ab6682364'/>
<id>urn:sha1:897f496b946fdcfab5983c983e4b513ab6682364</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>move asm/unaligned.h to linux/unaligned.h</title>
<updated>2024-10-02T21:23:23+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-10-01T19:35:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f60d5f6bbc12e782fac78110b0ee62698f3b576'/>
<id>urn:sha1:5f60d5f6bbc12e782fac78110b0ee62698f3b576</id>
<content type='text'>
asm/unaligned.h is always an include of asm-generic/unaligned.h;
might as well move that thing to linux/unaligned.h and include
that - there's nothing arch-specific in that header.

auto-generated by the following:

for i in `git grep -l -w asm/unaligned.h`; do
	sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i
done
for i in `git grep -l -w asm-generic/unaligned.h`; do
	sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i
done
git mv include/asm-generic/unaligned.h include/linux/unaligned.h
git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h
sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild
sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
</content>
</entry>
<entry>
<title>Merge tag 'for-linux-6.12-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux</title>
<updated>2024-09-21T02:34:00+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-09-21T02:34:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1868f9d0260e9afaf7c6436d14923ae12eaea465'/>
<id>urn:sha1:1868f9d0260e9afaf7c6436d14923ae12eaea465</id>
<content type='text'>
Pull orangefs update from Mike Marshall:
 "Constify struct kobj_type"

* tag 'for-linux-6.12-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
  orangefs: Constify struct kobj_type
</content>
</entry>
<entry>
<title>orangefs: Constify struct kobj_type</title>
<updated>2024-09-06T14:18:17+00:00</updated>
<author>
<name>Huang Xiaojia</name>
<email>huangxiaojia2@huawei.com</email>
</author>
<published>2024-08-26T15:04:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96319dacaf15f666bcba7275953d780e23fe9e75'/>
<id>urn:sha1:96319dacaf15f666bcba7275953d780e23fe9e75</id>
<content type='text'>
'struct kobj_type' is not modified. It is only used in kobject_init()
which takes a 'const struct kobj_type *ktype' parameter.

Constifying this structure moves some data to a read-only section,
so increase over all security.

On a x86_64, compiled with defconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
   7036	   2136	     56	   9228	   240c	fs/orangefs/orangefs-sysfs.o

After:
======
   text	   data	    bss	    dec	    hex	filename
   7484	   1880	     56	   9420	   24cc	fs/orangefs/orangefs-sysfs.o

Signed-off-by: Huang Xiaojia &lt;huangxiaojia2@huawei.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
</content>
</entry>
<entry>
<title>fs: Convert aops-&gt;write_begin to take a folio</title>
<updated>2024-08-07T09:33:21+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2024-07-15T18:24:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1da86618bdce301d23e89ecce92161f9d3b3c5e7'/>
<id>urn:sha1:1da86618bdce301d23e89ecce92161f9d3b3c5e7</id>
<content type='text'>
Convert all callers from working on a page to working on one page
of a folio (support for working on an entire folio can come later).
Removes a lot of folio-&gt;page-&gt;folio conversions.

Reviewed-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: Convert aops-&gt;write_end to take a folio</title>
<updated>2024-08-07T09:32:02+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2024-07-10T19:45:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a225800f322a3d6cc8b8b6c7dc4d5281f2f5375b'/>
<id>urn:sha1:a225800f322a3d6cc8b8b6c7dc4d5281f2f5375b</id>
<content type='text'>
Most callers have a folio, and most implementations operate on a folio,
so remove the conversion from folio-&gt;page-&gt;folio to fit through this
interface.

Reviewed-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
</feed>
