Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6458989imu; Wed, 14 Nov 2018 01:39:45 -0800 (PST) X-Google-Smtp-Source: AJdET5epJ8SKXvT1A447OvcT2/sUw1g0e77QcJXqHU89Kad0f/yuwTXOyi0TBNfuLDEjdDAr8ISn X-Received: by 2002:a65:594b:: with SMTP id g11-v6mr1020372pgu.229.1542188385213; Wed, 14 Nov 2018 01:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542188385; cv=none; d=google.com; s=arc-20160816; b=LsVSe+AYXcpJ+8gGJz2TI8qk8+6PBg3HNit70CvkMPICV4wemnk8Ombq2tAWhyRhxy yvlNZ+LGhd6YvvmbVdComgTa/OFe1/AhbPI4UEaeOzt36kxzT3DbP0ZZAwOwoNtQ/HC2 mKhvdhd/rfdmabT5/FbIJeuATbyAOQnl5VFlOSFb/lYQRVRvY02cLzB+KMVEBNBJae7t 26n8vX4posWFMRAqvMJqR2a7JlORxdVBtdDdTAfxEUZt/jufcFT8M/da3lnBlZ1zsHK2 R6vdfdNydB05rBvps7oo3pWLYAfLW0QE+HHa1Tf3LZ4aDg6m/WsxFQyVBrKpJY6edTf8 lj2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WQDFYA0iJSTJno5K6ZX85HskaMH6XQPhipdHJaVbp1E=; b=0fFMhx6p88mehdu2+YbiiKHHTiaiyOyMpLbzoDsIFbWKOshd0dYy0YLixpgVVe0HmC WP8u9/8KCxJH5Sg2emlHGWjdhwMy1/HqzC1cqVOrYui7KVWYSmvGXCcPGTIFPRTimhDG s/HS3vjAxUuv5ggSnD3/dOBuU+yMQzgtWbJ8uftY7f6iLcXHdtJFfMpQiHoGoTekLQNs cxzW5ALYEyss5mXUD38yfdE9t+Yilf7rqC4MvbHWZodtct+nDDZkvsNT5HdOTiKlIR2W M2paVxxCShxO6Er4PYqRAb47ExRwbEISzsO9AvRwGKvkJLFJOL6/LQqqRjnZzfOaDWGX LACg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 129-v6si24346784pfe.87.2018.11.14.01.39.29; Wed, 14 Nov 2018 01:39:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732506AbeKNTkw (ORCPT + 99 others); Wed, 14 Nov 2018 14:40:52 -0500 Received: from mga06.intel.com ([134.134.136.31]:22214 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727558AbeKNTkv (ORCPT ); Wed, 14 Nov 2018 14:40:51 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2018 01:38:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,231,1539673200"; d="scan'208";a="100131111" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga003.jf.intel.com with ESMTP; 14 Nov 2018 01:38:20 -0800 Received: from andy by smile with local (Exim 4.91) (envelope-from ) id 1gMrcp-0006up-El; Wed, 14 Nov 2018 11:38:19 +0200 Date: Wed, 14 Nov 2018 11:38:19 +0200 From: Andy Shevchenko To: Petr Mladek Cc: Steven Rostedt , Qian Cai , linux-kernel@vger.kernel.org, "Tobin C. Harding" , Geert Uytterhoeven , Rasmus Villemoes Subject: Re: WARNING: CPU: 26 PID: 64391 at lib/vsprintf.c:2193 set_precision+0x84/0x90 Message-ID: <20181114093819.GL10650@smile.fi.intel.com> References: <1542128132.12945.19.camel@gmx.us> <20181113172920.GI10650@smile.fi.intel.com> <1542135498.12945.20.camel@gmx.us> <20181113142317.379dbaf7@vmware.local.home> <20181113230511.5di75uyht7ecdcvl@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181113230511.5di75uyht7ecdcvl@pathway.suse.cz> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 14, 2018 at 12:05:12AM +0100, Petr Mladek wrote: > On Tue 2018-11-13 14:23:17, Steven Rostedt wrote: > > On Tue, 13 Nov 2018 13:58:18 -0500 > > Qian Cai wrote: > > > > > > Care to print the len and name parameters before this line? > > > len = 60612; name = > > > > How big are pages on arm64? Because we shouldn't get to this path if > > the string is bigger than PAGE_SIZE. But I know that on PPC64, > > PAGE_SIZE can be 64K, and 60612 is less than that. Thus, if we get > > there, the test is against signed int:16 (16 bit signed integer) that > > can go up to most 32768. If the string size is bigger than that, you > > would get this error. > > > > I would just say to ignore it. > > I tend to agree. > > > The only thing that can happen if > > someone does this is to trigger the warning. Unless if it is considered > > a form of DOS, where userspace just bombards the console by triggering > > this waring. > > We are actually on the safe side because it is WARN_ONCE(). > > > But I don't see a problem with the actual design. There's > > no reason we should be processing string variables bigger than 32768 in > > vsprintf. > > It is not even needed in this case. The string is limited also by > MODULE_NAME_LEN. At least not in this code. Are you proposing to replace strlen(name) with strnlen(name, MODULE_NAME_LEN)? -- With Best Regards, Andy Shevchenko