Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp799998imm; Wed, 20 Jun 2018 06:52:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKSQV7DjWq1dgdK1bW8B3ms6DIGdZsSHTE1YU0Fd846Flv5r5932V0Ag6NsQeIs6LvAGfgG X-Received: by 2002:a63:985:: with SMTP id 127-v6mr2322818pgj.52.1529502771847; Wed, 20 Jun 2018 06:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529502771; cv=none; d=google.com; s=arc-20160816; b=alh/5e1jDoebZABNAIjnBNLSy+2FCNb8IoKgfwji4T2g+Fc+GoqgQbNQAvrhCpu3CL Q0aP+c4tptXlfZ0Lk37g+K/ANgT4xJCYwgbeb1vXq7WFDCGXJhd5qfRb2jbLVJ6dXdMw biTlgN7Of69vOy4cqbrgjDnzxFsUixpKHCOXBlOTGaJJ8otcCauG7IlaSrd4Uk9HL5so W88V6UnWuKVzxnTCavP5j+b3uhXdiLzcLIVxFmkfOiHbuz3uqMhSfBb4diXIsC2tgRUr evdyktSlOEkBkfbdUxl7T7EqbOVr3001w8+DnGQ9tTOpQUlCeXPNIZD0//M3IGZtxYHf C80g== 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 :arc-authentication-results; bh=2PtIo7144Mu3pIvqNSQ2928zXAF957c3fj/aWzQ2n68=; b=DBSj8C6vJBmYoyWgSoaT6EJQz18N3m7NMbZE962jcsruDJxr8ZTb72xyMNIOwS+AlX wfXqmxAvAvSPPXgGznBBu2qBKCVPZH1TxTzO1KyC3x2OBNjn66plnFpIMgTSuG2CUJVQ 12+TWbjgwbDGiKIKKi8RG5a9MYYHvixeHySKPf/tCqTTMXjOB8qi9JalQ6Z5VUG06MgJ nHl4z/jj5cti7p1w4LY++67stg+tmKRfPQ52cBM0rDvEBd25d+crHv+G0ckPKqpRMcGc nuo0WAkXmHYsFHJDqw0NmN8D5EuWNq6f9vty5sQs1WDjOLC82CbwopaG6l/AFEyucD7K Obyg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a186-v6si2074029pgc.453.2018.06.20.06.52.37; Wed, 20 Jun 2018 06:52:51 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753644AbeFTNwB (ORCPT + 99 others); Wed, 20 Jun 2018 09:52:01 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36572 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752798AbeFTNwA (ORCPT ); Wed, 20 Jun 2018 09:52:00 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5KDnPLX086889 for ; Wed, 20 Jun 2018 09:51:59 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jqp7tdygr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Jun 2018 09:51:59 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Jun 2018 14:51:56 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 20 Jun 2018 14:51:53 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5KDppcE34996362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 Jun 2018 13:51:51 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD63552049; Wed, 20 Jun 2018 13:41:08 +0100 (BST) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.226]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 7BBF852041; Wed, 20 Jun 2018 13:41:08 +0100 (BST) From: Claudio Imbrenda To: stefanha@redhat.com Cc: davem@davemloft.net, jhansen@vmware.com, cavery@redhat.com, borntraeger@de.ibm.com, fiuczy@linux.ibm.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems Date: Wed, 20 Jun 2018 15:51:51 +0200 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18062013-4275-0000-0000-0000028FE566 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062013-4276-0000-0000-000037972E8B Message-Id: <1529502711-8028-1-git-send-email-imbrenda@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-20_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=556 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806200157 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dst_cid and src_cid are 64 bits, therefore 64 bit accessors should be used, and in fact in virtio_transport_common.c only 64 bit accessors are used. Using 32 bit accessors for 64 bit values breaks big endian systems. This patch fixes a wrong use of le32_to_cpu in virtio_transport_send_pkt. Fixes: b9116823189e85ccf384 ("VSOCK: add loopback to virtio_transport") Signed-off-by: Claudio Imbrenda --- net/vmw_vsock/virtio_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 8e03bd3..5d3cce9 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -201,7 +201,7 @@ virtio_transport_send_pkt(struct virtio_vsock_pkt *pkt) return -ENODEV; } - if (le32_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid) + if (le64_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid) return virtio_transport_send_pkt_loopback(vsock, pkt); if (pkt->reply) -- 2.7.4