From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2021-06-24 06:42:09
Hello Jakub, hello David,
this is a pull request of 2 patches for net/master.
The first patch is by Norbert Slusarek and prevent allocation of
filter for optlen == 0 in the j1939 CAN protocol.
The last patch is by Stephane Grosjean and fixes a potential
starvation in the TX path of the peak_pciefd driver.
regards,
Marc
---
The following changes since commit c2f5c57d99debf471a1b263cdf227e55f1364e95:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf (2021-06-23 14:12:14 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-5.13-20210624
for you to fetch changes up to b17233d385d0b6b43ecf81d43008cb1bbb008166:
can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path (2021-06-24 08:40:10 +0200)
----------------------------------------------------------------
linux-can-fixes-for-5.13-20210624
----------------------------------------------------------------
Norbert Slusarek (1):
can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0
Stephane Grosjean (1):
can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path
drivers/net/can/peak_canfd/peak_canfd.c | 4 ++--
net/can/j1939/socket.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2021-06-24 06:42:11
From: Stephane Grosjean <redacted>
Rather than just indicating that transmission can start, this patch
requires the explicit flushing of the network TX queue when the driver
is informed by the device that it can transmit, next to its
configuration.
In this way, if frames have already been written by the application,
they will actually be transmitted.
Fixes: ffd137f7043c ("can: peak/pcie_fd: remove useless code when interface starts")
Link: https://lore.kernel.org/r/20210623142600.149904-1-s.grosjean@peak-system.com
Cc: linux-stable <redacted>
Signed-off-by: Stephane Grosjean <redacted>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/peak_canfd/peak_canfd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2021-06-24 06:42:11
From: Norbert Slusarek <redacted>
If optval != NULL and optlen == 0 are specified for SO_J1939_FILTER in
j1939_sk_setsockopt(), memdup_sockptr() will return ZERO_PTR for 0
size allocation. The new filter will be mistakenly assigned ZERO_PTR.
This patch checks for optlen != 0 and filter will be assigned NULL in
case of optlen == 0.
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Link: https://lore.kernel.org/r/20210620123842.117975-1-nslusarek@gmx.net
Signed-off-by: Norbert Slusarek <redacted>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
net/can/j1939/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -676,7 +676,7 @@ static int j1939_sk_setsockopt(struct socket *sock, int level, int optname,switch(optname){caseSO_J1939_FILTER:-if(!sockptr_is_null(optval)){+if(!sockptr_is_null(optval)&&optlen!=0){structj1939_filter*f;intc;
Hello:
This pull request was applied to netdev/net.git (refs/heads/master):
On Thu, 24 Jun 2021 08:41:58 +0200 you wrote:
Hello Jakub, hello David,
this is a pull request of 2 patches for net/master.
The first patch is by Norbert Slusarek and prevent allocation of
filter for optlen == 0 in the j1939 CAN protocol.
[...]
Hello:
This series was applied to netdev/net.git (refs/heads/master):
On Thu, 24 Jun 2021 08:41:59 +0200 you wrote:
From: Norbert Slusarek <redacted>
If optval != NULL and optlen == 0 are specified for SO_J1939_FILTER in
j1939_sk_setsockopt(), memdup_sockptr() will return ZERO_PTR for 0
size allocation. The new filter will be mistakenly assigned ZERO_PTR.
This patch checks for optlen != 0 and filter will be assigned NULL in
case of optlen == 0.
[...]