Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3245865imc; Wed, 13 Mar 2019 12:36:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxoxaYIM0rU1neM5jHqfQJUb6q4iVTneaqcIYorBRnkUAvAljh8/mvCDo3YBxt7upCJvs7 X-Received: by 2002:a63:9752:: with SMTP id d18mr37374888pgo.0.1552505816780; Wed, 13 Mar 2019 12:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552505816; cv=none; d=google.com; s=arc-20160816; b=q5gy3PYSw7ck9vziGYGz2bDu7i4qbn66PrQThkJhL8t+GKr9Tu1bi0/hscLZyL6dIr Sb1AQW0gDY+XJGhfUKrvFvJ3pJxbPpwO0QrIPfDWOWtNlkhBazywW3+S33SQB7kxIDeD Vz8B/Sq9eIvxrb1xioGyxvVOEKnf1/aQEi4WhjnsvYAEa1kX6nhwlHkgxqzPOpZrDI+E DXI0luBNnIIH5th6gviUE37Qei2DlsXKGywBAZE90fewTmkD5VrFniyuKciNnP/fhzji iSYngFf8DreE+Nywc+OVngdsnG5xp4dlojZb1TmWvCsk6WuTI6XllpRkP4pxMjycBRDp Awvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bgTtust0M37VaKMzRKK/8//4Do2xxfwkZ3lCGxWDBOU=; b=LAgZz/SV86AP9QZIvqK9jN5F/qAH0jUkuyT2MQwvuJDW5+ND294fzER9qvByesO42v xHqqaeMjJBj2oIzZz0f1N07lEvDNIWB8MxKcsZTQ8U1ME3oJ7p5OW1DS3QZnupJJz3cH mWKQntD859VV3MQlaLGHZmpWj7hxD9tD5bDQLHZiZjmmej0lmNliuKkJXDHePet0OLkI nnnLWeS+3oD9hX70xPAh8B75GnWrGHPfevUQyFdUA9QsAOT2zM13oIU6jJ4pnyfgjci1 r/kLxkPh0scRCMgyRGpX9OOTs1XFPTP+JRd9HlUHqVPd9wahpG78lw7b0oWOKsdrlppc LLWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yoiApyh8; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11si11329426plo.400.2019.03.13.12.36.41; Wed, 13 Mar 2019 12:36:56 -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=@kernel.org header.s=default header.b=yoiApyh8; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfCMTKa (ORCPT + 99 others); Wed, 13 Mar 2019 15:10:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:41034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfCMTK2 (ORCPT ); Wed, 13 Mar 2019 15:10:28 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8ACD3213A2; Wed, 13 Mar 2019 19:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552504228; bh=l5DC/oAs6OVHZGFDZfsO/axiIOd/RiHixTgJLodp/m8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yoiApyh8BuKbbZZTmpCBFr7hRlvilRsmJTTQjwpV4RD6a8SJxy4AKLyVNdx8hUucv ys++SHpft9xjCorR66uQ3ntilicdkknrixq7k2Kmzbr/boVSMOgnJsGAj4HL8YgjYW jC+SpRm9bKSjdXeDqe73D8EwR+GeXqbhUUKiCrKs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Eugene Loh , Masahiro Yamada , Sasha Levin Subject: [PATCH AUTOSEL 4.20 02/60] kallsyms: Handle too long symbols in kallsyms.c Date: Wed, 13 Mar 2019 15:09:23 -0400 Message-Id: <20190313191021.158171-2-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190313191021.158171-1-sashal@kernel.org> References: <20190313191021.158171-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eugene Loh [ Upstream commit 6db2983cd8064808141ccefd75218f5b4345ffae ] When checking for symbols with excessively long names, account for null terminating character. Fixes: f3462aa952cf ("Kbuild: Handle longer symbols in kallsyms.c") Signed-off-by: Eugene Loh Acked-by: Ard Biesheuvel Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/kallsyms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 109a1af7e444..f9339da8605e 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -118,8 +118,8 @@ static int read_symbol(FILE *in, struct sym_entry *s) fprintf(stderr, "Read error or end of file.\n"); return -1; } - if (strlen(sym) > KSYM_NAME_LEN) { - fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n" + if (strlen(sym) >= KSYM_NAME_LEN) { + fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n" "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n", sym, strlen(sym), KSYM_NAME_LEN); return -1; -- 2.19.1