<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/9p/protocol.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-12-12T20:44:30+00:00</updated>
<entry>
<title>net: 9p: avoid freeing uninit memory in p9pdu_vreadf</title>
<updated>2023-12-12T20:44:30+00:00</updated>
<author>
<name>Fedor Pchelkin</name>
<email>pchelkin@ispras.ru</email>
</author>
<published>2023-12-06T20:09:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff49bf1867578f23a5ffdd38f927f6e1e16796c4'/>
<id>urn:sha1:ff49bf1867578f23a5ffdd38f927f6e1e16796c4</id>
<content type='text'>
If some of p9pdu_readf() calls inside case 'T' in p9pdu_vreadf() fails,
the error path is not handled properly. *wnames or members of *wnames
array may be left uninitialized and invalidly freed.

Initialize *wnames to NULL in beginning of case 'T'. Initialize the first
*wnames array element to NULL and nullify the failing *wnames element so
that the error path freeing loop stops on the first NULL element and
doesn't proceed further.

Found by Linux Verification Center (linuxtesting.org).

Fixes: ace51c4dd2f9 ("9p: add new protocol support code")
Signed-off-by: Fedor Pchelkin &lt;pchelkin@ispras.ru&gt;
Message-ID: &lt;20231206200913.16135-1-pchelkin@ispras.ru&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Reviewed-by: Christian Schoenebeck &lt;linux_oss@crudebyte.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>net/9p: add p9_msg_buf_size()</title>
<updated>2022-10-04T22:05:41+00:00</updated>
<author>
<name>Christian Schoenebeck</name>
<email>linux_oss@crudebyte.com</email>
</author>
<published>2022-07-15T21:32:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1effdbf94a728b74b23a24ce7b6f1d1d9a2480a4'/>
<id>urn:sha1:1effdbf94a728b74b23a24ce7b6f1d1d9a2480a4</id>
<content type='text'>
This new function calculates a buffer size suitable for holding the
intended 9p request or response. For rather small message types (which
applies to almost all 9p message types actually) simply use hard coded
values. For some variable-length and potentially large message types
calculate a more precise value according to what data is actually
transmitted to avoid unnecessarily huge buffers.

So p9_msg_buf_size() divides the individual 9p message types into 3
message size categories:

  - dynamically calculated message size (i.e. potentially large)
  - 8k hard coded message size
  - 4k hard coded message size

As for the latter two hard coded message types: for most 9p message
types it is pretty obvious whether they would always fit into 4k or
8k. But for some of them it depends on the maximum directory entry
name length allowed by OS and filesystem for determining into which
of the two size categories they would fit into. Currently Linux
supports directory entry names up to NAME_MAX (255), however when
comparing the limitation of individual filesystems, ReiserFS
theoretically supports up to slightly below 4k long names. So in
order to make this code more future proof, and as revisiting it
later on is a bit tedious and has the potential to miss out details,
the decision [1] was made to take 4k as basis as for max. name length.

Link: https://lkml.kernel.org/r/bd6be891cf67e867688e8c8796d06408bfafa0d9.1657920926.git.linux_oss@crudebyte.com
Link: https://lore.kernel.org/all/5564296.oo812IJUPE@silver/ [1]
Signed-off-by: Christian Schoenebeck &lt;linux_oss@crudebyte.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>9p: convert to advancing variant of iov_iter_get_pages_alloc()</title>
<updated>2022-08-09T02:37:23+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2022-06-10T15:42:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7f02464739da05a51cadb997a00a301f734e9c87'/>
<id>urn:sha1:7f02464739da05a51cadb997a00a301f734e9c87</id>
<content type='text'>
that one is somewhat clumsier than usual and needs serious testing.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>9p: fix a bunch of checkpatch warnings</title>
<updated>2021-11-04T12:04:25+00:00</updated>
<author>
<name>Dominique Martinet</name>
<email>asmadeus@codewreck.org</email>
</author>
<published>2021-11-02T13:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e195b0f7c8e50927fa31946369c22a0534ec7e2'/>
<id>urn:sha1:6e195b0f7c8e50927fa31946369c22a0534ec7e2</id>
<content type='text'>
Sohaib Mohamed started a serie of tiny and incomplete checkpatch fixes but
seemingly stopped halfway -- take over and do most of it.
This is still missing net/9p/trans* and net/9p/protocol.c for a later
time...

Link: http://lkml.kernel.org/r/20211102134608.1588018-3-dominique.martinet@atmark-techno.com
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>9p: fix file headers</title>
<updated>2021-11-03T08:45:04+00:00</updated>
<author>
<name>Dominique Martinet</name>
<email>asmadeus@codewreck.org</email>
</author>
<published>2021-11-02T13:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=024b7d6a435a450819f112690052f2923fa5ffdd'/>
<id>urn:sha1:024b7d6a435a450819f112690052f2923fa5ffdd</id>
<content type='text'>
- add missing SPDX-License-Identifier
- remove (sometimes incorrect) file name from file header

Link: http://lkml.kernel.org/r/20211102134608.1588018-2-dominique.martinet@atmark-techno.com
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 188</title>
<updated>2019-05-30T18:29:21+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-28T16:57:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1f327613224e3a811d01d66d3c38762b3822057c'/>
<id>urn:sha1:1f327613224e3a811d01d66d3c38762b3822057c</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 free software
  foundation 51 franklin street fifth floor boston ma 02111 1301 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

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

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Richard Fontana &lt;rfontana@redhat.com&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Reviewed-by: Steve Winslow &lt;swinslow@gmail.com&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170026.981318839@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>9p: p9dirent_read: check network-provided name length</title>
<updated>2018-09-07T16:52:29+00:00</updated>
<author>
<name>Dominique Martinet</name>
<email>dominique.martinet@cea.fr</email>
</author>
<published>2018-09-07T15:36:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ef5305f1f72eb1cfcda25c382bb0368509c0385b'/>
<id>urn:sha1:ef5305f1f72eb1cfcda25c382bb0368509c0385b</id>
<content type='text'>
strcpy to dirent-&gt;d_name could overflow the buffer, use strscpy to check
the provided string length and error out if the size was too big.

While we are here, make the function return an error when the pdu
parsing failed, instead of returning the pdu offset as if it had been a
success...

Link: http://lkml.kernel.org/r/1536339057-21974-4-git-send-email-asmadeus@codewreck.org
Addresses-Coverity-ID: 139133 ("Copy into fixed size buffer")
Signed-off-by: Dominique Martinet &lt;dominique.martinet@cea.fr&gt;
</content>
</entry>
<entry>
<title>9p: do not trust pdu content for stat item size</title>
<updated>2018-09-07T16:40:06+00:00</updated>
<author>
<name>Gertjan Halkes</name>
<email>gertjan@google.com</email>
</author>
<published>2018-09-05T06:41:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2803cf4379ed252894f046cb8812a48db35294e3'/>
<id>urn:sha1:2803cf4379ed252894f046cb8812a48db35294e3</id>
<content type='text'>
v9fs_dir_readdir() could deadloop if a struct was sent with a size set
to -2

Link: http://lkml.kernel.org/r/1536134432-11997-1-git-send-email-asmadeus@codewreck.org
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88021
Signed-off-by: Gertjan Halkes &lt;gertjan@google.com&gt;
Signed-off-by: Dominique Martinet &lt;dominique.martinet@cea.fr&gt;
</content>
</entry>
<entry>
<title>9p: clear dangling pointers in p9stat_free</title>
<updated>2018-08-29T04:39:57+00:00</updated>
<author>
<name>Dominique Martinet</name>
<email>dominique.martinet@cea.fr</email>
</author>
<published>2018-08-27T22:32:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=62e3941776fea8678bb8120607039410b1b61a65'/>
<id>urn:sha1:62e3941776fea8678bb8120607039410b1b61a65</id>
<content type='text'>
p9stat_free is more of a cleanup function than a 'free' function as it
only frees the content of the struct; there are chances of use-after-free
if it is improperly used (e.g. p9stat_free called twice as it used to be
possible to)

Clearing dangling pointers makes the function idempotent and safer to use.

Link: http://lkml.kernel.org/r/1535410108-20650-2-git-send-email-asmadeus@codewreck.org
Signed-off-by: Dominique Martinet &lt;dominique.martinet@cea.fr&gt;
Reported-by: syzbot+d4252148d198410b864f@syzkaller.appspotmail.com
</content>
</entry>
<entry>
<title>9p/net/protocol.c: return -ENOMEM when kmalloc() failed</title>
<updated>2018-08-13T00:21:44+00:00</updated>
<author>
<name>piaojun</name>
<email>piaojun@huawei.com</email>
</author>
<published>2018-07-11T00:43:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b87d1d26521ef9f2e42bb182184d1427b4e07b26'/>
<id>urn:sha1:b87d1d26521ef9f2e42bb182184d1427b4e07b26</id>
<content type='text'>
We should return -ENOMEM to upper user when kmalloc failed to indicate
accurate errno.

Link: http://lkml.kernel.org/r/5B4552C5.60000@huawei.com
Signed-off-by: Jun Piao &lt;piaojun@huawei.com&gt;
Reviewed-by: Yiwen Jiang &lt;jiangyiwen@huawei.com&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
Cc: Ron Minnich &lt;rminnich@sandia.gov&gt;
Cc: Latchesar Ionkov &lt;lucho@ionkov.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Dominique Martinet &lt;dominique.martinet@cea.fr&gt;
</content>
</entry>
</feed>
