pull-request: can 2021-06-24
Subsystems (6)
Marc Kleine-Budde
maintainerHello 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(-)
Marc Kleine-Budde
maintainerPATCH 1/2 can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0
From: Norbert Slusarek <[email protected]>
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.
--- net/can/j1939/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/can/j1939/socket.c +1 -1
@@ -676,7 +676,7 @@ static int j1939_sk_setsockopt(struct socket *sock, int level, int optname,switch (optname) {case SO_J1939_FILTER : -if (!sockptr_is_null (optval)) { +if (!sockptr_is_null (optval) && optlen !=0 ) {struct j1939_filter *f;int c;
base-commit: c2f5c57d99debf471a1b263cdf227e55f1364e95
Signature · 1 line
2.30.2
Re: [net 1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0
This series was applied to netdev/net.git (refs/heads/master):
Hello:
This series was applied to netdev/net.git (refs/heads/master):
Quoted 9 lines · On Thu, 24 Jun 2021 08:41:59 +0200 you wrote:
From: Norbert Slusarek <[email protected]>
If optval != NULL and optlen == 0 are specified for
SO_J1939_FILTERinj1939_sk_setsockopt(),memdup_sockptr()will returnZERO_PTRfor 0 size allocation. The new filter will be mistakenly assignedZERO_PTR. This patch checks for optlen != 0 and filter will be assigned NULL in case of optlen == 0.[...]
Here is the summary with links:
- [net,1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0
https://git.kernel.org/netdev/net/c/aaf473d0100f - [net,2/2] can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path https://git.kernel.org/netdev/net/c/b17233d385d0
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Marc Kleine-Budde
maintainerPATCH 2/2 can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path
In reply to Marc Kleine-BuddeFrom: Stephane Grosjean <[email protected]>
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.
--- drivers/net/can/peak_canfd/peak_canfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/peak_canfd/peak_canfd.c +2 -2
@@ -351,8 +351,8 @@ static int pucan_handle_status(struct peak_canfd_priv *priv,return err; } -/* start network queue (echo_skb array is empty) */ -netif_start_queue (ndev); +/* wake network queue up (echo_skb array is empty) */ +netif_wake_queue (ndev);return 0 ; }
Signature · 1 line
2.30.2
This pull request was applied to netdev/net.git (refs/heads/master):
Hello:
This pull request was applied to netdev/net.git (refs/heads/master):
Quoted 8 lines · 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.
[...]
Here is the summary with links:
- pull-request: can 2021-06-24
https://git.kernel.org/netdev/net/c/abe90454f075
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html