* [PATCH AUTOSEL 4.19 06/12] 9p/fd: Use P9_HDRSZ for header size
[not found] <20221128174235.1442841-1-sashal@kernel.org>
@ 2022-11-28 17:42 ` Sasha Levin
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 11/12] 9p/xen: check logical size for buffer size Sasha Levin
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 12/12] net: usb: qmi_wwan: add u-blox 0x1342 composition Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2022-11-28 17:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: GUO Zihua, Christian Schoenebeck, Dominique Martinet, Sasha Levin,
ericvh, lucho, davem, edumazet, kuba, pabeni, v9fs-developer,
netdev
From: GUO Zihua <guozihua@huawei.com>
[ Upstream commit 6854fadbeee10891ed74246bdc05031906b6c8cf ]
Cleanup hardcoded header sizes to use P9_HDRSZ instead of '7'
Link: https://lkml.kernel.org/r/20221117091159.31533-4-guozihua@huawei.com
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
[Dominique: commit message adjusted to make sense after offset size
adjustment got removed]
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/9p/trans_fd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 7194ffa58d3e..689117c78deb 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -133,7 +133,7 @@ struct p9_conn {
struct list_head unsent_req_list;
struct p9_req_t *rreq;
struct p9_req_t *wreq;
- char tmp_buf[7];
+ char tmp_buf[P9_HDRSZ];
struct p9_fcall rc;
int wpos;
int wsize;
@@ -304,7 +304,7 @@ static void p9_read_work(struct work_struct *work)
if (!m->rc.sdata) {
m->rc.sdata = m->tmp_buf;
m->rc.offset = 0;
- m->rc.capacity = 7; /* start by reading header */
+ m->rc.capacity = P9_HDRSZ; /* start by reading header */
}
clear_bit(Rpending, &m->wsched);
@@ -327,7 +327,7 @@ static void p9_read_work(struct work_struct *work)
p9_debug(P9_DEBUG_TRANS, "got new header\n");
/* Header size */
- m->rc.size = 7;
+ m->rc.size = P9_HDRSZ;
err = p9_parse_header(&m->rc, &m->rc.size, NULL, NULL, 0);
if (err) {
p9_debug(P9_DEBUG_ERROR,
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 4.19 11/12] 9p/xen: check logical size for buffer size
[not found] <20221128174235.1442841-1-sashal@kernel.org>
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 06/12] 9p/fd: Use P9_HDRSZ for header size Sasha Levin
@ 2022-11-28 17:42 ` Sasha Levin
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 12/12] net: usb: qmi_wwan: add u-blox 0x1342 composition Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2022-11-28 17:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Dominique Martinet, Stefano Stabellini, Christian Schoenebeck,
Sasha Levin, ericvh, lucho, davem, edumazet, kuba, pabeni,
v9fs-developer, netdev
From: Dominique Martinet <asmadeus@codewreck.org>
[ Upstream commit 391c18cf776eb4569ecda1f7794f360fe0a45a26 ]
trans_xen did not check the data fits into the buffer before copying
from the xen ring, but we probably should.
Add a check that just skips the request and return an error to
userspace if it did not fit
Tested-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Link: https://lkml.kernel.org/r/20221118135542.63400-1-asmadeus@codewreck.org
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/9p/trans_xen.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
index ac60ddfcd88b..6459c2356ff9 100644
--- a/net/9p/trans_xen.c
+++ b/net/9p/trans_xen.c
@@ -230,6 +230,14 @@ static void p9_xen_response(struct work_struct *work)
continue;
}
+ if (h.size > req->rc.capacity) {
+ dev_warn(&priv->dev->dev,
+ "requested packet size too big: %d for tag %d with capacity %zd\n",
+ h.size, h.tag, req->rc.capacity);
+ req->status = REQ_STATUS_ERROR;
+ goto recv_error;
+ }
+
memcpy(&req->rc, &h, sizeof(h));
req->rc.offset = 0;
@@ -239,6 +247,7 @@ static void p9_xen_response(struct work_struct *work)
masked_prod, &masked_cons,
XEN_9PFS_RING_SIZE);
+recv_error:
virt_mb();
cons += h.size;
ring->intf->in_cons = cons;
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 4.19 12/12] net: usb: qmi_wwan: add u-blox 0x1342 composition
[not found] <20221128174235.1442841-1-sashal@kernel.org>
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 06/12] 9p/fd: Use P9_HDRSZ for header size Sasha Levin
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 11/12] 9p/xen: check logical size for buffer size Sasha Levin
@ 2022-11-28 17:42 ` Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2022-11-28 17:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Davide Tronchin, Bjørn Mork, David S . Miller, Sasha Levin,
edumazet, kuba, pabeni, netdev, linux-usb
From: Davide Tronchin <davide.tronchin.94@gmail.com>
[ Upstream commit a487069e11b6527373f7c6f435d8998051d0b5d9 ]
Add RmNet support for LARA-L6.
LARA-L6 module can be configured (by AT interface) in three different
USB modes:
* Default mode (Vendor ID: 0x1546 Product ID: 0x1341) with 4 serial
interfaces
* RmNet mode (Vendor ID: 0x1546 Product ID: 0x1342) with 4 serial
interfaces and 1 RmNet virtual network interface
* CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1343) with 4 serial
interface and 1 CDC-ECM virtual network interface
In RmNet mode LARA-L6 exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parset/alternative functions
If 4: RMNET interface
Signed-off-by: Davide Tronchin <davide.tronchin.94@gmail.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/usb/qmi_wwan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 56115792bea1..13a9a217b688 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1376,6 +1376,7 @@ static const struct usb_device_id products[] = {
{QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
{QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
+ {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
/* 4. Gobi 1000 devices */
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-28 17:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20221128174235.1442841-1-sashal@kernel.org>
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 06/12] 9p/fd: Use P9_HDRSZ for header size Sasha Levin
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 11/12] 9p/xen: check logical size for buffer size Sasha Levin
2022-11-28 17:42 ` [PATCH AUTOSEL 4.19 12/12] net: usb: qmi_wwan: add u-blox 0x1342 composition Sasha Levin
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).