From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95497 invoked by alias); 22 Aug 2018 16:06:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 95483 invoked by uid 89); 22 Aug 2018 16:06:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy=randomized X-HELO: sessmg22.ericsson.net Received: from sessmg22.ericsson.net (HELO sessmg22.ericsson.net) (193.180.251.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Aug 2018 16:06:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1534953973; h=From:Sender:Reply-To:Subject:Date:Message-Id:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Lq51ODNWsaGDB5tky0M32UuAd1zshjpK5m+RMz/rmXk=; b=JTvjyz4O60BRqrhDLILNj14cwZYnZHaM1ngDhRPBqwnH6WMBYSGTTOYa3VrC22xD cvnoj339yY8S6GROFsS8doOsbOstaeVTYe0pXAKA2hYqDzXP+ewe8/RlYrYAVI2W IuqwMvKXZTpl1Cy6xG4p10FiNYDnsji3W/P2GwAPQ/s=; Received: from ESESSMB502.ericsson.se (Unknown_Domain [153.88.183.120]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id F9.1F.26635.5F98D7B5; Wed, 22 Aug 2018 18:06:13 +0200 (CEST) Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 22 Aug 2018 18:06:13 +0200 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB505.ericsson.se (153.88.183.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Wed, 22 Aug 2018 18:06:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iY5zmqM4HuXIH0mLomBakdJ9fTlmwWVTac0QgECzy6s=; b=OpYCtFPL19/8ejmrl6EvnZSnZWoPhEkYDl9brUsT451d7rEYr3+tyaX5s2G85pXhV0YEKfjX2+Imz4wpkAR+Rzi7p0lotbPaBkryu7LceQ/vD8BcCHxmCb0JT13ZRkOybBtbqnfbXWDbWOHNh3HuKCXNk0iKdRyGIcZWQ4iTh3k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from elxacz23q12.lan (192.222.164.54) by DM6PR15MB2394.namprd15.prod.outlook.com (2603:10b6:5:8d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.21; Wed, 22 Aug 2018 16:06:10 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] Restore behavior of disabling address randomization by default on GDBserver Date: Wed, 22 Aug 2018 16:06:00 -0000 Message-Id: <1534953958-13064-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: simon.marchi@ericsson.com Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00537.txt.bz2 Commit c12a508 ("Add client_state struct.") inadvertently changed the default behavior of GDBserver wrt address randomization. The old disable_randomization global variable was initialized to 1, whereas the corresponding field in the client_state structure is initialized to 0. This fixes make check TESTS="gdb.base/jit-simple.exp" RUNTESTFLAGS="--target_board=native-gdbserver" make check TESTS="gdb.base/execl-update-breakpoints.exp" RUNTESTFLAGS="--target_board=native-gdbserver" Note that the execl-update-breakpoints.exp would only fail on systems where the toolchain emits position-independent executables by default (otherwise the main executable position is never randomized, so the value of disable_randomization didn't matter). gdb/gdbserver/ChangeLog: PR gdb/23374 PR gdb/23375 * server.h (struct client_state) : Initialize to 1. diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 8e197ee..5e41e2f 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -176,7 +176,7 @@ struct client_state /* Whether we should attempt to disable the operating system's address space randomization feature before starting an inferior. */ - int disable_randomization = 0; + int disable_randomization = 1; int pass_signals[GDB_SIGNAL_LAST]; int program_signals[GDB_SIGNAL_LAST]; --- gdb/gdbserver/server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 8e197ee..5e41e2f 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -176,7 +176,7 @@ struct client_state /* Whether we should attempt to disable the operating system's address space randomization feature before starting an inferior. */ - int disable_randomization = 0; + int disable_randomization = 1; int pass_signals[GDB_SIGNAL_LAST]; int program_signals[GDB_SIGNAL_LAST]; -- 2.7.4