<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/iucv, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-09-04T11:13:03Z</updated>
<entry>
<title>s390/iucv: fix receive buffer virtual vs physical address confusion</title>
<updated>2024-09-04T11:13:03Z</updated>
<author>
<name>Alexander Gordeev</name>
</author>
<published>2024-02-16T12:13:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da6cc71ff6c8e6b5076e80550b4e79a3d8f111be'/>
<id>urn:sha1:da6cc71ff6c8e6b5076e80550b4e79a3d8f111be</id>
<content type='text'>
[ Upstream commit 4e8477aeb46dfe74e829c06ea588dd00ba20c8cc ]

Fix IUCV_IPBUFLST-type buffers virtual vs physical address confusion.
This does not fix a bug since virtual and physical address spaces are
currently the same.

Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Reviewed-by: Alexandra Winter &lt;wintera@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/iucv: fix use after free in iucv_sock_close()</title>
<updated>2024-08-19T03:32:09Z</updated>
<author>
<name>Alexandra Winter</name>
</author>
<published>2024-07-29T12:28:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84f40b46787ecb67c7ad08a5bb1376141fa10c01'/>
<id>urn:sha1:84f40b46787ecb67c7ad08a5bb1376141fa10c01</id>
<content type='text'>
[ Upstream commit f558120cd709682b739207b48cf7479fd9568431 ]

iucv_sever_path() is called from process context and from bh context.
iucv-&gt;path is used as indicator whether somebody else is taking care of
severing the path (or it is already removed / never existed).
This needs to be done with atomic compare and swap, otherwise there is a
small window where iucv_sock_close() will try to work with a path that has
already been severed and freed by iucv_callback_connrej() called by
iucv_tasklet_fn().

Example:
[452744.123844] Call Trace:
[452744.123845] ([&lt;0000001e87f03880&gt;] 0x1e87f03880)
[452744.123966]  [&lt;00000000d593001e&gt;] iucv_path_sever+0x96/0x138
[452744.124330]  [&lt;000003ff801ddbca&gt;] iucv_sever_path+0xc2/0xd0 [af_iucv]
[452744.124336]  [&lt;000003ff801e01b6&gt;] iucv_sock_close+0xa6/0x310 [af_iucv]
[452744.124341]  [&lt;000003ff801e08cc&gt;] iucv_sock_release+0x3c/0xd0 [af_iucv]
[452744.124345]  [&lt;00000000d574794e&gt;] __sock_release+0x5e/0xe8
[452744.124815]  [&lt;00000000d5747a0c&gt;] sock_close+0x34/0x48
[452744.124820]  [&lt;00000000d5421642&gt;] __fput+0xba/0x268
[452744.124826]  [&lt;00000000d51b382c&gt;] task_work_run+0xbc/0xf0
[452744.124832]  [&lt;00000000d5145710&gt;] do_notify_resume+0x88/0x90
[452744.124841]  [&lt;00000000d5978096&gt;] system_call+0xe2/0x2c8
[452744.125319] Last Breaking-Event-Address:
[452744.125321]  [&lt;00000000d5930018&gt;] iucv_path_sever+0x90/0x138
[452744.125324]
[452744.125325] Kernel panic - not syncing: Fatal exception in interrupt

Note that bh_lock_sock() is not serializing the tasklet context against
process context, because the check for sock_owned_by_user() and
corresponding handling is missing.

Ideas for a future clean-up patch:
A) Correct usage of bh_lock_sock() in tasklet context, as described in
Link: https://lore.kernel.org/netdev/1280155406.2899.407.camel@edumazet-laptop/
Re-enqueue, if needed. This may require adding return values to the
tasklet functions and thus changes to all users of iucv.

B) Change iucv tasklet into worker and use only lock_sock() in af_iucv.

Fixes: 7d316b945352 ("af_iucv: remove IUCV-pathes completely")
Reviewed-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Alexandra Winter &lt;wintera@linux.ibm.com&gt;
Link: https://patch.msgid.link/20240729122818.947756-1-wintera@linux.ibm.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/iucv: Avoid explicit cpumask var allocation on stack</title>
<updated>2024-07-05T07:00:32Z</updated>
<author>
<name>Dawei Li</name>
</author>
<published>2024-03-31T05:34:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b085521be5292016097b5e7ca81b26be3f7098d'/>
<id>urn:sha1:2b085521be5292016097b5e7ca81b26be3f7098d</id>
<content type='text'>
[ Upstream commit be4e1304419c99a164b4c0e101c7c2a756b635b9 ]

For CONFIG_CPUMASK_OFFSTACK=y kernel, explicit allocation of cpumask
variable on stack is not recommended since it can cause potential stack
overflow.

Instead, kernel code should always use *cpumask_var API(s) to allocate
cpumask var in config-neutral way, leaving allocation strategy to
CONFIG_CPUMASK_OFFSTACK.

Use *cpumask_var API(s) to address it.

Signed-off-by: Dawei Li &lt;dawei.li@shingroup.cn&gt;
Reviewed-by: Alexandra Winter &lt;wintera@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20240331053441.1276826-2-dawei.li@shingroup.cn
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/iucv: fix the allocation size of iucv_path_table array</title>
<updated>2024-03-26T22:22:33Z</updated>
<author>
<name>Alexander Gordeev</name>
</author>
<published>2024-02-14T16:32:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13f5b64a584b5554f81e7e493dcbafaddd06557d'/>
<id>urn:sha1:13f5b64a584b5554f81e7e493dcbafaddd06557d</id>
<content type='text'>
[ Upstream commit b4ea9b6a18ebf7f9f3a7a60f82e925186978cfcf ]

iucv_path_table is a dynamically allocated array of pointers to
struct iucv_path items. Yet, its size is calculated as if it was
an array of struct iucv_path items.

Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Reviewed-by: Alexandra Winter &lt;wintera@linux.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/af_iucv: clean up a try_then_request_module()</title>
<updated>2024-02-23T07:12:54Z</updated>
<author>
<name>Julian Wiedmann</name>
</author>
<published>2021-08-09T08:30:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8811188205406ce59c34fabc18e2421b38c03fdd'/>
<id>urn:sha1:8811188205406ce59c34fabc18e2421b38c03fdd</id>
<content type='text'>
[ Upstream commit 4eb9eda6ba64114d98827e2870e024d5ab7cd35b ]

Use IS_ENABLED(CONFIG_IUCV) to determine whether the iucv_if symbol
is available, and let depmod deal with the module dependency.

This was introduced back with commit 6fcd61f7bf5d ("af_iucv: use
loadable iucv interface"). And to avoid sprinkling IS_ENABLED() over
all the code, we're keeping the indirection through pr_iucv-&gt;...().

Signed-off-by: Julian Wiedmann &lt;jwi@linux.ibm.com&gt;
Signed-off-by: Karsten Graul &lt;kgraul@linux.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/iucv: Fix size of interrupt data</title>
<updated>2023-03-22T12:27:10Z</updated>
<author>
<name>Alexandra Winter</name>
</author>
<published>2023-03-15T13:14:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0d2bb5e31a693ebc8888eb407f8a257a3680efa'/>
<id>urn:sha1:b0d2bb5e31a693ebc8888eb407f8a257a3680efa</id>
<content type='text'>
[ Upstream commit 3d87debb8ed2649608ff432699e7c961c0c6f03b ]

iucv_irq_data needs to be 4 bytes larger.
These bytes are not used by the iucv module, but written by
the z/VM hypervisor in case a CPU is deconfigured.

Reported as:
BUG dma-kmalloc-64 (Not tainted): kmalloc Redzone overwritten
-----------------------------------------------------------------------------
0x0000000000400564-0x0000000000400567 @offset=1380. First byte 0x80 instead of 0xcc
Allocated in iucv_cpu_prepare+0x44/0xd0 age=167839 cpu=2 pid=1
__kmem_cache_alloc_node+0x166/0x450
kmalloc_node_trace+0x3a/0x70
iucv_cpu_prepare+0x44/0xd0
cpuhp_invoke_callback+0x156/0x2f0
cpuhp_issue_call+0xf0/0x298
__cpuhp_setup_state_cpuslocked+0x136/0x338
__cpuhp_setup_state+0xf4/0x288
iucv_init+0xf4/0x280
do_one_initcall+0x78/0x390
do_initcalls+0x11a/0x140
kernel_init_freeable+0x25e/0x2a0
kernel_init+0x2e/0x170
__ret_from_fork+0x3c/0x58
ret_from_fork+0xa/0x40
Freed in iucv_init+0x92/0x280 age=167839 cpu=2 pid=1
__kmem_cache_free+0x308/0x358
iucv_init+0x92/0x280
do_one_initcall+0x78/0x390
do_initcalls+0x11a/0x140
kernel_init_freeable+0x25e/0x2a0
kernel_init+0x2e/0x170
__ret_from_fork+0x3c/0x58
ret_from_fork+0xa/0x40
Slab 0x0000037200010000 objects=32 used=30 fp=0x0000000000400640 flags=0x1ffff00000010200(slab|head|node=0|zone=0|
Object 0x0000000000400540 @offset=1344 fp=0x0000000000000000
Redzone  0000000000400500: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Redzone  0000000000400510: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Redzone  0000000000400520: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Redzone  0000000000400530: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Object   0000000000400540: 00 01 00 03 00 00 00 00 00 00 00 00 00 00 00 00  ................
Object   0000000000400550: f3 86 81 f2 f4 82 f8 82 f0 f0 f0 f0 f0 f0 f0 f2  ................
Object   0000000000400560: 00 00 00 00 80 00 00 00 cc cc cc cc cc cc cc cc  ................
Object   0000000000400570: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Redzone  0000000000400580: cc cc cc cc cc cc cc cc                          ........
Padding  00000000004005d4: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a  ZZZZZZZZZZZZZZZZ
Padding  00000000004005e4: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a  ZZZZZZZZZZZZZZZZ
Padding  00000000004005f4: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a              ZZZZZZZZZZZZ
CPU: 6 PID: 121030 Comm: 116-pai-crypto. Not tainted 6.3.0-20230221.rc0.git4.99b8246b2d71.300.fc37.s390x+debug #1
Hardware name: IBM 3931 A01 704 (z/VM 7.3.0)
Call Trace:
[&lt;000000032aa034ec&gt;] dump_stack_lvl+0xac/0x100
[&lt;0000000329f5a6cc&gt;] check_bytes_and_report+0x104/0x140
[&lt;0000000329f5aa78&gt;] check_object+0x370/0x3c0
[&lt;0000000329f5ede6&gt;] free_debug_processing+0x15e/0x348
[&lt;0000000329f5f06a&gt;] free_to_partial_list+0x9a/0x2f0
[&lt;0000000329f5f4a4&gt;] __slab_free+0x1e4/0x3a8
[&lt;0000000329f61768&gt;] __kmem_cache_free+0x308/0x358
[&lt;000000032a91465c&gt;] iucv_cpu_dead+0x6c/0x88
[&lt;0000000329c2fc66&gt;] cpuhp_invoke_callback+0x156/0x2f0
[&lt;000000032aa062da&gt;] _cpu_down.constprop.0+0x22a/0x5e0
[&lt;0000000329c3243e&gt;] cpu_device_down+0x4e/0x78
[&lt;000000032a61dee0&gt;] device_offline+0xc8/0x118
[&lt;000000032a61e048&gt;] online_store+0x60/0xe0
[&lt;000000032a08b6b0&gt;] kernfs_fop_write_iter+0x150/0x1e8
[&lt;0000000329fab65c&gt;] vfs_write+0x174/0x360
[&lt;0000000329fab9fc&gt;] ksys_write+0x74/0x100
[&lt;000000032aa03a5a&gt;] __do_syscall+0x1da/0x208
[&lt;000000032aa177b2&gt;] system_call+0x82/0xb0
INFO: lockdep is turned off.
FIX dma-kmalloc-64: Restoring kmalloc Redzone 0x0000000000400564-0x0000000000400567=0xcc
FIX dma-kmalloc-64: Object at 0x0000000000400540 not freed

Fixes: 2356f4cb1911 ("[S390]: Rewrite of the IUCV base code, part 2")
Signed-off-by: Alexandra Winter &lt;wintera@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20230315131435.4113889-1-wintera@linux.ibm.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/af_iucv: set correct sk_protocol for child sockets</title>
<updated>2020-12-08T09:18:52Z</updated>
<author>
<name>Julian Wiedmann</name>
</author>
<published>2020-11-20T10:06:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb9f4ece5b10e69412260807a2aeaf4f20e61a57'/>
<id>urn:sha1:cb9f4ece5b10e69412260807a2aeaf4f20e61a57</id>
<content type='text'>
[ Upstream commit c5dab0941fcdc9664eb0ec0d4d51433216d91336 ]

Child sockets erroneously inherit their parent's sk_type (ie. SOCK_*),
instead of the PF_IUCV protocol that the parent was created with in
iucv_sock_create().

We're currently not using sk-&gt;sk_protocol ourselves, so this shouldn't
have much impact (except eg. getting the output in skb_dump() right).

Fixes: eac3731bd04c ("[S390]: Add AF_IUCV socket support")
Signed-off-by: Julian Wiedmann &lt;jwi@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20201120100657.34407-1-jwi@linux.ibm.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net/af_iucv: fix null pointer dereference on shutdown</title>
<updated>2020-11-18T18:18:51Z</updated>
<author>
<name>Ursula Braun</name>
</author>
<published>2020-11-09T07:57:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2ff0e7c8eca2536ecd534c758aa704d342f38007'/>
<id>urn:sha1:2ff0e7c8eca2536ecd534c758aa704d342f38007</id>
<content type='text'>
[ Upstream commit 4031eeafa71eaf22ae40a15606a134ae86345daf ]

syzbot reported the following KASAN finding:

BUG: KASAN: nullptr-dereference in iucv_send_ctrl+0x390/0x3f0 net/iucv/af_iucv.c:385
Read of size 2 at addr 000000000000021e by task syz-executor907/519

CPU: 0 PID: 519 Comm: syz-executor907 Not tainted 5.9.0-syzkaller-07043-gbcf9877ad213 #0
Hardware name: IBM 3906 M04 701 (KVM/Linux)
Call Trace:
 [&lt;00000000c576af60&gt;] unwind_start arch/s390/include/asm/unwind.h:65 [inline]
 [&lt;00000000c576af60&gt;] show_stack+0x180/0x228 arch/s390/kernel/dumpstack.c:135
 [&lt;00000000c9dcd1f8&gt;] __dump_stack lib/dump_stack.c:77 [inline]
 [&lt;00000000c9dcd1f8&gt;] dump_stack+0x268/0x2f0 lib/dump_stack.c:118
 [&lt;00000000c5fed016&gt;] print_address_description.constprop.0+0x5e/0x218 mm/kasan/report.c:383
 [&lt;00000000c5fec82a&gt;] __kasan_report mm/kasan/report.c:517 [inline]
 [&lt;00000000c5fec82a&gt;] kasan_report+0x11a/0x168 mm/kasan/report.c:534
 [&lt;00000000c98b5b60&gt;] iucv_send_ctrl+0x390/0x3f0 net/iucv/af_iucv.c:385
 [&lt;00000000c98b6262&gt;] iucv_sock_shutdown+0x44a/0x4c0 net/iucv/af_iucv.c:1457
 [&lt;00000000c89d3a54&gt;] __sys_shutdown+0x12c/0x1c8 net/socket.c:2204
 [&lt;00000000c89d3b70&gt;] __do_sys_shutdown net/socket.c:2212 [inline]
 [&lt;00000000c89d3b70&gt;] __s390x_sys_shutdown+0x38/0x48 net/socket.c:2210
 [&lt;00000000c9e36eac&gt;] system_call+0xe0/0x28c arch/s390/kernel/entry.S:415

There is nothing to shutdown if a connection has never been established.
Besides that iucv-&gt;hs_dev is not yet initialized if a socket is in
IUCV_OPEN state and iucv-&gt;path is not yet initialized if socket is in
IUCV_BOUND state.
So, just skip the shutdown calls for a socket in these states.

Fixes: eac3731bd04c ("[S390]: Add AF_IUCV socket support")
Fixes: 82492a355fac ("af_iucv: add shutdown for HS transport")
Reviewed-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Ursula Braun &lt;ubraun@linux.ibm.com&gt;
[jwi: correct one Fixes tag]
Signed-off-by: Julian Wiedmann &lt;jwi@linux.ibm.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net/af_iucv: always register net_device notifier</title>
<updated>2020-01-27T13:50:56Z</updated>
<author>
<name>Julian Wiedmann</name>
</author>
<published>2019-06-18T18:43:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b977cc31dab1fefbd50f933b7a2815ece3b9c426'/>
<id>urn:sha1:b977cc31dab1fefbd50f933b7a2815ece3b9c426</id>
<content type='text'>
[ Upstream commit 06996c1d4088a0d5f3e7789d7f96b4653cc947cc ]

Even when running as VM guest (ie pr_iucv != NULL), af_iucv can still
open HiperTransport-based connections. For robust operation these
connections require the af_iucv_netdev_notifier, so register it
unconditionally.

Also handle any error that register_netdevice_notifier() returns.

Fixes: 9fbd87d41392 ("af_iucv: handle netdev events")
Signed-off-by: Julian Wiedmann &lt;jwi@linux.ibm.com&gt;
Reviewed-by: Ursula Braun &lt;ubraun@linux.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/af_iucv: build proper skbs for HiperTransport</title>
<updated>2020-01-27T13:50:56Z</updated>
<author>
<name>Julian Wiedmann</name>
</author>
<published>2019-06-18T18:43:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cbefb0fdefcdca66fca88208f4467eb119b56f4'/>
<id>urn:sha1:9cbefb0fdefcdca66fca88208f4467eb119b56f4</id>
<content type='text'>
[ Upstream commit 238965b71b968dc5b3c0fe430e946f488322c4b5 ]

The HiperSockets-based transport path in af_iucv is still too closely
entangled with qeth.
With commit a647a02512ca ("s390/qeth: speed-up L3 IQD xmit"), the
relevant xmit code in qeth has begun to use skb_cow_head(). So to avoid
unnecessary skb head expansions, af_iucv must learn to
1) respect dev-&gt;needed_headroom when allocating skbs, and
2) drop the header reference before cloning the skb.

While at it, also stop hard-coding the LL-header creation stage and just
use the appropriate helper.

Fixes: a647a02512ca ("s390/qeth: speed-up L3 IQD xmit")
Signed-off-by: Julian Wiedmann &lt;jwi@linux.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
