<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net, branch v6.5.6</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>Revert "SUNRPC dont update timeout value on connection reset"</title>
<updated>2023-10-06T11:16:23+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2023-09-17T23:26:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=975df6b0c34caf65830317740eebfeddbfae7eb9'/>
<id>975df6b0c34caf65830317740eebfeddbfae7eb9</id>
<content type='text'>
commit a275ab62606bcd894ddff09460f7d253828313dc upstream.

This reverts commit 88428cc4ae7abcc879295fbb19373dd76aad2bdd.

The problem this commit is intended to fix was comprehensively fixed
in commit 7de62bc09fe6 ("SUNRPC dont update timeout value on connection
reset").
Since then, this commit has been preventing the correct timeout of soft
mounted requests.

Cc: stable@vger.kernel.org # 5.9.x: 09252177d5f9: SUNRPC: Handle major timeout in xprt_adjust_timeout()
Cc: stable@vger.kernel.org # 5.9.x: 7de62bc09fe6: SUNRPC dont update timeout value on connection reset
Cc: stable@vger.kernel.org # 5.9.x
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a275ab62606bcd894ddff09460f7d253828313dc upstream.

This reverts commit 88428cc4ae7abcc879295fbb19373dd76aad2bdd.

The problem this commit is intended to fix was comprehensively fixed
in commit 7de62bc09fe6 ("SUNRPC dont update timeout value on connection
reset").
Since then, this commit has been preventing the correct timeout of soft
mounted requests.

Cc: stable@vger.kernel.org # 5.9.x: 09252177d5f9: SUNRPC: Handle major timeout in xprt_adjust_timeout()
Cc: stable@vger.kernel.org # 5.9.x: 7de62bc09fe6: SUNRPC dont update timeout value on connection reset
Cc: stable@vger.kernel.org # 5.9.x
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mptcp: process pending subflow error on close</title>
<updated>2023-10-06T11:16:20+00:00</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2023-09-16T10:52:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=02447cd84afcfd3d92a097b7a2d2b35604988530'/>
<id>02447cd84afcfd3d92a097b7a2d2b35604988530</id>
<content type='text'>
commit 9f1a98813b4b686482e5ef3c9d998581cace0ba6 upstream.

On incoming TCP reset, subflow closing could happen before error
propagation. That in turn could cause the socket error being ignored,
and a missing socket state transition, as reported by Daire-Byrne.

Address the issues explicitly checking for subflow socket error at
close time. To avoid code duplication, factor-out of __mptcp_error_report()
a new helper implementing the relevant bits.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/429
Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Reviewed-by: Mat Martineau &lt;martineau@kernel.org&gt;
Signed-off-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 9f1a98813b4b686482e5ef3c9d998581cace0ba6 upstream.

On incoming TCP reset, subflow closing could happen before error
propagation. That in turn could cause the socket error being ignored,
and a missing socket state transition, as reported by Daire-Byrne.

Address the issues explicitly checking for subflow socket error at
close time. To avoid code duplication, factor-out of __mptcp_error_report()
a new helper implementing the relevant bits.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/429
Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Reviewed-by: Mat Martineau &lt;martineau@kernel.org&gt;
Signed-off-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mptcp: move __mptcp_error_report in protocol.c</title>
<updated>2023-10-06T11:16:20+00:00</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2023-09-16T10:52:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6be989cb472ed8c3a78e8b7ac89ed17aecfb35ec'/>
<id>6be989cb472ed8c3a78e8b7ac89ed17aecfb35ec</id>
<content type='text'>
commit d5fbeff1ab812b6c473b6924bee8748469462e2c upstream.

This will simplify the next patch ("mptcp: process pending subflow error
on close").

No functional change intended.

Cc: stable@vger.kernel.org # v5.12+
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Reviewed-by: Mat Martineau &lt;martineau@kernel.org&gt;
Signed-off-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d5fbeff1ab812b6c473b6924bee8748469462e2c upstream.

This will simplify the next patch ("mptcp: process pending subflow error
on close").

No functional change intended.

Cc: stable@vger.kernel.org # v5.12+
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Reviewed-by: Mat Martineau &lt;martineau@kernel.org&gt;
Signed-off-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mptcp: fix bogus receive window shrinkage with multiple subflows</title>
<updated>2023-10-06T11:16:20+00:00</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2023-09-16T10:52:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2bef7c8c3950fba26398eed05ba76e6630492b4a'/>
<id>2bef7c8c3950fba26398eed05ba76e6630492b4a</id>
<content type='text'>
commit 6bec041147a2a64a490d1f813e8a004443061b38 upstream.

In case multiple subflows race to update the mptcp-level receive
window, the subflow losing the race should use the window value
provided by the "winning" subflow to update it's own tcp-level
rcv_wnd.

To such goal, the current code bogusly uses the mptcp-level rcv_wnd
value as observed before the update attempt. On unlucky circumstances
that may lead to TCP-level window shrinkage, and stall the other end.

Address the issue feeding to the rcv wnd update the correct value.

Fixes: f3589be0c420 ("mptcp: never shrink offered window")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/427
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Reviewed-by: Mat Martineau &lt;martineau@kernel.org&gt;
Signed-off-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6bec041147a2a64a490d1f813e8a004443061b38 upstream.

In case multiple subflows race to update the mptcp-level receive
window, the subflow losing the race should use the window value
provided by the "winning" subflow to update it's own tcp-level
rcv_wnd.

To such goal, the current code bogusly uses the mptcp-level rcv_wnd
value as observed before the update attempt. On unlucky circumstances
that may lead to TCP-level window shrinkage, and stall the other end.

Address the issue feeding to the rcv wnd update the correct value.

Fixes: f3589be0c420 ("mptcp: never shrink offered window")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/427
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Reviewed-by: Mat Martineau &lt;martineau@kernel.org&gt;
Signed-off-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: hsr: Add __packed to struct hsr_sup_tlv.</title>
<updated>2023-10-06T11:16:17+00:00</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>bigeasy@linutronix.de</email>
</author>
<published>2023-09-15T18:10:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=10ee8a00cb0e3b5c58bb8708129ddff237d4dad5'/>
<id>10ee8a00cb0e3b5c58bb8708129ddff237d4dad5</id>
<content type='text'>
[ Upstream commit fbd825fcd7dd4c11d4c48c3d0adc248a4a0ce90b ]

Struct hsr_sup_tlv describes HW layout and therefore it needs a __packed
attribute to ensure the compiler does not add any padding.
Due to the size and __packed attribute of the structs that use
hsr_sup_tlv it has no functional impact.

Add __packed to struct hsr_sup_tlv.

Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit fbd825fcd7dd4c11d4c48c3d0adc248a4a0ce90b ]

Struct hsr_sup_tlv describes HW layout and therefore it needs a __packed
attribute to ensure the compiler does not add any padding.
Due to the size and __packed attribute of the structs that use
hsr_sup_tlv it has no functional impact.

Add __packed to struct hsr_sup_tlv.

Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ncsi: Propagate carrier gain/loss events to the NCSI controller</title>
<updated>2023-10-06T11:16:17+00:00</updated>
<author>
<name>Johnathan Mantey</name>
<email>johnathanx.mantey@intel.com</email>
</author>
<published>2023-09-15T16:12:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c656c63e6264c071917f68bc23007521b916bf1e'/>
<id>c656c63e6264c071917f68bc23007521b916bf1e</id>
<content type='text'>
[ Upstream commit 3780bb29311eccb7a1c9641032a112eed237f7e3 ]

Report the carrier/no-carrier state for the network interface
shared between the BMC and the passthrough channel. Without this
functionality the BMC is unable to reconfigure the NIC in the event
of a re-cabling to a different subnet.

Signed-off-by: Johnathan Mantey &lt;johnathanx.mantey@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 3780bb29311eccb7a1c9641032a112eed237f7e3 ]

Report the carrier/no-carrier state for the network interface
shared between the BMC and the passthrough channel. Without this
functionality the BMC is unable to reconfigure the NIC in the event
of a re-cabling to a different subnet.

Signed-off-by: Johnathan Mantey &lt;johnathanx.mantey@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net/smc: bugfix for smcr v2 server connect success statistic</title>
<updated>2023-10-06T11:16:10+00:00</updated>
<author>
<name>Guangguan Wang</name>
<email>guangguan.wang@linux.alibaba.com</email>
</author>
<published>2023-09-08T03:31:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=812e69bfc445793d5b668077da933eaa5decba43'/>
<id>812e69bfc445793d5b668077da933eaa5decba43</id>
<content type='text'>
[ Upstream commit 6912e724832c47bb381eb1bd1e483ec8df0d0f0f ]

In the macro SMC_STAT_SERV_SUCC_INC, the smcd_version is used
to determin whether to increase the v1 statistic or the v2
statistic. It is correct for SMCD. But for SMCR, smcr_version
should be used.

Signed-off-by: Guangguan Wang &lt;guangguan.wang@linux.alibaba.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 6912e724832c47bb381eb1bd1e483ec8df0d0f0f ]

In the macro SMC_STAT_SERV_SUCC_INC, the smcd_version is used
to determin whether to increase the v1 statistic or the v2
statistic. It is correct for SMCD. But for SMCR, smcr_version
should be used.

Signed-off-by: Guangguan Wang &lt;guangguan.wang@linux.alibaba.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net/handshake: Fix memory leak in __sock_create() and sock_alloc_file()</title>
<updated>2023-10-06T11:15:57+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-09-19T10:44:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1751e44980466e3ebc246d22d3ebd422197704b6'/>
<id>1751e44980466e3ebc246d22d3ebd422197704b6</id>
<content type='text'>
[ Upstream commit 4a0f07d71b0483cc08c03cefa7c85749e187c214 ]

When making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y,
modprobe handshake-test and then rmmmod handshake-test, the below memory
leak is detected.

The struct socket_alloc which is allocated by alloc_inode_sb() in
__sock_create() is not freed. And the struct dentry which is allocated
by __d_alloc() in sock_alloc_file() is not freed.

Since fput() will call file-&gt;f_op-&gt;release() which is sock_close() here and
it will call __sock_release(). and fput() will call dput(dentry) to free
the struct dentry. So replace sock_release() with fput() to fix the
below memory leak. After applying this patch, the following memory leak is
never detected.

unreferenced object 0xffff888109165840 (size 768):
  comm "kunit_try_catch", pid 1852, jiffies 4294685807 (age 976.262s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa0209ba2&gt;] 0xffffffffa0209ba2
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810f472008 (size 192):
  comm "kunit_try_catch", pid 1852, jiffies 4294685808 (age 976.261s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 08 20 47 0f 81 88 ff ff  ......... G.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0209bbb&gt;] 0xffffffffa0209bbb
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810958e580 (size 224):
  comm "kunit_try_catch", pid 1852, jiffies 4294685808 (age 976.261s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0209bbb&gt;] 0xffffffffa0209bbb
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926dc88 (size 192):
  comm "kunit_try_catch", pid 1854, jiffies 4294685809 (age 976.271s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 88 dc 26 09 81 88 ff ff  ..........&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208fdc&gt;] 0xffffffffa0208fdc
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810a241380 (size 224):
  comm "kunit_try_catch", pid 1854, jiffies 4294685809 (age 976.271s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208fdc&gt;] 0xffffffffa0208fdc
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109165040 (size 768):
  comm "kunit_try_catch", pid 1856, jiffies 4294685811 (age 976.269s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa0208860&gt;] 0xffffffffa0208860
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926d568 (size 192):
  comm "kunit_try_catch", pid 1856, jiffies 4294685811 (age 976.269s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 68 d5 26 09 81 88 ff ff  ........h.&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208879&gt;] 0xffffffffa0208879
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810a240580 (size 224):
  comm "kunit_try_catch", pid 1856, jiffies 4294685811 (age 976.347s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208879&gt;] 0xffffffffa0208879
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109164c40 (size 768):
  comm "kunit_try_catch", pid 1858, jiffies 4294685816 (age 976.342s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa0208541&gt;] 0xffffffffa0208541
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926cd18 (size 192):
  comm "kunit_try_catch", pid 1858, jiffies 4294685816 (age 976.342s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 18 cd 26 09 81 88 ff ff  ..........&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa020855a&gt;] 0xffffffffa020855a
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810a240200 (size 224):
  comm "kunit_try_catch", pid 1858, jiffies 4294685816 (age 976.342s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa020855a&gt;] 0xffffffffa020855a
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109164840 (size 768):
  comm "kunit_try_catch", pid 1860, jiffies 4294685817 (age 976.416s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa02093e2&gt;] 0xffffffffa02093e2
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926cab8 (size 192):
  comm "kunit_try_catch", pid 1860, jiffies 4294685817 (age 976.416s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 b8 ca 26 09 81 88 ff ff  ..........&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa02093fb&gt;] 0xffffffffa02093fb
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810a240040 (size 224):
  comm "kunit_try_catch", pid 1860, jiffies 4294685817 (age 976.416s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa02093fb&gt;] 0xffffffffa02093fb
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109166440 (size 768):
  comm "kunit_try_catch", pid 1862, jiffies 4294685819 (age 976.489s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa02097c1&gt;] 0xffffffffa02097c1
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926c398 (size 192):
  comm "kunit_try_catch", pid 1862, jiffies 4294685819 (age 976.489s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 98 c3 26 09 81 88 ff ff  ..........&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa02097da&gt;] 0xffffffffa02097da
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888107e0b8c0 (size 224):
  comm "kunit_try_catch", pid 1862, jiffies 4294685819 (age 976.489s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa02097da&gt;] 0xffffffffa02097da
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109164440 (size 768):
  comm "kunit_try_catch", pid 1864, jiffies 4294685821 (age 976.487s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa020824e&gt;] 0xffffffffa020824e
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810f4cf698 (size 192):
  comm "kunit_try_catch", pid 1864, jiffies 4294685821 (age 976.501s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 98 f6 4c 0f 81 88 ff ff  ..........L.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208267&gt;] 0xffffffffa0208267
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888107e0b000 (size 224):
  comm "kunit_try_catch", pid 1864, jiffies 4294685821 (age 976.501s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208267&gt;] 0xffffffffa0208267
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20

Fixes: 88232ec1ec5e ("net/handshake: Add Kunit tests for the handshake consumer API")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 4a0f07d71b0483cc08c03cefa7c85749e187c214 ]

When making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y,
modprobe handshake-test and then rmmmod handshake-test, the below memory
leak is detected.

The struct socket_alloc which is allocated by alloc_inode_sb() in
__sock_create() is not freed. And the struct dentry which is allocated
by __d_alloc() in sock_alloc_file() is not freed.

Since fput() will call file-&gt;f_op-&gt;release() which is sock_close() here and
it will call __sock_release(). and fput() will call dput(dentry) to free
the struct dentry. So replace sock_release() with fput() to fix the
below memory leak. After applying this patch, the following memory leak is
never detected.

unreferenced object 0xffff888109165840 (size 768):
  comm "kunit_try_catch", pid 1852, jiffies 4294685807 (age 976.262s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa0209ba2&gt;] 0xffffffffa0209ba2
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810f472008 (size 192):
  comm "kunit_try_catch", pid 1852, jiffies 4294685808 (age 976.261s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 08 20 47 0f 81 88 ff ff  ......... G.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0209bbb&gt;] 0xffffffffa0209bbb
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810958e580 (size 224):
  comm "kunit_try_catch", pid 1852, jiffies 4294685808 (age 976.261s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0209bbb&gt;] 0xffffffffa0209bbb
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926dc88 (size 192):
  comm "kunit_try_catch", pid 1854, jiffies 4294685809 (age 976.271s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 88 dc 26 09 81 88 ff ff  ..........&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208fdc&gt;] 0xffffffffa0208fdc
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810a241380 (size 224):
  comm "kunit_try_catch", pid 1854, jiffies 4294685809 (age 976.271s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208fdc&gt;] 0xffffffffa0208fdc
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109165040 (size 768):
  comm "kunit_try_catch", pid 1856, jiffies 4294685811 (age 976.269s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa0208860&gt;] 0xffffffffa0208860
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926d568 (size 192):
  comm "kunit_try_catch", pid 1856, jiffies 4294685811 (age 976.269s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 68 d5 26 09 81 88 ff ff  ........h.&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208879&gt;] 0xffffffffa0208879
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810a240580 (size 224):
  comm "kunit_try_catch", pid 1856, jiffies 4294685811 (age 976.347s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208879&gt;] 0xffffffffa0208879
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109164c40 (size 768):
  comm "kunit_try_catch", pid 1858, jiffies 4294685816 (age 976.342s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa0208541&gt;] 0xffffffffa0208541
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926cd18 (size 192):
  comm "kunit_try_catch", pid 1858, jiffies 4294685816 (age 976.342s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 18 cd 26 09 81 88 ff ff  ..........&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa020855a&gt;] 0xffffffffa020855a
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810a240200 (size 224):
  comm "kunit_try_catch", pid 1858, jiffies 4294685816 (age 976.342s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa020855a&gt;] 0xffffffffa020855a
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109164840 (size 768):
  comm "kunit_try_catch", pid 1860, jiffies 4294685817 (age 976.416s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa02093e2&gt;] 0xffffffffa02093e2
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926cab8 (size 192):
  comm "kunit_try_catch", pid 1860, jiffies 4294685817 (age 976.416s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 b8 ca 26 09 81 88 ff ff  ..........&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa02093fb&gt;] 0xffffffffa02093fb
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810a240040 (size 224):
  comm "kunit_try_catch", pid 1860, jiffies 4294685817 (age 976.416s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa02093fb&gt;] 0xffffffffa02093fb
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109166440 (size 768):
  comm "kunit_try_catch", pid 1862, jiffies 4294685819 (age 976.489s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa02097c1&gt;] 0xffffffffa02097c1
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810926c398 (size 192):
  comm "kunit_try_catch", pid 1862, jiffies 4294685819 (age 976.489s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 98 c3 26 09 81 88 ff ff  ..........&amp;.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa02097da&gt;] 0xffffffffa02097da
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888107e0b8c0 (size 224):
  comm "kunit_try_catch", pid 1862, jiffies 4294685819 (age 976.489s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa02097da&gt;] 0xffffffffa02097da
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888109164440 (size 768):
  comm "kunit_try_catch", pid 1864, jiffies 4294685821 (age 976.487s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 5a 5a 20 00 00 00 00 00 00 00  ......ZZ .......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8397993f&gt;] sock_alloc_inode+0x1f/0x1b0
    [&lt;ffffffff81a2cb5b&gt;] alloc_inode+0x5b/0x1a0
    [&lt;ffffffff81a32bed&gt;] new_inode_pseudo+0xd/0x70
    [&lt;ffffffff8397889c&gt;] sock_alloc+0x3c/0x260
    [&lt;ffffffff83979b46&gt;] __sock_create+0x66/0x3d0
    [&lt;ffffffffa020824e&gt;] 0xffffffffa020824e
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff88810f4cf698 (size 192):
  comm "kunit_try_catch", pid 1864, jiffies 4294685821 (age 976.501s)
  hex dump (first 32 bytes):
    00 00 50 40 02 00 00 00 00 00 00 00 00 00 00 00  ..P@............
    00 00 00 00 00 00 00 00 98 f6 4c 0f 81 88 ff ff  ..........L.....
  backtrace:
    [&lt;ffffffff81a1ff11&gt;] __d_alloc+0x31/0x8a0
    [&lt;ffffffff81a2910e&gt;] d_alloc_pseudo+0xe/0x50
    [&lt;ffffffff819d549e&gt;] alloc_file_pseudo+0xce/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208267&gt;] 0xffffffffa0208267
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20
unreferenced object 0xffff888107e0b000 (size 224):
  comm "kunit_try_catch", pid 1864, jiffies 4294685821 (age 976.501s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 03 00 2e 08 01 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff819d4b90&gt;] alloc_empty_file+0x50/0x160
    [&lt;ffffffff819d4cf9&gt;] alloc_file+0x59/0x730
    [&lt;ffffffff819d5524&gt;] alloc_file_pseudo+0x154/0x210
    [&lt;ffffffff83978582&gt;] sock_alloc_file+0x42/0x1b0
    [&lt;ffffffffa0208267&gt;] 0xffffffffa0208267
    [&lt;ffffffff829cf03a&gt;] kunit_generic_run_threadfn_adapter+0x4a/0x90
    [&lt;ffffffff81236fc6&gt;] kthread+0x2b6/0x380
    [&lt;ffffffff81096afd&gt;] ret_from_fork+0x2d/0x70
    [&lt;ffffffff81003511&gt;] ret_from_fork_asm+0x11/0x20

Fixes: 88232ec1ec5e ("net/handshake: Add Kunit tests for the handshake consumer API")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP</title>
<updated>2023-10-06T11:15:57+00:00</updated>
<author>
<name>Jozsef Kadlecsik</name>
<email>kadlec@netfilter.org</email>
</author>
<published>2023-09-19T18:04:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=20a93d402b6fe6757e14b0eeb400dfac8b8aa3ad'/>
<id>20a93d402b6fe6757e14b0eeb400dfac8b8aa3ad</id>
<content type='text'>
[ Upstream commit 7433b6d2afd512d04398c73aa984d1e285be125b ]

Kyle Zeng reported that there is a race between IPSET_CMD_ADD and IPSET_CMD_SWAP
in netfilter/ip_set, which can lead to the invocation of `__ip_set_put` on a
wrong `set`, triggering the `BUG_ON(set-&gt;ref == 0);` check in it.

The race is caused by using the wrong reference counter, i.e. the ref counter instead
of ref_netlink.

Fixes: 24e227896bbf ("netfilter: ipset: Add schedule point in call_ad().")
Reported-by: Kyle Zeng &lt;zengyhkyle@gmail.com&gt;
Closes: https://lore.kernel.org/netfilter-devel/ZPZqetxOmH+w%2Fmyc@westworld/#r
Tested-by: Kyle Zeng &lt;zengyhkyle@gmail.com&gt;
Signed-off-by: Jozsef Kadlecsik &lt;kadlec@netfilter.org&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 7433b6d2afd512d04398c73aa984d1e285be125b ]

Kyle Zeng reported that there is a race between IPSET_CMD_ADD and IPSET_CMD_SWAP
in netfilter/ip_set, which can lead to the invocation of `__ip_set_put` on a
wrong `set`, triggering the `BUG_ON(set-&gt;ref == 0);` check in it.

The race is caused by using the wrong reference counter, i.e. the ref counter instead
of ref_netlink.

Fixes: 24e227896bbf ("netfilter: ipset: Add schedule point in call_ad().")
Reported-by: Kyle Zeng &lt;zengyhkyle@gmail.com&gt;
Closes: https://lore.kernel.org/netfilter-devel/ZPZqetxOmH+w%2Fmyc@westworld/#r
Tested-by: Kyle Zeng &lt;zengyhkyle@gmail.com&gt;
Signed-off-by: Jozsef Kadlecsik &lt;kadlec@netfilter.org&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: nf_tables: disable toggling dormant table state more than once</title>
<updated>2023-10-06T11:15:57+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2023-09-15T13:18:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5e5754e9e77ce400d70ff3c30fea466c8dfe9a9f'/>
<id>5e5754e9e77ce400d70ff3c30fea466c8dfe9a9f</id>
<content type='text'>
[ Upstream commit c9bd26513b3a11b3adb3c2ed8a31a01a87173ff1 ]

nft -f -&lt;&lt;EOF
add table ip t
add table ip t { flags dormant; }
add chain ip t c { type filter hook input priority 0; }
add table ip t
EOF

Triggers a splat from nf core on next table delete because we lose
track of right hook register state:

WARNING: CPU: 2 PID: 1597 at net/netfilter/core.c:501 __nf_unregister_net_hook
RIP: 0010:__nf_unregister_net_hook+0x41b/0x570
 nf_unregister_net_hook+0xb4/0xf0
 __nf_tables_unregister_hook+0x160/0x1d0
[..]

The above should have table in *active* state, but in fact no
hooks were registered.

Reject on/off/on games rather than attempting to fix this.

Fixes: 179d9ba5559a ("netfilter: nf_tables: fix table flag updates")
Reported-by: "Lee, Cherie-Anne" &lt;cherie.lee@starlabs.sg&gt;
Cc: Bing-Jhong Billy Jheng &lt;billy@starlabs.sg&gt;
Cc: info@starlabs.sg
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit c9bd26513b3a11b3adb3c2ed8a31a01a87173ff1 ]

nft -f -&lt;&lt;EOF
add table ip t
add table ip t { flags dormant; }
add chain ip t c { type filter hook input priority 0; }
add table ip t
EOF

Triggers a splat from nf core on next table delete because we lose
track of right hook register state:

WARNING: CPU: 2 PID: 1597 at net/netfilter/core.c:501 __nf_unregister_net_hook
RIP: 0010:__nf_unregister_net_hook+0x41b/0x570
 nf_unregister_net_hook+0xb4/0xf0
 __nf_tables_unregister_hook+0x160/0x1d0
[..]

The above should have table in *active* state, but in fact no
hooks were registered.

Reject on/off/on games rather than attempting to fix this.

Fixes: 179d9ba5559a ("netfilter: nf_tables: fix table flag updates")
Reported-by: "Lee, Cherie-Anne" &lt;cherie.lee@starlabs.sg&gt;
Cc: Bing-Jhong Billy Jheng &lt;billy@starlabs.sg&gt;
Cc: info@starlabs.sg
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
