Skip to contentSkip to conversation

pull-request: can 2021-06-24

PATCH Applied Marc Kleine-Budde 2 participants 5 messages Jun 24, 2021

Subsystems (6)
lore
Share & tools
lore

Marc Kleine-Budde

author maintainer
#0 lore raw

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(-)
author maintainer
#1 lore raw

PATCH 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
index fce8bc8afeb7..e1a399821238 100644
@@ -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
#2 lore raw

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_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.

[...]

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

author maintainer
#3 lore raw

PATCH 2/2 can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path

In reply to Marc Kleine-Budde

From: 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.

Fixes ffd137f7043c ("can: peak/pcie_fd: remove useless code when interface starts")
Cc linux-stable <[email protected]>
---
 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
index 00847cbaf7b6..d08718e98e11 100644
@@ -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
#4 lore raw
In reply to Marc Kleine-Budde
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