From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970888AbdAENtO (ORCPT ); Thu, 5 Jan 2017 08:49:14 -0500 Received: from mx2.suse.de ([195.135.220.15]:43703 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970875AbdAENtG (ORCPT ); Thu, 5 Jan 2017 08:49:06 -0500 Date: Thu, 5 Jan 2017 14:49:03 +0100 From: Michal Hocko To: Richard Weinberger Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, vbabka@suse.cz, kirill.shutemov@linux.intel.com, jmarchan@redhat.com, gerald.schaefer@de.ibm.com, hannes@cmpxchg.org, luto@kernel.org Subject: Re: [PATCH] proc: Fix integer overflow of VmLib Message-ID: <20170105134903.GS21618@dhcp22.suse.cz> References: <20170104232918.25598-1-richard@nod.at> <20170105105329.GK21618@dhcp22.suse.cz> <20170105114949.GM21618@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 05-01-17 14:20:22, Richard Weinberger wrote: > Michal, > > Am 05.01.2017 um 12:49 schrieb Michal Hocko: > >> I thought 0 is the better choice since it will not lead to wrong results > >> when userspace tools compute the sum of values reported by /proc//status. > > > > Dunno. If somebody translates 0 to statically linked library then it > > could be wrong. > > Checking VmLib for 0 is not the correct way to detect a statically linked > program. If you just read the documentation: VmLib size of shared library code then 0 might suggest there are no shared libraries used and the code is statically linked > Unless I misread the code, VmLib will honour any PROT_EXEC mapping. > So, a statically linked JIT will have VmLib > 0. yes the code behaves differently and that's why I've said that the reported number is not correct no matter how. Anyway, as I've said I do not see any solution without risk of regression while the current code is clearly wrong. If the general consensus is that 0 is better than explicitly documenting VmLib as the size of executable code and report it that way then I have no objections and won't stay in the way. I am not sure which poison is worse. -- Michal Hocko SUSE Labs