Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751234AbbDYUj4 (ORCPT ); Sat, 25 Apr 2015 16:39:56 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36269 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712AbbDYUjx (ORCPT ); Sat, 25 Apr 2015 16:39:53 -0400 Date: Sat, 25 Apr 2015 22:39:48 +0200 (CEST) From: Jiri Kosina To: Josh Poimboeuf cc: Seth Jennings , Vojtech Pavlik , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate In-Reply-To: <20150424214038.GA27123@treble.redhat.com> Message-ID: References: <20150424214038.GA27123@treble.redhat.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1013 Lines: 25 On Fri, 24 Apr 2015, Josh Poimboeuf wrote: > > #if defined(CONFIG_RANDOMIZE_BASE) > > - /* KASLR is enabled, disregard old_addr from user */ > > - func->old_addr = 0; > > + /* If KASLR has been enabled, adjust old_addr accordingly */ > > + if (kaslr_enabled()) > > + func->old_addr += klp_vmlinux_relocation_offset(); > > The old_addr field is optional, where a value of 0 means "lookup the > address in kallsyms". So its value should only be adjusted if old_addr > is already non-zero. Otherwise the zero value will be replaced with a > bad address and it will mistakenly call klp_verify_vmlinux_symbol() with > the bad address instead of klp_find_object_symbol(). Fair enough, good point, will take this into account in v3. Thanks, -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/