<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/uapi/linux/xfrm.h, branch v5.10.228</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.228</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.228'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-05-25T07:18:02+00:00</updated>
<entry>
<title>include/uapi/linux/xfrm.h: Fix XFRM_MSG_MAPPING ABI breakage</title>
<updated>2022-05-25T07:18:02+00:00</updated>
<author>
<name>Eugene Syromiatnikov</name>
<email>esyr@redhat.com</email>
</author>
<published>2021-09-12T12:22:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=633be494c3ca66a6c36e61100ffa0bd3d2923954'/>
<id>urn:sha1:633be494c3ca66a6c36e61100ffa0bd3d2923954</id>
<content type='text'>
commit 844f7eaaed9267ae17d33778efe65548cc940205 upstream.

Commit 2d151d39073a ("xfrm: Add possibility to set the default to block
if we have no policy") broke ABI by changing the value of the XFRM_MSG_MAPPING
enum item, thus also evading the build-time check
in security/selinux/nlmsgtab.c:selinux_nlmsg_lookup for presence of proper
security permission checks in nlmsg_xfrm_perms.  Fix it by placing
XFRM_MSG_SETDEFAULT/XFRM_MSG_GETDEFAULT to the end of the enum, right before
__XFRM_MSG_MAX, and updating the nlmsg_xfrm_perms accordingly.

Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
References: https://lore.kernel.org/netdev/20210901151402.GA2557@altlinux.org/
Signed-off-by: Eugene Syromiatnikov &lt;esyr@redhat.com&gt;
Acked-by: Antony Antony &lt;antony.antony@secunet.com&gt;
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xfrm: make user policy API complete</title>
<updated>2022-05-25T07:17:57+00:00</updated>
<author>
<name>Nicolas Dichtel</name>
<email>nicolas.dichtel@6wind.com</email>
</author>
<published>2021-09-14T14:46:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=20fd28df40494400babe79c89549bd8317b7dd9f'/>
<id>urn:sha1:20fd28df40494400babe79c89549bd8317b7dd9f</id>
<content type='text'>
[ Upstream commit f8d858e607b2a36808ac6d4218f5f5203d7a7d63 ]

&gt;From a userland POV, this API was based on some magic values:
 - dirmask and action were bitfields but meaning of bits
   (XFRM_POL_DEFAULT_*) are not exported;
 - action is confusing, if a bit is set, does it mean drop or accept?

Let's try to simplify this uapi by using explicit field and macros.

Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: xfrm: fix shift-out-of-bounce</title>
<updated>2022-05-25T07:17:57+00:00</updated>
<author>
<name>Pavel Skripkin</name>
<email>paskripkin@gmail.com</email>
</author>
<published>2021-07-28T16:38:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ab610ee1d1a1d5f9f6e326c21962cb3fc8b81a5b'/>
<id>urn:sha1:ab610ee1d1a1d5f9f6e326c21962cb3fc8b81a5b</id>
<content type='text'>
[ Upstream commit 5d8dbb7fb82b8661c16d496644b931c0e2e3a12e ]

We need to check up-&gt;dirmask to avoid shift-out-of-bounce bug,
since up-&gt;dirmask comes from userspace.

Also, added XFRM_USERPOLICY_DIRMASK_MAX constant to uapi to inform
user-space that up-&gt;dirmask has maximum possible value

Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
Reported-and-tested-by: syzbot+9cd5837a045bbee5b810@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin &lt;paskripkin@gmail.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfrm: Add possibility to set the default to block if we have no policy</title>
<updated>2022-05-25T07:17:57+00:00</updated>
<author>
<name>Steffen Klassert</name>
<email>steffen.klassert@secunet.com</email>
</author>
<published>2021-07-18T07:11:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5b7f84b1f9f46327360a64c529433fa0d68cc3f4'/>
<id>urn:sha1:5b7f84b1f9f46327360a64c529433fa0d68cc3f4</id>
<content type='text'>
[ Upstream commit 2d151d39073aff498358543801fca0f670fea981 ]

As the default we assume the traffic to pass, if we have no
matching IPsec policy. With this patch, we have a possibility to
change this default from allow to block. It can be configured
via netlink. Each direction (input/output/forward) can be
configured separately. With the default to block configuered,
we need allow policies for all packet flows we accept.
We do not use default policy lookup for the loopback device.

v1-&gt;v2
 - fix compiling when XFRM is disabled
 - Reported-by: kernel test robot &lt;lkp@intel.com&gt;

Co-developed-by: Christian Langrock &lt;christian.langrock@secunet.com&gt;
Signed-off-by: Christian Langrock &lt;christian.langrock@secunet.com&gt;
Co-developed-by: Antony Antony &lt;antony.antony@secunet.com&gt;
Signed-off-by: Antony Antony &lt;antony.antony@secunet.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfrm: enforce validity of offload input flags</title>
<updated>2022-03-08T18:09:32+00:00</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@nvidia.com</email>
</author>
<published>2022-02-08T14:14:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b53d4bfd1a6894e00dc8d654af61a22bb914dde4'/>
<id>urn:sha1:b53d4bfd1a6894e00dc8d654af61a22bb914dde4</id>
<content type='text'>
commit 7c76ecd9c99b6e9a771d813ab1aa7fa428b3ade1 upstream.

struct xfrm_user_offload has flags variable that received user input,
but kernel didn't check if valid bits were provided. It caused a situation
where not sanitized input was forwarded directly to the drivers.

For example, XFRM_OFFLOAD_IPV6 define that was exposed, was used by
strongswan, but not implemented in the kernel at all.

As a solution, check and sanitize input flags to forward
XFRM_OFFLOAD_INBOUND to the drivers.

Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xfrm: rate limit SA mapping change message to user space</title>
<updated>2022-01-27T09:54:18+00:00</updated>
<author>
<name>Antony Antony</name>
<email>antony.antony@secunet.com</email>
</author>
<published>2021-12-22T13:11:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a0b13335a342c9083640ba0ea6fe7c8d8076cae7'/>
<id>urn:sha1:a0b13335a342c9083640ba0ea6fe7c8d8076cae7</id>
<content type='text'>
[ Upstream commit 4e484b3e969b52effd95c17f7a86f39208b2ccf4 ]

Kernel generates mapping change message, XFRM_MSG_MAPPING,
when a source port chage is detected on a input state with UDP
encapsulation set.  Kernel generates a message for each IPsec packet
with new source port.  For a high speed flow per packet mapping change
message can be excessive, and can overload the user space listener.

Introduce rate limiting for XFRM_MSG_MAPPING message to the user space.

The rate limiting is configurable via netlink, when adding a new SA or
updating it. Use the new attribute XFRMA_MTIMER_THRESH in seconds.

v1-&gt;v2 change:
	update xfrm_sa_len()

v2-&gt;v3 changes:
	use u32 insted unsigned long to reduce size of struct xfrm_state
	fix xfrm_ompat size Reported-by: kernel test robot &lt;lkp@intel.com&gt;
	accept XFRM_MSG_MAPPING only when XFRMA_ENCAP is present

Co-developed-by: Thomas Egerer &lt;thomas.egerer@secunet.com&gt;
Signed-off-by: Thomas Egerer &lt;thomas.egerer@secunet.com&gt;
Signed-off-by: Antony Antony &lt;antony.antony@secunet.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfrm: introduce oseq-may-wrap flag</title>
<updated>2020-06-24T05:51:01+00:00</updated>
<author>
<name>Petr Vaněk</name>
<email>pv@excello.cz</email>
</author>
<published>2020-05-30T12:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=428d2459cceb77357b81c242ca22462a6a904817'/>
<id>urn:sha1:428d2459cceb77357b81c242ca22462a6a904817</id>
<content type='text'>
RFC 4303 in section 3.3.3 suggests to disable anti-replay for manually
distributed ICVs in which case the sender does not need to monitor or
reset the counter. However, the sender still increments the counter and
when it reaches the maximum value, the counter rolls over back to zero.

This patch introduces new extra_flag XFRM_SA_XFLAG_OSEQ_MAY_WRAP which
allows sequence number to cycle in outbound packets if set. This flag is
used only in legacy and bmp code, because esn should not be negotiated
if anti-replay is disabled (see note in 3.3.3 section).

Signed-off-by: Petr Vaněk &lt;pv@excello.cz&gt;
Acked-by: Christophe Gouault &lt;christophe.gouault@6wind.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
</content>
</entry>
<entry>
<title>xfrm: fix error in comment</title>
<updated>2020-04-20T05:26:42+00:00</updated>
<author>
<name>Antony Antony</name>
<email>antony@phenome.org</email>
</author>
<published>2020-04-15T19:47:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=29e4276667e24ee6b91d9f91064d8fda9a210ea1'/>
<id>urn:sha1:29e4276667e24ee6b91d9f91064d8fda9a210ea1</id>
<content type='text'>
s/xfrm_state_offload/xfrm_user_offload/

Fixes: d77e38e612a ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Antony Antony &lt;antony@phenome.org&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
</content>
</entry>
<entry>
<title>xfrm: Add a new lookup key to match xfrm interfaces.</title>
<updated>2018-06-23T14:07:15+00:00</updated>
<author>
<name>Steffen Klassert</name>
<email>steffen.klassert@secunet.com</email>
</author>
<published>2018-06-12T12:07:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7e6526404adedf079279aa7aa11722deaca8fe2e'/>
<id>urn:sha1:7e6526404adedf079279aa7aa11722deaca8fe2e</id>
<content type='text'>
This patch adds the xfrm interface id as a lookup key
for xfrm states and policies. With this we can assign
states and policies to virtual xfrm interfaces.

Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Acked-by: Shannon Nelson &lt;shannon.nelson@oracle.com&gt;
Acked-by: Benedict Wong &lt;benedictwong@google.com&gt;
Tested-by: Benedict Wong &lt;benedictwong@google.com&gt;
Tested-by: Antony Antony &lt;antony@phenome.org&gt;
Reviewed-by: Eyal Birger &lt;eyal.birger@gmail.com&gt;
</content>
</entry>
<entry>
<title>xfrm: Extend the output_mark to support input direction and masking.</title>
<updated>2018-06-23T14:06:57+00:00</updated>
<author>
<name>Steffen Klassert</name>
<email>steffen.klassert@secunet.com</email>
</author>
<published>2018-06-12T10:44:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9b42c1f179a614e11893ae4619f0304a38f481ae'/>
<id>urn:sha1:9b42c1f179a614e11893ae4619f0304a38f481ae</id>
<content type='text'>
We already support setting an output mark at the xfrm_state,
unfortunately this does not support the input direction and
masking the marks that will be applied to the skb. This change
adds support applying a masked value in both directions.

The existing XFRMA_OUTPUT_MARK number is reused for this purpose
and as it is now bi-directional, it is renamed to XFRMA_SET_MARK.

An additional XFRMA_SET_MARK_MASK attribute is added for setting the
mask. If the attribute mask not provided, it is set to 0xffffffff,
keeping the XFRMA_OUTPUT_MARK existing 'full mask' semantics.

Co-developed-by: Tobias Brunner &lt;tobias@strongswan.org&gt;
Co-developed-by: Eyal Birger &lt;eyal.birger@gmail.com&gt;
Co-developed-by: Lorenzo Colitti &lt;lorenzo@google.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: Tobias Brunner &lt;tobias@strongswan.org&gt;
Signed-off-by: Eyal Birger &lt;eyal.birger@gmail.com&gt;
Signed-off-by: Lorenzo Colitti &lt;lorenzo@google.com&gt;
</content>
</entry>
</feed>
