From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1431851AbdDYQgW convert rfc822-to-8bit (ORCPT ); Tue, 25 Apr 2017 12:36:22 -0400 Received: from smtp-out6.electric.net ([192.162.217.182]:53885 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S980734AbdDYQgF (ORCPT ); Tue, 25 Apr 2017 12:36:05 -0400 From: David Laight To: "'Naveen N. Rao'" , Michael Ellerman CC: Masami Hiramatsu , Paul Clarke , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" Subject: RE: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases Thread-Topic: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases Thread-Index: AQHSvd/BgAlC4pS7UUeKABIJr5kHn6HWRT6Q Date: Tue, 25 Apr 2017 16:36:00 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFDB161@AcuExch.aculab.com> References: <20170425161822.18764-1-naveen.n.rao@linux.vnet.ibm.com> In-Reply-To: <20170425161822.18764-1-naveen.n.rao@linux.vnet.ibm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Naveen N. Rao > Sent: 25 April 2017 17:18 > 1. Fail early for invalid/zero length symbols. > 2. Detect names of the form and skip checking for kernel > symbols in that case. > > Signed-off-by: Naveen N. Rao > --- > Masami, Michael, > I have added two very simple checks here, which I felt is good to have, > rather than the elaborate checks in the previous version. Given the > change in module code to use strnchr(), the checks are now safe and > further tests are not probably not that useful. ... > + if (strnchr(name, MODULE_NAME_LEN, ':')) > + return module_kallsyms_lookup_name(name); Should that be MODULE_NAME_LEN - 1 ? David