From: Greg Kroah-Hartman Date: Wed, 24 Jan 2018 10:06:22 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v4.4.114~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f740ef1dd7ba66e74e14acccc6e16c1a604f8f1c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: can-af_can-can_rcv-replace-warn_once-by-pr_warn_once.patch can-af_can-canfd_rcv-replace-warn_once-by-pr_warn_once.patch --- diff --git a/queue-3.18/can-af_can-can_rcv-replace-warn_once-by-pr_warn_once.patch b/queue-3.18/can-af_can-can_rcv-replace-warn_once-by-pr_warn_once.patch new file mode 100644 index 00000000000..5c25684d6f4 --- /dev/null +++ b/queue-3.18/can-af_can-can_rcv-replace-warn_once-by-pr_warn_once.patch @@ -0,0 +1,49 @@ +From 8cb68751c115d176ec851ca56ecfbb411568c9e8 Mon Sep 17 00:00:00 2001 +From: Marc Kleine-Budde +Date: Tue, 16 Jan 2018 19:30:14 +0100 +Subject: can: af_can: can_rcv(): replace WARN_ONCE by pr_warn_once + +From: Marc Kleine-Budde + +commit 8cb68751c115d176ec851ca56ecfbb411568c9e8 upstream. + +If an invalid CAN frame is received, from a driver or from a tun +interface, a Kernel warning is generated. + +This patch replaces the WARN_ONCE by a simple pr_warn_once, so that a +kernel, bootet with panic_on_warn, does not panic. A printk seems to be +more appropriate here. + +Reported-by: syzbot+4386709c0c1284dca827@syzkaller.appspotmail.com +Suggested-by: Dmitry Vyukov +Acked-by: Oliver Hartkopp +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Oliver Hartkopp +Signed-off-by: Greg Kroah-Hartman + + +--- + net/can/af_can.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +--- a/net/can/af_can.c ++++ b/net/can/af_can.c +@@ -719,13 +719,12 @@ static int can_rcv(struct sk_buff *skb, + if (unlikely(!net_eq(dev_net(dev), &init_net))) + goto drop; + +- if (WARN_ONCE(dev->type != ARPHRD_CAN || +- skb->len != CAN_MTU || +- cfd->len > CAN_MAX_DLEN, +- "PF_CAN: dropped non conform CAN skbuf: " +- "dev type %d, len %d, datalen %d\n", +- dev->type, skb->len, cfd->len)) ++ if (unlikely(dev->type != ARPHRD_CAN || skb->len != CAN_MTU || ++ cfd->len > CAN_MAX_DLEN)) { ++ pr_warn_once("PF_CAN: dropped non conform CAN skbuf: dev type %d, len %d, datalen %d\n", ++ dev->type, skb->len, cfd->len); + goto drop; ++ } + + can_receive(skb, dev); + return NET_RX_SUCCESS; diff --git a/queue-3.18/can-af_can-canfd_rcv-replace-warn_once-by-pr_warn_once.patch b/queue-3.18/can-af_can-canfd_rcv-replace-warn_once-by-pr_warn_once.patch new file mode 100644 index 00000000000..3facf8b9a40 --- /dev/null +++ b/queue-3.18/can-af_can-canfd_rcv-replace-warn_once-by-pr_warn_once.patch @@ -0,0 +1,49 @@ +From d4689846881d160a4d12a514e991a740bcb5d65a Mon Sep 17 00:00:00 2001 +From: Marc Kleine-Budde +Date: Tue, 16 Jan 2018 19:30:14 +0100 +Subject: can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once + +From: Marc Kleine-Budde + +commit d4689846881d160a4d12a514e991a740bcb5d65a upstream. + +If an invalid CANFD frame is received, from a driver or from a tun +interface, a Kernel warning is generated. + +This patch replaces the WARN_ONCE by a simple pr_warn_once, so that a +kernel, bootet with panic_on_warn, does not panic. A printk seems to be +more appropriate here. + +Reported-by: syzbot+e3b775f40babeff6e68b@syzkaller.appspotmail.com +Suggested-by: Dmitry Vyukov +Acked-by: Oliver Hartkopp +Cc: linux-stable +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Oliver Hartkopp +Signed-off-by: Greg Kroah-Hartman + +--- + net/can/af_can.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +--- a/net/can/af_can.c ++++ b/net/can/af_can.c +@@ -742,13 +742,12 @@ static int canfd_rcv(struct sk_buff *skb + if (unlikely(!net_eq(dev_net(dev), &init_net))) + goto drop; + +- if (WARN_ONCE(dev->type != ARPHRD_CAN || +- skb->len != CANFD_MTU || +- cfd->len > CANFD_MAX_DLEN, +- "PF_CAN: dropped non conform CAN FD skbuf: " +- "dev type %d, len %d, datalen %d\n", +- dev->type, skb->len, cfd->len)) ++ if (unlikely(dev->type != ARPHRD_CAN || skb->len != CANFD_MTU || ++ cfd->len > CANFD_MAX_DLEN)) { ++ pr_warn_once("PF_CAN: dropped non conform CAN FD skbuf: dev type %d, len %d, datalen %d\n", ++ dev->type, skb->len, cfd->len); + goto drop; ++ } + + can_receive(skb, dev); + return NET_RX_SUCCESS; diff --git a/queue-3.18/series b/queue-3.18/series index 019d75fcf6e..48c52305a07 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -19,3 +19,5 @@ arm64-kvm-fix-smccc-handling-of-unimplemented-smc-hvc-calls.patch mips-ar7-ensure-the-port-type-s-fcr-value-is-used.patch x86-asm-32-make-sync_core-handle-missing-cpuid-on-all-32-bit-kernels.patch usbip-fix-implicit-fallthrough-warning.patch +can-af_can-can_rcv-replace-warn_once-by-pr_warn_once.patch +can-af_can-canfd_rcv-replace-warn_once-by-pr_warn_once.patch