From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934812AbbKSXe0 (ORCPT ); Thu, 19 Nov 2015 18:34:26 -0500 Received: from a.ns.miles-group.at ([95.130.255.143]:11950 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934676AbbKSXeY (ORCPT ); Thu, 19 Nov 2015 18:34:24 -0500 Subject: Re: [RFC] Limiting linker scope To: "linux-kernel@vger.kernel.org" References: <564E5232.201@nod.at> Cc: Linux-Arch , octavian.purdila@intel.com From: Richard Weinberger Message-ID: <564E5C7C.7090407@nod.at> Date: Fri, 20 Nov 2015 00:34:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <564E5232.201@nod.at> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 19.11.2015 um 23:50 schrieb Richard Weinberger: > Hi! > > UML recently had an interesting bug[1] where the host side of UML > tried to call sigsuspend() but as the kernel itself offers a function > with the same name it called sigsuspend() on > the UML kernel side and funny things happened. > > The root cause of the problem is that the UML links userspace > code like glibc, libpcap, etc. to the kernel image and symbols can > clash. Especially if one side is a shared library it will not noticed > at compile time. > > As this is not the first bug of this kind I'm facing on UML I've > started to think how to deal with that. > > Is it somehow possible to limit the linker scope? > Such that we can force LD no not blindly link every symbols of > vmlinux into another object? Maybe using a white list? > I have do admit I've never used LD scripts nor GNU export maps, > maybe they can help. Currently I'm reading their docs and hope > to find a way to implement my idea. > > The problem is also not specific to UML, the emerging Linux Kernel > Library will suffer from the same issue. I take this back. LKL continues to impress me. It creates a new kernel object using objcopy -G and marks only some symbols as global. This approach could work for UML too. Thanks, //richard