All of lore.kernel.org
 help / color / mirror / Atom feed
* pull-request: can 2021-06-24
@ 2021-06-24  6:41 Marc Kleine-Budde
  2021-06-24  6:41 ` [net 1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0 Marc Kleine-Budde
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2021-06-24  6:41 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel

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(-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [net 1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0
  2021-06-24  6:41 pull-request: can 2021-06-24 Marc Kleine-Budde
@ 2021-06-24  6:41 ` Marc Kleine-Budde
  2021-06-24 18:30   ` patchwork-bot+netdevbpf
  2021-06-24  6:42 ` [net 2/2] can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path Marc Kleine-Budde
  2021-06-24 18:30 ` pull-request: can 2021-06-24 patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Marc Kleine-Budde @ 2021-06-24  6:41 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, linux-can, kernel, Norbert Slusarek, Oleksij Rempel,
	Marc Kleine-Budde

From: Norbert Slusarek <nslusarek@gmx.net>

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 <nslusarek@gmx.net>
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(-)

diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c
index fce8bc8afeb7..e1a399821238 100644
--- a/net/can/j1939/socket.c
+++ b/net/can/j1939/socket.c
@@ -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
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [net 2/2] can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path
  2021-06-24  6:41 pull-request: can 2021-06-24 Marc Kleine-Budde
  2021-06-24  6:41 ` [net 1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0 Marc Kleine-Budde
@ 2021-06-24  6:42 ` Marc Kleine-Budde
  2021-06-24 18:30 ` pull-request: can 2021-06-24 patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2021-06-24  6:42 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, linux-can, kernel, Stephane Grosjean, linux-stable,
	Marc Kleine-Budde

From: Stephane Grosjean <s.grosjean@peak-system.com>

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 <stable@vger.kernel.org>
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
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(-)

diff --git a/drivers/net/can/peak_canfd/peak_canfd.c b/drivers/net/can/peak_canfd/peak_canfd.c
index 00847cbaf7b6..d08718e98e11 100644
--- a/drivers/net/can/peak_canfd/peak_canfd.c
+++ b/drivers/net/can/peak_canfd/peak_canfd.c
@@ -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;
 	}
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: pull-request: can 2021-06-24
  2021-06-24  6:41 pull-request: can 2021-06-24 Marc Kleine-Budde
  2021-06-24  6:41 ` [net 1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0 Marc Kleine-Budde
  2021-06-24  6:42 ` [net 2/2] can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path Marc Kleine-Budde
@ 2021-06-24 18:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-24 18:30 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: netdev, davem, kuba, linux-can, kernel

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.
> 
> [...]

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [net 1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0
  2021-06-24  6:41 ` [net 1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0 Marc Kleine-Budde
@ 2021-06-24 18:30   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-24 18:30 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: netdev, davem, kuba, linux-can, kernel, nslusarek, o.rempel

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 <nslusarek@gmx.net>
> 
> 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-24 18:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24  6:41 pull-request: can 2021-06-24 Marc Kleine-Budde
2021-06-24  6:41 ` [net 1/2] can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0 Marc Kleine-Budde
2021-06-24 18:30   ` patchwork-bot+netdevbpf
2021-06-24  6:42 ` [net 2/2] can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path Marc Kleine-Budde
2021-06-24 18:30 ` pull-request: can 2021-06-24 patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.