From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vibhav Pant Newsgroups: gmane.emacs.devel Subject: Re: feature/asan-gc-poisoning aa9ca2c1493 2/2: src/alloc.c: Fix incorrect pointer arithmetic. Date: Tue, 6 Dec 2022 01:31:30 +0530 Message-ID: References: <167017421615.20730.5839006885061308371@vcs2.savannah.gnu.org> <20221204171657.3636BC00B0F@vcs2.savannah.gnu.org> <87k036ps88.fsf@yahoo.com> <83r0xe80f4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23334"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 05 21:02:18 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2HfO-0005oE-Ht for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Dec 2022 21:02:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2Hev-0007Bf-Ev; Mon, 05 Dec 2022 15:01:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2Het-0007B8-Qw for emacs-devel@gnu.org; Mon, 05 Dec 2022 15:01:47 -0500 Original-Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2Hes-0006On-2A; Mon, 05 Dec 2022 15:01:47 -0500 Original-Received: by mail-qv1-xf31.google.com with SMTP id r15so8976584qvm.6; Mon, 05 Dec 2022 12:01:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yljOghAQ206VZnx9+BAI4rpoHGHNMfcM11+AYVOeTlg=; b=AqkRsP/2qZ46O9LzkJIBrux51cEEe5Q78K5gQSB/GgLFulGvTduZxFuN4jmD8IvwAP EP3pUJWDgG9GHz8QM0RUASUMjDswcM+/Q0Eg8nioy1zalUE2poDBJVy1ii16A8kDetJr r4EzRx+S+bVyF5Rhac2RvuvXEwWUIflE9hHVtD9kKIqyN8GYYjpsgjECODz5UABpst5V H1/2wJzGEliWBTECKZ9KCwB6zyii9tlylLbmAMeGAAnOBlJCNTiJqxJEeAqn35VkVEin ikXmvBdyihmmeG6D8rffCJ5cBSEM4UB3FVcKyO02lRgqtY9hoPkc+E/18GXV09Kbj8ae pVJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yljOghAQ206VZnx9+BAI4rpoHGHNMfcM11+AYVOeTlg=; b=n/i2199Z8rVH/fCsnjDkKD1LjDyF1krUtuS2cnoua4QA6o3x8vjqnJHTDtIQ3XlmG9 FCqiYOGZYIfIylYg9voxfLXPHg5vXWHydNUpLMWd8QUPVZQ+tQZ/zdFXUJAqE1ZZkoud 4WoLywqiZ4yzjyId5uzgGrjiRFrjLD1FEnW+oEZ+YrifW0SZE7hLS+v/QKX0/+yHG4rR cedIO3pIVlPJ+gM7KC1tTChXsIbqNBEhmrt13AY+YPGaddJcDB0DmBqKKz5mRxRqNLZl jJzVlMVQkpbJsyks2FYf3Pu4tPaOOx4G0+ITCQ/hr+5+fjlCU0U7GDKhkaXJqeNc12th uq1A== X-Gm-Message-State: ANoB5plVttR41RIUIMhqsA078aWAot3dnZRv5z5kZF1pDeERvtwHl5VQ ncZIklcyH6UQsKOqwCoaq2IHamX8NquXQ949h2rAKa9QjkY= X-Google-Smtp-Source: AA0mqf4XXfNbieh+FZTX9TlWpll4dod4A1zBiXBt6DcZFlryYFHjsc5kttFiUzkGQdI/UZ2SNcoIW07YEfVs00AQMqg= X-Received: by 2002:a05:6214:2e03:b0:4c6:e4d2:c6a with SMTP id mx3-20020a0562142e0300b004c6e4d20c6amr45287671qvb.103.1670270502666; Mon, 05 Dec 2022 12:01:42 -0800 (PST) In-Reply-To: <83r0xe80f4.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::f31; envelope-from=vibhavp@gmail.com; helo=mail-qv1-xf31.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300937 Archived-At: Yup, this shouldn't be needed for either branches. I had added the additional variable to aid readability with __asan_region_is_poisoned. Thanks, Vibhav On Mon, Dec 5, 2022 at 6:36 PM Eli Zaretskii wrote: > > > From: Po Lu > > Cc: Vibhav Pant > > Date: Mon, 05 Dec 2022 09:13:59 +0800 > > > > Vibhav Pant writes: > > > > > branch: feature/asan-gc-poisoning > > > commit aa9ca2c1493f1cd9d50698747fd054b1be53dc95 > > > Author: Vibhav Pant > > > Commit: Vibhav Pant > > > > > > src/alloc.c: Fix incorrect pointer arithmetic. > > > > > > * src/alloc.c (live_float_holding): Use parenthesis around the > > > pointer arithmetic expression to untag 'cp' correctly. > > > --- > > > src/alloc.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/src/alloc.c b/src/alloc.c > > > index 31108837e5a..6b8a4cdcc02 100644 > > > --- a/src/alloc.c > > > +++ b/src/alloc.c > > > @@ -5104,7 +5104,7 @@ live_float_holding (struct mem_node *m, void *p) > > > && (b != float_block > > > || offset / sizeof b->floats[0] < float_block_index)) > > > { > > > - struct Lisp_Float *f = (struct Lisp_Float *) cp - off; > > > + struct Lisp_Float *f = (struct Lisp_Float *) (cp - off); > > > #if GC_ASAN_POISON_OBJECTS > > > if (__asan_region_is_poisoned (f, sizeof (*f))) > > > return NULL; > > > > This is a problem on master and emacs-29 too, right? > > I don't think so: there are no such code on those two branches, AFAICT. -- Vibhav Pant vibhavp@gmail.com GPG: 7ED1 D48C 513C A024 BE3A 785F E3FB 28CB 6AB5 9598