* [PATCH AUTOSEL 4.14 1/9] 9p: virtio: make sure 'offs' is initialized in zc_request
@ 2023-08-13 16:14 Sasha Levin
2023-08-13 16:14 ` [PATCH AUTOSEL 4.14 3/9] ethernet: atheros: fix return value check in atl1c_tso_csum() Sasha Levin
2023-08-13 16:14 ` [PATCH AUTOSEL 4.14 4/9] vxlan: generalize vxlan_parse_gpe_hdr and remove unused args Sasha Levin
0 siblings, 2 replies; 4+ messages in thread
From: Sasha Levin @ 2023-08-13 16:14 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Dominique Martinet, Simon Horman, Eric Van Hensbergen,
Sasha Levin, lucho, davem, edumazet, kuba, pabeni, v9fs, netdev
From: Dominique Martinet <asmadeus@codewreck.org>
[ Upstream commit 4a73edab69d3a6623f03817fe950a2d9585f80e4 ]
Similarly to the previous patch: offs can be used in handle_rerrors
without initializing on small payloads; in this case handle_rerrors will
not use it because of the size check, but it doesn't hurt to make sure
it is zero to please scan-build.
This fixes the following warning:
net/9p/trans_virtio.c:539:3: warning: 3rd function call argument is an uninitialized value [core.CallAndMessage]
handle_rerror(req, in_hdr_len, offs, in_pages);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/9p/trans_virtio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index c6a46e8e9eda5..25f5caa57289b 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -401,7 +401,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,
struct page **in_pages = NULL, **out_pages = NULL;
struct virtio_chan *chan = client->trans;
struct scatterlist *sgs[4];
- size_t offs;
+ size_t offs = 0;
int need_drop = 0;
p9_debug(P9_DEBUG_TRANS, "virtio request\n");
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH AUTOSEL 4.14 3/9] ethernet: atheros: fix return value check in atl1c_tso_csum()
2023-08-13 16:14 [PATCH AUTOSEL 4.14 1/9] 9p: virtio: make sure 'offs' is initialized in zc_request Sasha Levin
@ 2023-08-13 16:14 ` Sasha Levin
2023-08-13 16:14 ` [PATCH AUTOSEL 4.14 4/9] vxlan: generalize vxlan_parse_gpe_hdr and remove unused args Sasha Levin
1 sibling, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2023-08-13 16:14 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Yuanjun Gong, Simon Horman, David S . Miller, Sasha Levin,
chris.snook, edumazet, kuba, pabeni, mkl, trix, pavan.chebbi,
netdev
From: Yuanjun Gong <ruc_gongyuanjun@163.com>
[ Upstream commit 8d01da0a1db237c44c92859ce3612df7af8d3a53 ]
in atl1c_tso_csum, it should check the return value of pskb_trim(),
and return an error code if an unexpected value is returned
by pskb_trim().
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 3615c2a06fdad..6f5c7c1401ce0 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -2001,8 +2001,11 @@ static int atl1c_tso_csum(struct atl1c_adapter *adapter,
real_len = (((unsigned char *)ip_hdr(skb) - skb->data)
+ ntohs(ip_hdr(skb)->tot_len));
- if (real_len < skb->len)
- pskb_trim(skb, real_len);
+ if (real_len < skb->len) {
+ err = pskb_trim(skb, real_len);
+ if (err)
+ return err;
+ }
hdr_len = (skb_transport_offset(skb) + tcp_hdrlen(skb));
if (unlikely(skb->len == hdr_len)) {
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH AUTOSEL 4.14 4/9] vxlan: generalize vxlan_parse_gpe_hdr and remove unused args
2023-08-13 16:14 [PATCH AUTOSEL 4.14 1/9] 9p: virtio: make sure 'offs' is initialized in zc_request Sasha Levin
2023-08-13 16:14 ` [PATCH AUTOSEL 4.14 3/9] ethernet: atheros: fix return value check in atl1c_tso_csum() Sasha Levin
@ 2023-08-13 16:14 ` Sasha Levin
2023-08-22 10:45 ` Pavel Machek
1 sibling, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2023-08-13 16:14 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jiri Benc, David S . Miller, Sasha Levin, edumazet, kuba, pabeni,
netdev
From: Jiri Benc <jbenc@redhat.com>
[ Upstream commit 17a0a64448b568442a101de09575f81ffdc45d15 ]
The vxlan_parse_gpe_hdr function extracts the next protocol value from
the GPE header and marks GPE bits as parsed.
In order to be used in the next patch, split the function into protocol
extraction and bit marking. The bit marking is meaningful only in
vxlan_rcv; move it directly there.
Rename the function to vxlan_parse_gpe_proto to reflect what it now
does. Remove unused arguments skb and vxflags. Move the function earlier
in the file to allow it to be called from more places in the next patch.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/vxlan.c | 58 ++++++++++++++++++++++-----------------------
1 file changed, 28 insertions(+), 30 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 31657f15eb071..52aa32d7e4c5c 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -542,6 +542,32 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
return 1;
}
+static bool vxlan_parse_gpe_proto(struct vxlanhdr *hdr, __be16 *protocol)
+{
+ struct vxlanhdr_gpe *gpe = (struct vxlanhdr_gpe *)hdr;
+
+ /* Need to have Next Protocol set for interfaces in GPE mode. */
+ if (!gpe->np_applied)
+ return false;
+ /* "The initial version is 0. If a receiver does not support the
+ * version indicated it MUST drop the packet.
+ */
+ if (gpe->version != 0)
+ return false;
+ /* "When the O bit is set to 1, the packet is an OAM packet and OAM
+ * processing MUST occur." However, we don't implement OAM
+ * processing, thus drop the packet.
+ */
+ if (gpe->oam_flag)
+ return false;
+
+ *protocol = tun_p_to_eth_p(gpe->next_protocol);
+ if (!*protocol)
+ return false;
+
+ return true;
+}
+
static struct vxlanhdr *vxlan_gro_remcsum(struct sk_buff *skb,
unsigned int off,
struct vxlanhdr *vh, size_t hdrlen,
@@ -1278,35 +1304,6 @@ static void vxlan_parse_gbp_hdr(struct vxlanhdr *unparsed,
unparsed->vx_flags &= ~VXLAN_GBP_USED_BITS;
}
-static bool vxlan_parse_gpe_hdr(struct vxlanhdr *unparsed,
- __be16 *protocol,
- struct sk_buff *skb, u32 vxflags)
-{
- struct vxlanhdr_gpe *gpe = (struct vxlanhdr_gpe *)unparsed;
-
- /* Need to have Next Protocol set for interfaces in GPE mode. */
- if (!gpe->np_applied)
- return false;
- /* "The initial version is 0. If a receiver does not support the
- * version indicated it MUST drop the packet.
- */
- if (gpe->version != 0)
- return false;
- /* "When the O bit is set to 1, the packet is an OAM packet and OAM
- * processing MUST occur." However, we don't implement OAM
- * processing, thus drop the packet.
- */
- if (gpe->oam_flag)
- return false;
-
- *protocol = tun_p_to_eth_p(gpe->next_protocol);
- if (!*protocol)
- return false;
-
- unparsed->vx_flags &= ~VXLAN_GPE_USED_BITS;
- return true;
-}
-
static bool vxlan_set_mac(struct vxlan_dev *vxlan,
struct vxlan_sock *vs,
struct sk_buff *skb, __be32 vni)
@@ -1408,8 +1405,9 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
* used by VXLAN extensions if explicitly requested.
*/
if (vs->flags & VXLAN_F_GPE) {
- if (!vxlan_parse_gpe_hdr(&unparsed, &protocol, skb, vs->flags))
+ if (!vxlan_parse_gpe_proto(&unparsed, &protocol))
goto drop;
+ unparsed.vx_flags &= ~VXLAN_GPE_USED_BITS;
raw_proto = true;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH AUTOSEL 4.14 4/9] vxlan: generalize vxlan_parse_gpe_hdr and remove unused args
2023-08-13 16:14 ` [PATCH AUTOSEL 4.14 4/9] vxlan: generalize vxlan_parse_gpe_hdr and remove unused args Sasha Levin
@ 2023-08-22 10:45 ` Pavel Machek
0 siblings, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2023-08-22 10:45 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, Jiri Benc, David S . Miller, edumazet, kuba,
pabeni, netdev
[-- Attachment #1: Type: text/plain, Size: 932 bytes --]
Hi!
> From: Jiri Benc <jbenc@redhat.com>
>
> [ Upstream commit 17a0a64448b568442a101de09575f81ffdc45d15 ]
>
> The vxlan_parse_gpe_hdr function extracts the next protocol value from
> the GPE header and marks GPE bits as parsed.
>
> In order to be used in the next patch, split the function into protocol
> extraction and bit marking. The bit marking is meaningful only in
> vxlan_rcv; move it directly there.
>
> Rename the function to vxlan_parse_gpe_proto to reflect what it now
> does. Remove unused arguments skb and vxflags. Move the function earlier
> in the file to allow it to be called from more places in the next
> patch.
This seems to be a cleanup/preparation for a patch we don't have
queued for 4.14. Please drop.
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-22 10:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-13 16:14 [PATCH AUTOSEL 4.14 1/9] 9p: virtio: make sure 'offs' is initialized in zc_request Sasha Levin
2023-08-13 16:14 ` [PATCH AUTOSEL 4.14 3/9] ethernet: atheros: fix return value check in atl1c_tso_csum() Sasha Levin
2023-08-13 16:14 ` [PATCH AUTOSEL 4.14 4/9] vxlan: generalize vxlan_parse_gpe_hdr and remove unused args Sasha Levin
2023-08-22 10:45 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).