From patchwork Fri Oct 16 09:07:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3C07C433DF for ; Fri, 16 Oct 2020 09:09:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E19321556 for ; Fri, 16 Oct 2020 09:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839375; bh=9/KavjPpjCjgC9Xo1z5AQ+wvlPqVxMJADq7ikWKfOQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=exOoaen8daaSOxVSKiCRL96Yg/lV17v1q06OHybXEIB81Jo1kvhiCI+f9lfIa+dk1 DAA/3fKx1H+BFyPK3KvRvqMm7zJ9euHj4Hcj/+nYoY2QgMr4TX4HkbUmgkQK79kvxA nqBhGELsGA4XnSS/fgUOy5T83TSzdh97hXc1GBIw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405559AbgJPJJe (ORCPT ); Fri, 16 Oct 2020 05:09:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:37410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395008AbgJPJJR (ORCPT ); Fri, 16 Oct 2020 05:09:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 29D0F22201; Fri, 16 Oct 2020 09:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839350; bh=9/KavjPpjCjgC9Xo1z5AQ+wvlPqVxMJADq7ikWKfOQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rz0aA2tE8z/bPfZy4TDinc9HVA6qopVtf9E6rcUu45xDsAwIEIIrmJoq/hsL9xaMw RtzZdMq4b0b5eLiEEIPaOhID08O+cSJfQ54ov/vTno6X1dHC37LngdTwPmhvjx/icq uIJ06OHkbXmBsKKDLh2bsl6K4QA2yCxAuycriKJk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Nick Desaulniers , Russell King , Sasha Levin Subject: [PATCH 4.19 02/21] ARM: 8858/1: vdso: use $(LD) instead of $(CC) to link VDSO Date: Fri, 16 Oct 2020 11:07:21 +0200 Message-Id: <20201016090437.421644062@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada [ Upstream commit fe00e50b2db8c60e4ec90befad1f5bab8ca2c800 ] We use $(LD) to link vmlinux, modules, decompressors, etc. VDSO is the only exceptional case where $(CC) is used as the linker driver, but I do not know why we need to do so. VDSO uses a special linker script, and does not link standard libraries at all. I changed the Makefile to use $(LD) rather than $(CC). I confirmed the same vdso.so.raw was still produced. Users will be able to use their favorite linker (e.g. lld instead of of bfd) by passing LD= from the command line. My plan is to rewrite all VDSO Makefiles to use $(LD), then delete cc-ldoption. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/vdso/Makefile | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile index f4efff9d3afbb..fadf554d93917 100644 --- a/arch/arm/vdso/Makefile +++ b/arch/arm/vdso/Makefile @@ -10,12 +10,12 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) ccflags-y := -fPIC -fno-common -fno-builtin -fno-stack-protector ccflags-y += -DDISABLE_BRANCH_PROFILING -VDSO_LDFLAGS := -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 -VDSO_LDFLAGS += -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 -VDSO_LDFLAGS += -nostdlib -shared -VDSO_LDFLAGS += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) -VDSO_LDFLAGS += $(call cc-ldoption, -Wl$(comma)--build-id) -VDSO_LDFLAGS += $(call cc-ldoption, -fuse-ld=bfd) +ldflags-y = -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ + -z max-page-size=4096 -z common-page-size=4096 \ + -nostdlib -shared \ + $(call ld-option, --hash-style=sysv) \ + $(call ld-option, --build-id) \ + -T obj-$(CONFIG_VDSO) += vdso.o extra-$(CONFIG_VDSO) += vdso.lds @@ -37,8 +37,8 @@ KCOV_INSTRUMENT := n $(obj)/vdso.o : $(obj)/vdso.so # Link rule for the .so file -$(obj)/vdso.so.raw: $(src)/vdso.lds $(obj-vdso) FORCE - $(call if_changed,vdsold) +$(obj)/vdso.so.raw: $(obj)/vdso.lds $(obj-vdso) FORCE + $(call if_changed,ld) $(obj)/vdso.so.dbg: $(obj)/vdso.so.raw $(obj)/vdsomunge FORCE $(call if_changed,vdsomunge) @@ -48,11 +48,6 @@ $(obj)/%.so: OBJCOPYFLAGS := -S $(obj)/%.so: $(obj)/%.so.dbg FORCE $(call if_changed,objcopy) -# Actual build commands -quiet_cmd_vdsold = VDSO $@ - cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \ - -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@ - quiet_cmd_vdsomunge = MUNGE $@ cmd_vdsomunge = $(objtree)/$(obj)/vdsomunge $< $@ From patchwork Fri Oct 16 09:07:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 317805 Delivered-To: patch@linaro.org Received: by 2002:a92:d603:0:0:0:0:0 with SMTP id w3csp1254922ilm; Fri, 16 Oct 2020 02:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO7T49uPQ1QiwoPdNohOed+p+wh+PKe923LD5dz51rw/bKyyMiMkWmq/E92PITIBxujeiP X-Received: by 2002:a50:d4dc:: with SMTP id e28mr2802571edj.137.1602839377500; Fri, 16 Oct 2020 02:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602839377; cv=none; d=google.com; s=arc-20160816; b=OKVso0b9q2xOOhIEfeqKmPN8iCCrrUH7pUxYVn9S8m5owZ6GQPFdfr7UdKSnOAwuNs AuUUcwTorLKxBu5zY/Yg1rVtOPc9sXNrA/hKySL7AFQyfeuZp+SHBgTnMuz989gFpGz4 w3LCxna723dDsTkdMRzhm3XuWE7FYIvYxZIoY+c6JVFVWk0uHoETJjnE/FQtnSwZljbX w962Ar88iFbsICvkCNGJk7h4K25wMnEeYu0lUTnxtA8nm0OpLSU5gL3d4SdUc4SeB5zd mr+IOstL1qKKD3FoNxhWqX1u0Gys0v8zT6QMYa1dwjsNCDRA0nQS+i3cvT/21I9KamDl PEJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ok56HGr5/lKgKCxrjUOcnn3oOcYaw5p8WAxVBbjX72E=; b=nsbBnioL+Wrykr7oGBVC2X3CUKGpT7jNgIQ8HX8mKMSpWO9qktNSNsjP8xwEDWM5tS qYPuhsYSkGItIFWJ+Wj7BYPfiMOwRScF/0R6jqFPp2vPUmUdQb1oFzeyiF8+1XlJCFvH odWQ0vuIKV7do8vgkMzCZQw5mDfZsxWGLazbGcCh5LYgBInPjtW5L0B3RMxaFJNiPjwW 8hOuOobLHMygzsqdaML/pTURqUjOzotarNPZN172jQy0ZV2+jyqKIEaj1xnYHFL9J3d2 Zt01o4SUhZvZGhLsOMkPpJGvPyEXMrxmPeNZJ9I9/ltzWL7E9K08yIPwXf1B0eUOJJqg 4yNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EPA0U57Z; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si1236056edq.532.2020.10.16.02.09.37; Fri, 16 Oct 2020 02:09:37 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EPA0U57Z; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405565AbgJPJJf (ORCPT + 15 others); Fri, 16 Oct 2020 05:09:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:37980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395007AbgJPJJR (ORCPT ); Fri, 16 Oct 2020 05:09:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B96AA21556; Fri, 16 Oct 2020 09:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839356; bh=+e/uitgR3t1bG0EJ3BLVPobcveEUtzgsLVdE9SoF+5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EPA0U57ZMENhdRorNhgHX5EpSiy5HHkIHj3rFQqo9YW2TGz+aoWSLWkaq/3OYIpMU LIeDo+I1mZJ1oqUqosOfaOg9P6hL3w4942dTJQBXJwIVH7vw5Fla9SjBJi+nA6Tnit 7IvFZ/gMe05diCI18baV5FsnzXiReRaSOG6gZ+MQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" , Masahiro Yamada , Arnd Bergmann , Ard Biesheuvel , Russell King , Sasha Levin Subject: [PATCH 4.19 04/21] ARM: 8867/1: vdso: pass --be8 to linker if necessary Date: Fri, 16 Oct 2020 11:07:23 +0200 Message-Id: <20201016090437.519246900@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jason A. Donenfeld [ Upstream commit c5d0e49e8d8f1a23034fdf8e935afc0c8f7ae27d ] The commit fe00e50b2db8 ("ARM: 8858/1: vdso: use $(LD) instead of $(CC) to link VDSO") removed the passing of CFLAGS, since ld doesn't take those directly. However, prior, big-endian ARM was relying on gcc to translate its -mbe8 option into ld's --be8 option. Lacking this, ld generated be32 code, making the VDSO generate SIGILL when called by userspace. This commit passes --be8 if CONFIG_CPU_ENDIAN_BE8 is enabled. Signed-off-by: Jason A. Donenfeld Cc: Masahiro Yamada Cc: Arnd Bergmann Cc: Ard Biesheuvel Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/vdso/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile index fadf554d93917..1f5ec9741e6d4 100644 --- a/arch/arm/vdso/Makefile +++ b/arch/arm/vdso/Makefile @@ -10,9 +10,10 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) ccflags-y := -fPIC -fno-common -fno-builtin -fno-stack-protector ccflags-y += -DDISABLE_BRANCH_PROFILING -ldflags-y = -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ +ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8 +ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ -z max-page-size=4096 -z common-page-size=4096 \ - -nostdlib -shared \ + -nostdlib -shared $(ldflags-y) \ $(call ld-option, --hash-style=sysv) \ $(call ld-option, --build-id) \ -T From patchwork Fri Oct 16 09:07:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC525C43457 for ; Fri, 16 Oct 2020 09:09:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 526D820878 for ; Fri, 16 Oct 2020 09:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839367; bh=vOdKTAWst7QDZJoO5L0YX6rbYMZ22uuei9AycgASwPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GH2loz+WQ9UtEzm3ssYzTo7m4uf/hwwg3XcQDhYhf6qypaiMH0dvVlte4TOeBVPIB 7IkkrbfCJOLe/NG1eqXS1qV3Lh1JIa9nX+302aDGD/5K7eZZjpTqB7WqNjpRr29T2I Y8SGnsGuzrG52LyxwL0EAKpVZKctoPf4EMK1qJ7Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405022AbgJPJJ0 (ORCPT ); Fri, 16 Oct 2020 05:09:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:38034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394765AbgJPJJW (ORCPT ); Fri, 16 Oct 2020 05:09:22 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D874020FC3; Fri, 16 Oct 2020 09:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839361; bh=vOdKTAWst7QDZJoO5L0YX6rbYMZ22uuei9AycgASwPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D+fQ/28BYpAjHbE7SSO8cwOH97HfwCEinhpObiHTpenC+kiGzkHdYBSHhiqzlpAcH 2rW39zQydF0UhI4rMepwgMqKECeg+skZ40VpWQeByf+GeGLZARaNJ0DHflowwixZMZ H9IKRZVQAUX+isXV6j4fvRgInsXq091ofhevEUWo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luiz Augusto von Dentz , Marcel Holtmann Subject: [PATCH 4.19 06/21] Bluetooth: L2CAP: Fix calling sk_filter on non-socket based channel Date: Fri, 16 Oct 2020 11:07:25 +0200 Message-Id: <20201016090437.617583992@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Luiz Augusto von Dentz commit f19425641cb2572a33cb074d5e30283720bd4d22 upstream. Only sockets will have the chan->data set to an actual sk, channels like A2MP would have its own data which would likely cause a crash when calling sk_filter, in order to fix this a new callback has been introduced so channels can implement their own filtering if necessary. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- include/net/bluetooth/l2cap.h | 2 ++ net/bluetooth/l2cap_core.c | 7 ++++--- net/bluetooth/l2cap_sock.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h @@ -619,6 +619,8 @@ struct l2cap_ops { struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, unsigned long hdr_len, unsigned long len, int nb); + int (*filter) (struct l2cap_chan * chan, + struct sk_buff *skb); }; struct l2cap_conn { --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -6683,9 +6683,10 @@ static int l2cap_data_rcv(struct l2cap_c goto drop; } - if ((chan->mode == L2CAP_MODE_ERTM || - chan->mode == L2CAP_MODE_STREAMING) && sk_filter(chan->data, skb)) - goto drop; + if (chan->ops->filter) { + if (chan->ops->filter(chan, skb)) + goto drop; + } if (!control->sframe) { int err; --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -1476,6 +1476,19 @@ static void l2cap_sock_suspend_cb(struct sk->sk_state_change(sk); } +static int l2cap_sock_filter(struct l2cap_chan *chan, struct sk_buff *skb) +{ + struct sock *sk = chan->data; + + switch (chan->mode) { + case L2CAP_MODE_ERTM: + case L2CAP_MODE_STREAMING: + return sk_filter(sk, skb); + } + + return 0; +} + static const struct l2cap_ops l2cap_chan_ops = { .name = "L2CAP Socket Interface", .new_connection = l2cap_sock_new_connection_cb, @@ -1490,6 +1503,7 @@ static const struct l2cap_ops l2cap_chan .set_shutdown = l2cap_sock_set_shutdown_cb, .get_sndtimeo = l2cap_sock_get_sndtimeo_cb, .alloc_skb = l2cap_sock_alloc_skb_cb, + .filter = l2cap_sock_filter, }; static void l2cap_sock_destruct(struct sock *sk) From patchwork Fri Oct 16 09:07:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290270 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83B13C43467 for ; Fri, 16 Oct 2020 09:15:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34BF720872 for ; Fri, 16 Oct 2020 09:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839727; bh=60IszBw0AHzpThHVxQE6yYPaMEkQ7WNMgWk/4ICWN3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=h+FcafAxgntRlQtZolkIfs0lxMqtCdQ6QuEXZ/mD0smtRUCS1w7QCxYQ+uYF7Wmco 9gkwJA17f+hs0s+6eSdOyhhlbAtq4HphfxLPWNF1ReF2O4oWjb4KUuoEBdBWsoTsGN nynBEmoNo5iL766AbTmB/++RVHkFvTP6QvN6wlOM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405568AbgJPJPO (ORCPT ); Fri, 16 Oct 2020 05:15:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:38146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405087AbgJPJJ1 (ORCPT ); Fri, 16 Oct 2020 05:09:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCABC20848; Fri, 16 Oct 2020 09:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839366; bh=60IszBw0AHzpThHVxQE6yYPaMEkQ7WNMgWk/4ICWN3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pTwfXxzo/5pdrQgD5fb3R3SxSXRuWJQZl0b85Q97TXZJ0SrdLxnOwzrfaeXuoG2iZ Vn/qcg5S63YRl8/gW4fyWy9kdjjB3IUHSyGSy/qk6ceXRMsR5ubuAqUFkqahw3vTvG gHLduIPmu9Kq+si3ykwqPZ6Q+g0AzBhb85wq/Jk0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luiz Augusto von Dentz , Marcel Holtmann , Hans-Christian Noren Egtvedt Subject: [PATCH 4.19 08/21] Bluetooth: Consolidate encryption handling in hci_encrypt_cfm Date: Fri, 16 Oct 2020 11:07:27 +0200 Message-Id: <20201016090437.716750153@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Luiz Augusto von Dentz commit 3ca44c16b0dcc764b641ee4ac226909f5c421aa3 upstream. This makes hci_encrypt_cfm calls hci_connect_cfm in case the connection state is BT_CONFIG so callers don't have to check the state. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Cc: Hans-Christian Noren Egtvedt Signed-off-by: Greg Kroah-Hartman --- include/net/bluetooth/hci_core.h | 20 ++++++++++++++++++-- net/bluetooth/hci_event.c | 28 +++------------------------- 2 files changed, 21 insertions(+), 27 deletions(-) --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1287,10 +1287,26 @@ static inline void hci_auth_cfm(struct h conn->security_cfm_cb(conn, status); } -static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, - __u8 encrypt) +static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status) { struct hci_cb *cb; + __u8 encrypt; + + if (conn->state == BT_CONFIG) { + if (status) + conn->state = BT_CONNECTED; + + hci_connect_cfm(conn, status); + hci_conn_drop(conn); + return; + } + + if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags)) + encrypt = 0x00; + else if (test_bit(HCI_CONN_AES_CCM, &conn->flags)) + encrypt = 0x02; + else + encrypt = 0x01; if (conn->sec_level == BT_SECURITY_SDP) conn->sec_level = BT_SECURITY_LOW; --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2756,7 +2756,7 @@ static void hci_auth_complete_evt(struct &cp); } else { clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); - hci_encrypt_cfm(conn, ev->status, 0x00); + hci_encrypt_cfm(conn, ev->status); } } @@ -2841,22 +2841,7 @@ static void read_enc_key_size_complete(s conn->enc_key_size = rp->key_size; } - if (conn->state == BT_CONFIG) { - conn->state = BT_CONNECTED; - hci_connect_cfm(conn, 0); - hci_conn_drop(conn); - } else { - u8 encrypt; - - if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags)) - encrypt = 0x00; - else if (test_bit(HCI_CONN_AES_CCM, &conn->flags)) - encrypt = 0x02; - else - encrypt = 0x01; - - hci_encrypt_cfm(conn, 0, encrypt); - } + hci_encrypt_cfm(conn, 0); unlock: hci_dev_unlock(hdev); @@ -2955,14 +2940,7 @@ static void hci_encrypt_change_evt(struc } notify: - if (conn->state == BT_CONFIG) { - if (!ev->status) - conn->state = BT_CONNECTED; - - hci_connect_cfm(conn, ev->status); - hci_conn_drop(conn); - } else - hci_encrypt_cfm(conn, ev->status, ev->encrypt); + hci_encrypt_cfm(conn, ev->status); unlock: hci_dev_unlock(hdev); From patchwork Fri Oct 16 09:07:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BE11C43457 for ; Fri, 16 Oct 2020 09:15:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1023820872 for ; Fri, 16 Oct 2020 09:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839715; bh=XURXdGmSy2e6Hda4uB8yy5Bdorf+pQC92dCzziKAdgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=nJdF2bf2CheNHgtXX5qP6Ozg+zpW0TG3o1+WCSTRIxUnAFkCee8QhiCQDE5xVLnk7 dr3dvl8PoJQQJFv+1UX+dPHMDFYcczAKUhsyM1RPA3GQ67I7hHfD0vydJ/GXlPuxXK QPyLZhtPgiSu18n+lUDEmm6EoNRhyr18sVHFB4+Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394787AbgJPJPO (ORCPT ); Fri, 16 Oct 2020 05:15:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:38226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405528AbgJPJJ3 (ORCPT ); Fri, 16 Oct 2020 05:09:29 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3CF9B20789; Fri, 16 Oct 2020 09:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839368; bh=XURXdGmSy2e6Hda4uB8yy5Bdorf+pQC92dCzziKAdgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZfiZICduKpL1qi8xmHv8z1gqWVMW64dp37THeRZVoMlPQGWHipWclUxDCFQEmHRog fCxbzczlnKj9/U7uMTUC1ToLK6ZI1Wx2KAYzwOd3Ws39O9TNzhgIbpHDv8rL5b/KgW 9USOLLBWvpXaHI6v7GZn3rzbd+NaMzssaxN6k56Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Patrick Steinhardt , Luiz Augusto von Dentz , Marcel Holtmann Subject: [PATCH 4.19 09/21] Bluetooth: Fix update of connection state in `hci_encrypt_cfm` Date: Fri, 16 Oct 2020 11:07:28 +0200 Message-Id: <20201016090437.768160833@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Patrick Steinhardt commit 339ddaa626995bc6218972ca241471f3717cc5f4 upstream. Starting with the upgrade to v5.8-rc3, I've noticed I wasn't able to connect to my Bluetooth headset properly anymore. While connecting to the device would eventually succeed, bluetoothd seemed to be confused about the current connection state where the state was flapping hence and forth. Bisecting this issue led to commit 3ca44c16b0dc (Bluetooth: Consolidate encryption handling in hci_encrypt_cfm, 2020-05-19), which refactored `hci_encrypt_cfm` to also handle updating the connection state. The commit in question changed the code to call `hci_connect_cfm` inside `hci_encrypt_cfm` and to change the connection state. But with the conversion, we now only update the connection state if a status was set already. In fact, the reverse should be true: the status should be updated if no status is yet set. So let's fix the isuse by reversing the condition. Fixes: 3ca44c16b0dc ("Bluetooth: Consolidate encryption handling in hci_encrypt_cfm") Signed-off-by: Patrick Steinhardt Acked-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- include/net/bluetooth/hci_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1293,7 +1293,7 @@ static inline void hci_encrypt_cfm(struc __u8 encrypt; if (conn->state == BT_CONFIG) { - if (status) + if (!status) conn->state = BT_CONNECTED; hci_connect_cfm(conn, status); From patchwork Fri Oct 16 09:07:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57C5FC433DF for ; Fri, 16 Oct 2020 09:09:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03EA8214DB for ; Fri, 16 Oct 2020 09:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839380; bh=QZ+pHhxhZuRDFdgUcUatcunZsyI/WsCB1Z6Dc1FeeKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=P9oEHvvhAQSP9gs9J6vyaWFweG7eLD0pmZXXq8XMHfH3TQLzJzS6IRI3h89gOnwV4 /d92crTurssf2q5ZLzNj21bAGWjoKHKJQ0GEU46+MlZp+1BEdGlRC9OJVvxOMPMxfJ oA5Nnq456Zpl9BX4Cayu/cKzoeFSeHxF/xyUJhEM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405574AbgJPJJg (ORCPT ); Fri, 16 Oct 2020 05:09:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:37958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394998AbgJPJJQ (ORCPT ); Fri, 16 Oct 2020 05:09:16 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C561121D40; Fri, 16 Oct 2020 09:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839343; bh=QZ+pHhxhZuRDFdgUcUatcunZsyI/WsCB1Z6Dc1FeeKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=khBS1RA1WgYG+GTKojJPGlP08gnoQF4ZvuiILucWzjW8Krs5pzoTSi7WYGXEw0Cpw N5g9qIRX+SCaJtt0iYknBV6PtVoiILHQYx2GMCBXTZ4igFTQ0LM9M7WXK0tmNweo51 GBdPxGRllhSz+UFyW0wAw717nm+5IPfOjH4iKnw4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luiz Augusto von Dentz , Marcel Holtmann , Hans-Christian Noren Egtvedt Subject: [PATCH 4.19 10/21] Bluetooth: Disconnect if E0 is used for Level 4 Date: Fri, 16 Oct 2020 11:07:29 +0200 Message-Id: <20201016090437.814753346@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Luiz Augusto von Dentz commit 8746f135bb01872ff412d408ea1aa9ebd328c1f5 upstream. E0 is not allowed with Level 4: BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C page 1319: '128-bit equivalent strength for link and encryption keys required using FIPS approved algorithms (E0 not allowed, SAFER+ not allowed, and P-192 not allowed; encryption key not shortened' SC enabled: > HCI Event: Read Remote Extended Features (0x23) plen 13 Status: Success (0x00) Handle: 256 Page: 1/2 Features: 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x00 Secure Simple Pairing (Host Support) LE Supported (Host) Secure Connections (Host Support) > HCI Event: Encryption Change (0x08) plen 4 Status: Success (0x00) Handle: 256 Encryption: Enabled with AES-CCM (0x02) SC disabled: > HCI Event: Read Remote Extended Features (0x23) plen 13 Status: Success (0x00) Handle: 256 Page: 1/2 Features: 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 Secure Simple Pairing (Host Support) LE Supported (Host) > HCI Event: Encryption Change (0x08) plen 4 Status: Success (0x00) Handle: 256 Encryption: Enabled with E0 (0x01) [May 8 20:23] Bluetooth: hci0: Invalid security: expect AES but E0 was used < HCI Command: Disconnect (0x01|0x0006) plen 3 Handle: 256 Reason: Authentication Failure (0x05) Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Cc: Hans-Christian Noren Egtvedt Signed-off-by: Greg Kroah-Hartman --- include/net/bluetooth/hci_core.h | 10 ++++++---- net/bluetooth/hci_conn.c | 17 +++++++++++++++++ net/bluetooth/hci_event.c | 20 ++++++++------------ 3 files changed, 31 insertions(+), 16 deletions(-) --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1308,11 +1308,13 @@ static inline void hci_encrypt_cfm(struc else encrypt = 0x01; - if (conn->sec_level == BT_SECURITY_SDP) - conn->sec_level = BT_SECURITY_LOW; + if (!status) { + if (conn->sec_level == BT_SECURITY_SDP) + conn->sec_level = BT_SECURITY_LOW; - if (conn->pending_sec_level > conn->sec_level) - conn->sec_level = conn->pending_sec_level; + if (conn->pending_sec_level > conn->sec_level) + conn->sec_level = conn->pending_sec_level; + } mutex_lock(&hci_cb_list_lock); list_for_each_entry(cb, &hci_cb_list, list) { --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -1282,6 +1282,23 @@ int hci_conn_check_link_mode(struct hci_ return 0; } + /* AES encryption is required for Level 4: + * + * BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C + * page 1319: + * + * 128-bit equivalent strength for link and encryption keys + * required using FIPS approved algorithms (E0 not allowed, + * SAFER+ not allowed, and P-192 not allowed; encryption key + * not shortened) + */ + if (conn->sec_level == BT_SECURITY_FIPS && + !test_bit(HCI_CONN_AES_CCM, &conn->flags)) { + bt_dev_err(conn->hdev, + "Invalid security: Missing AES-CCM usage"); + return 0; + } + if (hci_conn_ssp_enabled(conn) && !test_bit(HCI_CONN_ENCRYPT, &conn->flags)) return 0; --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2890,26 +2890,22 @@ static void hci_encrypt_change_evt(struc clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); + /* Check link security requirements are met */ + if (!hci_conn_check_link_mode(conn)) + ev->status = HCI_ERROR_AUTH_FAILURE; + if (ev->status && conn->state == BT_CONNECTED) { if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING) set_bit(HCI_CONN_AUTH_FAILURE, &conn->flags); + /* Notify upper layers so they can cleanup before + * disconnecting. + */ + hci_encrypt_cfm(conn, ev->status); hci_disconnect(conn, HCI_ERROR_AUTH_FAILURE); hci_conn_drop(conn); goto unlock; } - - /* In Secure Connections Only mode, do not allow any connections - * that are not encrypted with AES-CCM using a P-256 authenticated - * combination key. - */ - if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && - (!test_bit(HCI_CONN_AES_CCM, &conn->flags) || - conn->key_type != HCI_LK_AUTH_COMBINATION_P256)) { - hci_connect_cfm(conn, HCI_ERROR_AUTH_FAILURE); - hci_conn_drop(conn); - goto unlock; - } /* Try reading the encryption key size for encrypted ACL links */ if (!ev->status && ev->encrypt && conn->type == ACL_LINK) { From patchwork Fri Oct 16 09:07:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62DCCC433DF for ; Fri, 16 Oct 2020 09:15:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08C7F2145D for ; Fri, 16 Oct 2020 09:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839705; bh=/UysN2AnYmczg2KD5D8HsfKr2UsfaKckj+vtchLRbi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JFc3YAvRgUOkM585k4MPvxrcOgh1KpyNY7HXQmcOgY1mXlQs5ZPjTKj3ZgG2QXxVC mDrtDY9Zih2zhpyzH7p50ZjaQl1xBGfBZenSMbYs2bqgKjlVYTwySdSHAswtwTK79O tkDPl3Q2z/xV8GQJ8vS7+W3JusiuCCEvjXG8Uj0U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405566AbgJPJJf (ORCPT ); Fri, 16 Oct 2020 05:09:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:37408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395004AbgJPJJR (ORCPT ); Fri, 16 Oct 2020 05:09:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B20A4221EB; Fri, 16 Oct 2020 09:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839348; bh=/UysN2AnYmczg2KD5D8HsfKr2UsfaKckj+vtchLRbi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p9zAFzKdQ2e9cfrTCiBfK55gm7+eBWqoID4nMbolIpfntK6m7WFtaExK4V9SvJTDg iOEr6gQtl0Fepjz2t7BAECUAF6LYWxQX9ih8KXXVIinCQj+zRB/yI8BdzHdZEyZ7GP D2dsQjHKG1dzrV8NLLs2/erRsjQf8BqtuhwD5jw8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wilken Gottwalt , Johan Hovold Subject: [PATCH 4.19 12/21] USB: serial: option: add Cellient MPL200 card Date: Fri, 16 Oct 2020 11:07:31 +0200 Message-Id: <20201016090437.904942128@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wilken Gottwalt commit 3e765cab8abe7f84cb80d4a7a973fc97d5742647 upstream. Add usb ids of the Cellient MPL200 card. Signed-off-by: Wilken Gottwalt Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/3db5418fe9e516f4b290736c5a199c9796025e3c.1601715478.git.wilken.gottwalt@mailbox.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -528,6 +528,7 @@ static void option_instat_callback(struc /* Cellient products */ #define CELLIENT_VENDOR_ID 0x2692 #define CELLIENT_PRODUCT_MEN200 0x9005 +#define CELLIENT_PRODUCT_MPL200 0x9025 /* Hyundai Petatel Inc. products */ #define PETATEL_VENDOR_ID 0x1ff4 @@ -1982,6 +1983,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) }, { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) }, { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, + { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200), + .driver_info = RSVD(1) | RSVD(4) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) }, { USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */ From patchwork Fri Oct 16 09:07:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF949C433DF for ; Fri, 16 Oct 2020 09:09:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4662E20872 for ; Fri, 16 Oct 2020 09:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839398; bh=mDsTZngoKU1DWpBnYJSvmbvvyuC+RL4EPG+7t4lNKZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OhkYkaV3bj09qtAzWSM7DyuVSzJncn0TFQYMPg+lsNs4/Ezx3ZU58TVHbaNP6FavY DvU5gCv1fZnt4UMJ6hyUDov+2OoRH+nvKBtqc1JwpC4VAUp6OXEaTZCiC6wz5Frz3W 3VMAtQ2UwF9J4VmsoYZODHDtxJTfJibAX5dkpHr4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405602AbgJPJJ5 (ORCPT ); Fri, 16 Oct 2020 05:09:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394672AbgJPJJy (ORCPT ); Fri, 16 Oct 2020 05:09:54 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8092220789; Fri, 16 Oct 2020 09:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839394; bh=mDsTZngoKU1DWpBnYJSvmbvvyuC+RL4EPG+7t4lNKZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E0CLvbvOyz6n+hzSyJTS3bMtCHLQ/cSxAmU/qaSuU4YKD5rapXuqgx7li/dPaIjhd SaImhNDSyENY7yv7+D97CrdosU8dOOP+8pGuf0ioNT6PqjL8dnJFU+8Hbau+k9aNbh 51+foGiA6xDGzMUHGxph57AHF7GOuJzLGjcRXnm4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leonid Bloch , Johan Hovold Subject: [PATCH 4.19 13/21] USB: serial: option: Add Telit FT980-KS composition Date: Fri, 16 Oct 2020 11:07:32 +0200 Message-Id: <20201016090437.954354981@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Leonid Bloch commit 924a9213358fb92fa3c3225d6d042aa058167405 upstream. This commit adds the following Telit FT980-KS composition: 0x1054: rndis, diag, adb, nmea, modem, modem, aux AT commands can be sent to /dev/ttyUSB2. Signed-off-by: Leonid Bloch Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/ce86bc05-f4e2-b199-0cdc-792715e3f275@asocscloud.com Link: https://lore.kernel.org/r/20201004155813.2342-1-lb.workbox@gmail.com Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1187,6 +1187,8 @@ static const struct usb_device_id option .driver_info = NCTRL(2) | RSVD(3) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1053, 0xff), /* Telit FN980 (ECM) */ .driver_info = NCTRL(0) | RSVD(1) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */ + .driver_info = NCTRL(2) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM), From patchwork Fri Oct 16 09:07:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 665EFC43457 for ; Fri, 16 Oct 2020 09:15:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AACF20EDD for ; Fri, 16 Oct 2020 09:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839713; bh=4PMp+jC2Cua2QgUNI4boZbV9Y0Y/jP3yD0u9iJv70Zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QBFoumS/Rr0vbqxGz0efvPHWHcbOpBbcE09sM7wlaxd1/4pJ66DgO2uO8G4TUOeWg DpjQwuZ2bDIwpIAB5NA3mG8+Us0fkA4a2v366TB+3kO1Hlhjpt3LyLmHNbqmN4ZpbF VsbhzN7eVCgSmScM6wGbWzqTuyeCS8hS0tHs6IfA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406119AbgJPJPE (ORCPT ); Fri, 16 Oct 2020 05:15:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:38336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405211AbgJPJJe (ORCPT ); Fri, 16 Oct 2020 05:09:34 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E43120878; Fri, 16 Oct 2020 09:09:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839373; bh=4PMp+jC2Cua2QgUNI4boZbV9Y0Y/jP3yD0u9iJv70Zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D54KlsDuZoHQ6YjZwd7qBFtPjFR69h8YXgBjkKjUcnlcePOpG47kX3GuA56anxp10 xRRSMYGsxqP1uLICJWEQJKddzzoZL+t8LDBT1goKB27kItq+3HLWXZ39VQmqMPqQTR TWlYckkR8nPSPV59HkjHfyNA/Uo4a08HRYjylAwg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+009f546aa1370056b1c2@syzkaller.appspotmail.com, Anant Thazhemadam Subject: [PATCH 4.19 14/21] staging: comedi: check validity of wMaxPacketSize of usb endpoints found Date: Fri, 16 Oct 2020 11:07:33 +0200 Message-Id: <20201016090437.987989197@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Anant Thazhemadam commit e1f13c879a7c21bd207dc6242455e8e3a1e88b40 upstream. While finding usb endpoints in vmk80xx_find_usb_endpoints(), check if wMaxPacketSize = 0 for the endpoints found. Some devices have isochronous endpoints that have wMaxPacketSize = 0 (as required by the USB-2 spec). However, since this doesn't apply here, wMaxPacketSize = 0 can be considered to be invalid. Reported-by: syzbot+009f546aa1370056b1c2@syzkaller.appspotmail.com Tested-by: syzbot+009f546aa1370056b1c2@syzkaller.appspotmail.com Signed-off-by: Anant Thazhemadam Cc: stable Link: https://lore.kernel.org/r/20201010082933.5417-1-anant.thazhemadam@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/vmk80xx.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/staging/comedi/drivers/vmk80xx.c +++ b/drivers/staging/comedi/drivers/vmk80xx.c @@ -667,6 +667,9 @@ static int vmk80xx_find_usb_endpoints(st if (!devpriv->ep_rx || !devpriv->ep_tx) return -ENODEV; + if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx)) + return -EINVAL; + return 0; } From patchwork Fri Oct 16 09:07:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C336C43467 for ; Fri, 16 Oct 2020 09:14:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B10FD20872 for ; Fri, 16 Oct 2020 09:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839684; bh=nJQ3OJhP3nQvj0m1UlC0a5K7IIXWDVG71TTpX6f38ZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bpAgYIawbf+Iwp2g7NwIUjrouiaeLO86Ky+sqJFKhGc00ZSANl7WuMO81fl8XwTcj SlsKnRr261XIm9gC4U3Y98aLzdYpqyKZh2y/nOWGMu5B9b6X9SyL4P4ntzUNPr2aEV y868DGOfC0Y/rF0uwhc4gqDjPAdD7pWxsaLAxqAA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394941AbgJPJOn (ORCPT ); Fri, 16 Oct 2020 05:14:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:38838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394657AbgJPJJx (ORCPT ); Fri, 16 Oct 2020 05:09:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 841772145D; Fri, 16 Oct 2020 09:09:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839381; bh=nJQ3OJhP3nQvj0m1UlC0a5K7IIXWDVG71TTpX6f38ZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qd1ssZ/uYLCiWpVtH/nE5gCJqe04CSci2XSQdTT0TCn6HpwI1Hc/Uep+3d2iPqSvU 1vE2i9fYF619ARvTUf3jnLaeVdZknC+64S7d+6HjCCpPMJ018AcLOaBeTdQBnIuZ7N FKId8rPjlry2ZRNx5iUSxi/Etv7IH208+QesQ3p8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+d94d02749498bb7bab4b@syzkaller.appspotmail.com, Jan Kara Subject: [PATCH 4.19 17/21] reiserfs: Initialize inode keys properly Date: Fri, 16 Oct 2020 11:07:36 +0200 Message-Id: <20201016090438.140079234@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.301376476@linuxfoundation.org> References: <20201016090437.301376476@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jan Kara commit 4443390e08d34d5771ab444f601cf71b3c9634a4 upstream. reiserfs_read_locked_inode() didn't initialize key length properly. Use _make_cpu_key() macro for key initialization so that all key member are properly initialized. CC: stable@vger.kernel.org Reported-by: syzbot+d94d02749498bb7bab4b@syzkaller.appspotmail.com Signed-off-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- fs/reiserfs/inode.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -1553,11 +1553,7 @@ void reiserfs_read_locked_inode(struct i * set version 1, version 2 could be used too, because stat data * key is the same in both versions */ - key.version = KEY_FORMAT_3_5; - key.on_disk_key.k_dir_id = dirino; - key.on_disk_key.k_objectid = inode->i_ino; - key.on_disk_key.k_offset = 0; - key.on_disk_key.k_type = 0; + _make_cpu_key(&key, KEY_FORMAT_3_5, dirino, inode->i_ino, 0, 0, 3); /* look for the object's stat data */ retval = search_item(inode->i_sb, &key, &path_to_sd);