Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp445883imu; Tue, 27 Nov 2018 00:53:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/UFCYArcnP9Xgc4MRs4VYvENq6nlnkcAt4dnKhe0FpvNr1YwLInj6/hLsppfoWdUCLv1IgN X-Received: by 2002:a63:5207:: with SMTP id g7mr28698241pgb.253.1543308787541; Tue, 27 Nov 2018 00:53:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543308787; cv=none; d=google.com; s=arc-20160816; b=k4TowFT78BMQyfwCbLCnLlYTcZbkTs0WMGRfnmtYB2pPZ1Kkluy4wbQU6ifhOy4JkR 7+StHcFzHqBXJ12Q4xLoi1ZTWTtR/Vi8+g+yCLbvEJQ2Bj8K3608/D5W/WUhBIVcDhtH Qz293htChES71aBJAOn+18ol/66CB65GvHMqQOd1x032W6StiF592mlSuVv9luswPbj7 pfrfrBNcp5QhOa/JaHx1ok/48024HTgERh4YqPdRlc5RADeTtEDHIyL5zH/Hl5ERjcoR QLYrKCckzlD3o2dleaCTBj/657Vh1+2/enY8M+fqWp8oGB2j9K241IwA27Z6kPVD+e+a Bhyg== 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; bh=kgKIpUCHr/eII0L3UYy4qUefWV3ryGOoYhEBW57AjZM=; b=SqxkMHJdXaWimB0TLuelKMQCpjcOK83D2AmWUMsEbpoOeByQnxFXDESfnpb6CBPX73 GOGyZttEVMBTgq6iwfBFb+PzKYsLSqU9S2IMaEl1e7zqfIL4jeic/Js9ZRmWNMZnSbx6 SxSQ/3xsgVYGEQTfD1GnKhESzP3M68DpewlP0JlPiER3IYnk8WENeirBXeyqf3B1sidA uHZxNehedfNqmMB2lvnLcMcIDr8lSD3se3k0BhidnG9voNDT5FRy7NnwpGwatsZflDRK CtlXyXLdcGHOxYsQyT+oUiUfBaL9NfzqpWIbUBR8/+Vcgat29AnNevJ18Nn1eX5/1I26 nKhA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si2795624pgk.46.2018.11.27.00.52.52; Tue, 27 Nov 2018 00:53:07 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729804AbeK0TsF (ORCPT + 99 others); Tue, 27 Nov 2018 14:48:05 -0500 Received: from ms.tdt.de ([195.243.126.94]:57600 "EHLO mail.dev.tdt.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729259AbeK0TsF (ORCPT ); Tue, 27 Nov 2018 14:48:05 -0500 Received: from localhost.localdomain (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 635D9206FE; Tue, 27 Nov 2018 08:50:52 +0000 (UTC) From: Martin Schiller To: andrew.hendry@gmail.com, davem@davemloft.net Cc: stephen@networkplumber.org, joe@perches.com, anto.cardace@gmail.com, linux-x25@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Schiller Subject: [PATCH 1/3] net/x25: fix called/calling length calculation in x25_parse_address_block Date: Tue, 27 Nov 2018 09:50:27 +0100 Message-Id: <20181127085029.9589-1-ms@dev.tdt.de> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The length of the called and calling address was not calculated correctly (BCD encoding). Signed-off-by: Martin Schiller --- net/x25/af_x25.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index d49aa79b7997..5226a7f43050 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -100,7 +100,7 @@ int x25_parse_address_block(struct sk_buff *skb, } len = *skb->data; - needed = 1 + (len >> 4) + (len & 0x0f); + needed = 1 + ((len >> 4) + (len & 0x0f) + 1) / 2; if (!pskb_may_pull(skb, needed)) { /* packet is too short to hold the addresses it claims -- 2.11.0