From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SKkNH3FVJ2QOnQAASxT56A (envelope-from ) for ; Fri, 31 Mar 2023 23:49:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KD79HnFVJ2RCpwAAauVa8A (envelope-from ) for ; Fri, 31 Mar 2023 23:49:37 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3280733142 for ; Fri, 31 Mar 2023 23:49:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piMcO-0006Dy-2t; Fri, 31 Mar 2023 17:49:08 -0400 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 1piMcM-0006CN-8V for guix-patches@gnu.org; Fri, 31 Mar 2023 17:49:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piMcM-0001XI-10 for guix-patches@gnu.org; Fri, 31 Mar 2023 17:49:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1piMcL-0001tf-U6 for guix-patches@gnu.org; Fri, 31 Mar 2023 17:49:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62467] [PATCH gnome-team v2 09/12] gnu: gtk+-2: Fix build by hardening list store. References: <716b57a44002b5d866aff0d2abe0190c90a39556.camel@gmail.com> In-Reply-To: <716b57a44002b5d866aff0d2abe0190c90a39556.camel@gmail.com> Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 31 Mar 2023 21:49:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62467 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62467@debbugs.gnu.org Cc: rg@raghavgururajan.name, Maxim Cournoyer Received: via spool by 62467-submit@debbugs.gnu.org id=B62467.16802993407197 (code B ref 62467); Fri, 31 Mar 2023 21:49:05 +0000 Received: (at 62467) by debbugs.gnu.org; 31 Mar 2023 21:49:00 +0000 Received: from localhost ([127.0.0.1]:34747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piMcG-0001rv-8C for submit@debbugs.gnu.org; Fri, 31 Mar 2023 17:49:00 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piMbu-0001pT-Ak for 62467@debbugs.gnu.org; Fri, 31 Mar 2023 17:48:38 -0400 Received: by mail-ed1-f68.google.com with SMTP id h8so95044627ede.8 for <62467@debbugs.gnu.org>; Fri, 31 Mar 2023 14:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680299313; h=mime-version:message-id:cc:to:subject:date:from:from:to:cc:subject :date:message-id:reply-to; bh=aPYJYw1MMPu4yVOKLcLUBGTGZkkfeSyaHWpyUQB+z1A=; b=osaFGSpdp8s9eejl6P/s6fvU8Xm6oiHr+BtW7969z3YoLqp5NlCX/WYj62vz4B00By 6rNYLUELPKnYtFDFbHxhSEKP2z2rNdmzCQbHbfPg4eYUQWlO3Eq5moqvCPTI0E5+d7rI Tk2aY16Lw8AVkD+dw3r95/Eokg0rWd65swaPHYRDJscbsqi1KAzn+7akvnl6s149kRSC st8095HSWvIIBVJdIZSC5q0RvIzqCzHcMqpfan/q3ZSd74bRs/FhPMQ9Hy1mGzlZNSFT ta6IxKbEsGcQBReskixjpO/+kktxBYYtMxXMXakNfbgOkriuduNlFvsh0GYS5qg0fXiS bJMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680299313; h=mime-version:message-id:cc:to:subject:date:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aPYJYw1MMPu4yVOKLcLUBGTGZkkfeSyaHWpyUQB+z1A=; b=KSxGc9FAbfZoC8NGemX+orjqjxnOpWXwzXucGuU/AdlfMuMkxIFcBM6ZZjVzAr5lic blcGWfz+aDqzib4NJ9FOzxi+fc/PdYCMoxZvAMWWx6bShRbEhmhBB3TQ3C0+Jx0jFNwp aabGi6PLVJHlcb18g7Ev+00whKzkX6BUnYNqHoVK787HV4XG8TI4+H94Ke+7GuZ/Kw5l uvkZ46QzmvsOS9tefne35ot2Mw7KV0eQIoAgRkcaskyXU6Rp73u3t2ZjV960wNWT6p7x 6PRBiYjHx08gg2iKMX5Y4t2qIEqBuVrdDutXwEwoMoUQk0s60PAzWsPPefXDLJKcgsfq DSew== X-Gm-Message-State: AAQBX9emHkqrD7dK4NiwOI+w77xVw/O1WG7QdXngFR59DIAavGLqA1vR xC46yoVleP28LGcVFBRc6ubOGd1e3rdtDA== X-Google-Smtp-Source: AKy350aFrnE+QL5+DxX/ByEoh/WQs847k1WDtl2US6eXkWtex1y2xmRppL1V84PpUgmSHyn3rpwfsw== X-Received: by 2002:a17:906:fe49:b0:947:5698:c9f6 with SMTP id wz9-20020a170906fe4900b009475698c9f6mr8266222ejb.35.1680299312862; Fri, 31 Mar 2023 14:48:32 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id pg1-20020a170907204100b0092b546b57casm1363553ejb.195.2023.03.31.14.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 14:48:32 -0700 (PDT) From: Liliana Marie Prikler Date: Thu, 30 Mar 2023 20:41:59 +0200 Message-ID: <09b3598cb0fb0acd211dd59fc10686188b941d8e.camel@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680299377; a=rsa-sha256; cv=none; b=eVpR3VxgxcxdDJbaj22TO479EQvF5uF5U3giL1c1L4TFNYcXNBHyKPWi3+nhovqrZX9cjS y+iAbTli8n3ix1ao2xtoN9hHtI9lawYgnYX49j/QxM1jMBZzZqgw/A1cE3E94VVtcifW/Q Oj2ZdhHKXYPxU4xerSLrtihgGbR9yh6R5gUeuUt3PvJJGgxZ4X0sAYXK7fxU/eFnv8bV5N ctLsw/BoxiZ3NXhJDh3dgCEk95rZVoP2BcETQc8Jm0MGcobH6VZkeGwa3rcthsfoT3PaSo ChwvdxhTP9zslLlFUnfuFtPBH9e1AJNCx/Ep1vtmFLM+mj1csUiu22gdjj5aUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=osaFGSpd; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680299377; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=aPYJYw1MMPu4yVOKLcLUBGTGZkkfeSyaHWpyUQB+z1A=; b=F/t2F5AvTKqDEoW3TwmQxYcqOIVnBOnoyfwZ8C97hhR7O2l4mFE8eN3gYMUqYoZulDbjfj qAeAnHJff9Ny9cztD9x+A+vxW71BT/m4t0BvfRYA9wFvTMlxYuSlhrWn5JzIuyq9+E/OQX Y43taFTsEj/tHA7Z0TxOKgHA6I+vZ7lcZnLQL9bxxwyMK5JeFNPDOFk3RpzYD3heyusmfU Wlr8bIJ4NeHTuiQnqX6j/wA5+x2tst/o+CFiJFM6OQ6sBDgoj00ruI/II2FAwnY1A5FRIp 3ho9qVFwRJSPUx35mqQHQLqHEHNxAmmmt1BKE0XnKp/gexVh53zmU2ZD0Gw8Aw== X-Migadu-Spam-Score: 6.78 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=osaFGSpd; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Spam-Score: 6.78 X-Migadu-Queue-Id: 3280733142 X-TUID: o0qqI/tAr3/J * gnu/packages/patches/gtk2-harden-list-store.patch: New file. * gnu/packages/gtk.scm (gtk+-2)[patches]: Add it here. * gnu/local.mk (dist_patch_DATA): Register it here. --- gnu/local.mk | 1 + gnu/packages/gtk.scm | 1 + .../patches/gtk2-harden-list-store.patch | 42 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 gnu/packages/patches/gtk2-harden-list-store.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3e94281ccf..31456c5be8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1303,6 +1303,7 @@ dist_patch_DATA = \ %D%/packages/patches/guile-rsvg-pkgconfig.patch \ %D%/packages/patches/guile-emacs-fix-configure.patch \ %D%/packages/patches/gtk2-fix-builder-test.patch \ + %D%/packages/patches/gtk2-harden-list-store.patch \ %D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \ %D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \ %D%/packages/patches/gtk2-theme-paths.patch \ diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index c756f39e24..196d767160 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -1014,6 +1014,7 @@ (define-public gtk+-2 "1nn6kks1zyvb5xikr9y2k7r9bwjy1g4b0m0s66532bclymbwfamc")) (patches (search-patches "gtk2-respect-GUIX_GTK2_PATH.patch" "gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch" + "gtk2-harden-list-store.patch" "gtk2-theme-paths.patch" "gtk2-fix-builder-test.patch")))) (build-system gnu-build-system) diff --git a/gnu/packages/patches/gtk2-harden-list-store.patch b/gnu/packages/patches/gtk2-harden-list-store.patch new file mode 100644 index 0000000000..b107ba2bcc --- /dev/null +++ b/gnu/packages/patches/gtk2-harden-list-store.patch @@ -0,0 +1,42 @@ +Mimic the implemenetation in gtk+-3. + +Index: gtk+-2.24.33/gtk/gtkliststore.c +=================================================================== +--- gtk+-2.24.33.orig/gtk/gtkliststore.c ++++ gtk+-2.24.33/gtk/gtkliststore.c +@@ -1195,16 +1195,31 @@ gboolean + gtk_list_store_iter_is_valid (GtkListStore *list_store, + GtkTreeIter *iter) + { ++ GSequenceIter *seq_iter; ++ + g_return_val_if_fail (GTK_IS_LIST_STORE (list_store), FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + +- if (!VALID_ITER (iter, list_store)) +- return FALSE; ++ /* can't use VALID_ITER() here, because iter might point ++ * to random memory. ++ * ++ * We MUST NOT dereference it. ++ */ + +- if (g_sequence_iter_get_sequence (iter->user_data) != list_store->seq) ++ if (iter == NULL || ++ iter->user_data == NULL || ++ list_store->stamp != iter->stamp) + return FALSE; + +- return TRUE; ++ for (seq_iter = g_sequence_get_begin_iter (list_store->seq); ++ !g_sequence_iter_is_end (seq_iter); ++ seq_iter = g_sequence_iter_next (seq_iter)) ++ { ++ if (seq_iter == iter->user_data) ++ return TRUE; ++ } ++ ++ return FALSE; + } + + static gboolean real_gtk_list_store_row_draggable (GtkTreeDragSource *drag_source, -- 2.39.2