From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36418 invoked by alias); 8 Sep 2018 22:25:04 -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 32290 invoked by uid 89); 8 Sep 2018 22:24:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.2 spammy= 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; Sat, 08 Sep 2018 22:24:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1536445485; 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=Qv/ZdD1mx3x//WDJcCNZTJ5mL+Tk7XMTGxeZXf46b5s=; b=Gga0CIMO9/gThumm+W8/tG3Hep6zPjOGThZNgrq+A7bEP+RjZvkH6pZJBgA0VB2f xZu9HTFuu7eqm768RZFSOvyIDEIJLo9lzo+BDK+1+TCEpx+zonqE0jIXATU/pmkQ 2S+8bzXN+ugkBboHZdUr43z5U/gLSD6fgGZSBRa7T2c=; Received: from ESESSMB505.ericsson.se (Unknown_Domain [153.88.183.123]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 3F.7A.31332.D2C449B5; Sun, 9 Sep 2018 00:24:45 +0200 (CEST) Received: from ESESSMB502.ericsson.se (153.88.183.163) by ESESSMB505.ericsson.se (153.88.183.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Sun, 9 Sep 2018 00:24:45 +0200 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (153.88.183.157) 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 via Frontend Transport; Sun, 9 Sep 2018 00:24:44 +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=Z9nJBQVkV4QtA9KdPyrRb0IcxbqpzFtD1u/NjOG38cs=; b=WljUJQjUW2smputdi1oIU2sooYZYVgXAW/EjDo8EO4s2TzECHvy7A5k2WtS85XyS7RQYO4aD+AC5qOXBex7i9CC18Kl1NlKRqbAUSXciee4cdWCgZ8/IViJnnZhKcYij0Q09QRSR8NhRz+Vpeq5bhpyeKJ2hfFMJJscCllxs5ZM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [100.94.32.129] (192.176.1.81) by BYAPR15MB2391.namprd15.prod.outlook.com (2603:10b6:a02:8c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Sat, 8 Sep 2018 22:24:41 +0000 Subject: Re: [PATCH 1/5] Use KF_PATH to verify the size of a struct kinfo_file. To: John Baldwin , References: <20180908003659.37482-1-jhb@FreeBSD.org> <20180908003659.37482-2-jhb@FreeBSD.org> From: Simon Marchi Message-ID: Date: Sat, 08 Sep 2018 22:25:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180908003659.37482-2-jhb@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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-09/txt/msg00209.txt.bz2 On 2018-09-08 01:36 AM, John Baldwin wrote: > fbsd_core_vnode_path needs to use the offset of the kf_path member of > struct kinfo_file as the minimum size of a struct kinfo_file object. > However, it was using KVE_PATH instead due to a copy and paste bug. > > gdb/ChangeLog: > > * fbsd-tdep.c (fbsd_core_vnode_path): Use KF_PATH instead of > KVE_PATH. > --- > gdb/ChangeLog | 5 +++++ > gdb/fbsd-tdep.c | 4 ++-- > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index e6f44a3ac2..d32b390778 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,8 @@ > +2018-09-07 John Baldwin > + > + * fbsd-tdep.c (fbsd_core_vnode_path): Use KF_PATH instead of > + KVE_PATH. > + > 2018-09-06 Simon Ser > > PR gdb/23105 > diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c > index ed43087169..9e6d7276c4 100644 > --- a/gdb/fbsd-tdep.c > +++ b/gdb/fbsd-tdep.c > @@ -781,12 +781,12 @@ fbsd_core_vnode_path (struct gdbarch *gdbarch, int fd) > /* Skip over the structure size. */ > descdata += 4; > > - while (descdata + KVE_PATH < descend) > + while (descdata + KF_PATH < descend) > { > ULONGEST structsize; > > structsize = bfd_get_32 (core_bfd, descdata + KF_STRUCTSIZE); > - if (structsize < KVE_PATH) > + if (structsize < KF_PATH) > error (_("malformed core note - vmmap entry too small")); > > if (bfd_get_32 (core_bfd, descdata + KF_TYPE) == KINFO_FILE_TYPE_VNODE > LGTM. Simon