From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aIfYI10INWShQgEASxT56A (envelope-from ) for ; Tue, 11 Apr 2023 09:12:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UKS/I10INWSmxQAA9RJhRA (envelope-from ) for ; Tue, 11 Apr 2023 09:12:29 +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 4AC1685A9 for ; Tue, 11 Apr 2023 09:12:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pm89n-0004He-Mn; Tue, 11 Apr 2023 03:11:11 -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 1pm89k-0004FR-DW for guix-patches@gnu.org; Tue, 11 Apr 2023 03:11:09 -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 1pm89j-0000wE-LI for guix-patches@gnu.org; Tue, 11 Apr 2023 03:11:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pm89j-0008JP-8A for guix-patches@gnu.org; Tue, 11 Apr 2023 03:11:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62467] [PATCH gnome-team v3 10/15] 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: Tue, 11 Apr 2023 07:11:07 +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.168119702931802 (code B ref 62467); Tue, 11 Apr 2023 07:11:07 +0000 Received: (at 62467) by debbugs.gnu.org; 11 Apr 2023 07:10:29 +0000 Received: from localhost ([127.0.0.1]:36477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pm896-0008Gm-Fn for submit@debbugs.gnu.org; Tue, 11 Apr 2023 03:10:28 -0400 Received: from mail-ej1-f66.google.com ([209.85.218.66]:37515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pm88y-0008E2-Jv for 62467@debbugs.gnu.org; Tue, 11 Apr 2023 03:10:21 -0400 Received: by mail-ej1-f66.google.com with SMTP id qa44so17534131ejc.4 for <62467@debbugs.gnu.org>; Tue, 11 Apr 2023 00:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681197015; h=mime-version:message-id:cc:to:subject:date:from:from:to:cc:subject :date:message-id:reply-to; bh=zzr63bWRbSd6xaTz+K5E65nc6aN9B0DjHKIhCOeXbd8=; b=GLDUz1NZcSD5j3HD4N098ENhR7SslZQlov/RhP2EBjen+1PRBx03QP0FbpU08YUWC4 r7147gvlidEvbfbCBMeZVnBIb0YA7U/9StvHiEmYdApQ1C9Q9W8ZUvSvrD5jcRe5rubg eLHw8nem9jm7GUhv3PzF/2yUbPUQoEkDUISsvJBk/KCx0Jde73PvC3QH0YOfRmwP/lIu gJTyMK2efW6A9U3Iot4fitKaZMcfOelK1+oZ95Kfg7qTC0yaxx/kDTzqrNgyftRm9lXA 5yO16O2uU89gar4YOD/PFlhf7Afb1lhhohqNMVRDB41k7WRd/YJCYX2p9Vas/nHA6hky 8E/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681197015; h=mime-version:message-id:cc:to:subject:date:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zzr63bWRbSd6xaTz+K5E65nc6aN9B0DjHKIhCOeXbd8=; b=DVzIHTWIwOaoVRJ7mZG/RkIXCMINZiJgPBpLPMa/CKMO4Nu3//5pdC5oInQZ2+LUsk llEEhVSSk8NCQpWpmHwqQrMOL72ZZbedKODyHn5jQoymx1e5ZwBzlHnAS/L4n3bSWM7p HxWvpi49PT85OzCYw0koNXRYQOn0aPrxrtErShuRTjkSysU2/a1WrwsruJh3JoFJSwGU rLDXAzUkJMVuCuW9eNi7MnDCxGtBB6E47kQdDwaFA2LMXdn+fIhcPalpiOg9JIKbFUnX K9n/+K1VDaIZzzZuxmdSAq9Saqsq2iuxwaYyzHzcF+XsV7LD912LxoDzv7O1zUcf6g25 vW5A== X-Gm-Message-State: AAQBX9fs+nuA5kKOJMTw7BWfHh5pcHzXbfpsuX6UNQuigJfpDlkn5r86 NLcQYW3uhfllbZsZ6Rd9G3Wx6445IV7B0A== X-Google-Smtp-Source: AKy350aJsXU25UVXS1yVYqcm+xlMsgvfSF8Wa6iWZyF4YCFmoan0OgQDae1YmkrQYdIJqgnPkdLRgA== X-Received: by 2002:a17:907:874f:b0:94a:532b:3f70 with SMTP id qo15-20020a170907874f00b0094a532b3f70mr6155477ejc.20.1681197015057; Tue, 11 Apr 2023 00:10:15 -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 md15-20020a170906ae8f00b0094b87711c9fsm1169185ejb.99.2023.04.11.00.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 00:10:14 -0700 (PDT) From: Liliana Marie Prikler Date: Thu, 30 Mar 2023 20:41:59 +0200 Message-ID: <4dbf541e337c0b2324247fc10ff532f788bd0afd.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=1681197149; a=rsa-sha256; cv=none; b=kKnfI4Y8q+XZL1VZ/MaYV6dpco8Q0ovFxYTqKoQsFN96NuespabPLUCO4jEm9B7WShFgAg IKqRbHhbA6dx8yiwgoPaCwvwnW3BchFWjPq8+ieuX6IOTculk8YjyDi+T7B8RZ3nfng3/u +cZaPOM5hYRzcgf68Srs8w+9Dwtgd1n6HPZ/hhXStQTpyYZYQiDn87Ehy0kSJHxBvHtgWc kn8S7xizKymuwbeLs0g3o6GiXiQf0M4S37vgyEQ9mDFFvsFJnQV5M2BUer8EQfmJsl4DJW hVJJ72BXzLLa1rdtZ7fplLkj3NSSPMhx2k0P0fDh25USfmIreuawC4Lh2qPeNQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GLDUz1NZ; 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=1681197149; 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=zzr63bWRbSd6xaTz+K5E65nc6aN9B0DjHKIhCOeXbd8=; b=lHrIgU8BZu+axC9w5sogFq37PM8FATVldhTGEIphrCPazhYEP7ZHS7BM26cBp0nlzS8IYK TcPN6tbd4nlFF1GijHj/WAGbZhrMjY0ygHzbb+vTjG1sR9WghP9f3ZJ3IHRuFKLPCOL+5W mCmcl90k9DHTAZBN7e9P+qW7PNcMP/7tp/ftpq0C/UToUD4lz9aM4j2TtZmCEQ94+Uyv1A /SqLuvFBfUFdkxEUmzOF8XAGgNGQC14wL7ipkzxE/eGKLNUOwYdIag93BCjkfXuXKFu/FF 6oo5swdMqB9GAogMYjvh7BIpKRL0Se7o8Vxx8FFfTDC55pI1pexq2ug21ZYx4w== 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=GLDUz1NZ; 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: 4AC1685A9 X-TUID: f5rZd5hIUAyb * 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 67ec1b754a..df78ce263e 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 3e57035bac..6d3bbb42be 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..f49dc3bc77 --- /dev/null +++ b/gnu/packages/patches/gtk2-harden-list-store.patch @@ -0,0 +1,42 @@ +Backport the implementation of gtk_list_store_iter_is_valid from 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