From patchwork Mon May 20 23:51:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 164667 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp899310ili; Mon, 20 May 2019 16:52:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZJOkoamCov5c3NJbg3Nbq7n6bsE5PpsMmqnnh+WyXO9olIUk6tCJ8903+4URY9V8Q7Shj X-Received: by 2002:a63:1354:: with SMTP id 20mr76938933pgt.356.1558396322063; Mon, 20 May 2019 16:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558396322; cv=none; d=google.com; s=arc-20160816; b=CcbzMEtuvx5HmtQN2Hlo5otdUB8LGpZbfhUnf7meRkSvgLlJ0xjgSL+3RcdGZyJ9oA 43jdEacDfhfUZbhXHODShK92CyB76SgPTwfe4vzV3f3/SWlNJo3pHD7jZor3sjUhXPD2 PufMthgOqDFSPo6Hnv1hrH72Xu11Wh+mqi0iqmFqNQQJONzoCMzVgcJz83DFAbb708oL Gxjao3xtnbMPb2m46XGTY798DrwkfYK1LLkfuF5jDVOM1XTI/xL+BwUOLcZ+9pm7mhMT irqzydCvKV8rNl/aiwdQn/aiJ3+pR6HCLdW2JNbFWxCPRCDuJHsPGzjnVY0psrXAPtmt 5sPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Rv32jzUGZV8rgVBuTpLJ3zSmM0FZYIuyjg2yFIdNHLI=; b=RaOYti+ldcSSdAQ/OzmQXWefNSSXOgJQ9sphzle+I6lJF+LWrbGWIxsSZ7kfhmCaf1 Lcqqg3FtWYQz+ax7PE9q7mJZXq/vlrL13zqX+D9Ag/WtTph1I8jHDjfRJORuJlX1oOnY XeyF9J+vo3zALB4o61zM5r97pmvNvgn7pP/RrSayuFQkaWjEjVkiiaxONvK2l2ZLypW1 nI5xU+5jGIHJunDS0DU4E/wpeWNTZQsA0tvEoQBIcKo2R5+I6ZhtuzaCJz0Bc3OA0hKn 3maxVvSLOqr3TQGkdpziDJckKVDtubFpU0+DLymBLOqMW0H6nnPvXxPrPcwOOG/mMopO h2EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oSiuXpFi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h125si20629622pfb.176.2019.05.20.16.52.01; Mon, 20 May 2019 16:52:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oSiuXpFi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727587AbfETXwB (ORCPT + 30 others); Mon, 20 May 2019 19:52:01 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41569 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727411AbfETXwA (ORCPT ); Mon, 20 May 2019 19:52:00 -0400 Received: by mail-pg1-f194.google.com with SMTP id z3so7542559pgp.8 for ; Mon, 20 May 2019 16:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Rv32jzUGZV8rgVBuTpLJ3zSmM0FZYIuyjg2yFIdNHLI=; b=oSiuXpFilMvpyrsw1o2mAFYvPVX3B/Rh0EEHojcpJXOLf6UVF6y49QsRk9m2Wycwv4 44kpdHm8apnauXUKYNBHt9HxsNDZMfa642EyJ314C2eMXP00V49RkWBtL2vB8/D3UhOM a1hg1A6P0KdYxdmEmdsOq0hN1kXrFzmc9tY0huvpBbO8JDmryqTIy40/+a90dc9T3YuS Yn8PgBTcuj0dIDHpb4qFGk+g5oiBO5111ygZk6vbp/fsaqJTSYK4eF4sZWY45a+ZUq5H AMYNhblRTarnJddVVuDNAM214dsDWE38WJNejnSYWCCWMbt3/fbMfb7DgNfL838wKNKf fanA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Rv32jzUGZV8rgVBuTpLJ3zSmM0FZYIuyjg2yFIdNHLI=; b=AsGuUNARAkQ+Jw0qp0ktm1MFAqvL7tAk1IbRWO5n7mExihE7SXT+ag4v5n8pearVpm AlyRR3ohwVeqAHi83HdaRp88ZsKT5O0sc3FfPD0rBiW+/H7/eHmTRC1gJeSjF2ZfxqhA 3tcXsPXL11wkQsJhHmYxMviJkao1gSKgJONdmnDEuNZmu8xsj5xX5f0Jcs9tRTsmtcfb eRK70Na21iYC2Pwnsw+CLUcl168ERm/BP9Ic6zUfqZPK+Y8PvbdxgMcwo/QgWQjunqPe SOM1oY7tfqPrACxPXk8hHFIXBJGe4KqcwgZR4yEUQdL8kI3MQk++mbooauUhBhTp3iOt mn3w== X-Gm-Message-State: APjAAAXRUg5D3mEy1rOAq7Gyc2YLL4jRBzOcHZkXohsTqAg41e5p3BAk bKpR5Z3lTtYN5cT3huXbzH1ZDw== X-Received: by 2002:a63:2d0:: with SMTP id 199mr21113194pgc.188.1558396319858; Mon, 20 May 2019 16:51:59 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id c16sm20286865pfd.99.2019.05.20.16.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 16:51:59 -0700 (PDT) From: Bjorn Andersson To: "David S. Miller" Cc: Arun Kumar Neelakantam , Nicholas Mc Guire , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] net: qrtr: Fix message type of outgoing packets Date: Mon, 20 May 2019 16:51:56 -0700 Message-Id: <20190520235156.28902-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org QRTR packets has a message type in the header, which is repeated in the control header. For control packets we therefor copy the type from beginning of the outgoing payload and use that as message type. For non-control messages an endianness fix introduced in v5.2-rc1 caused the type to be 0, rather than QRTR_TYPE_DATA, causing all messages to be dropped by the receiver. Fix this by converting and using qrtr_type, which will remain QRTR_TYPE_DATA for non-control messages. Fixes: 8f5e24514cbd ("net: qrtr: use protocol endiannes variable") Signed-off-by: Bjorn Andersson --- net/qrtr/qrtr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.18.0 diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 801872a2e7aa..05fa058bee59 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -733,8 +733,8 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) struct sock *sk = sock->sk; struct qrtr_node *node; struct sk_buff *skb; - u32 type = 0; size_t plen; + u32 type; int rc; if (msg->msg_flags & ~(MSG_DONTWAIT)) @@ -809,9 +809,9 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) /* control messages already require the type as 'command' */ skb_copy_bits(skb, 0, &qrtr_type, 4); - type = le32_to_cpu(qrtr_type); } + type = le32_to_cpu(qrtr_type); rc = enqueue_fn(node, skb, type, &ipc->us, addr); if (rc >= 0) rc = len;