From patchwork Fri Jan 28 17:31:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 592 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7FAEB27BBEA; Fri, 28 Jan 2022 17:34:00 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BCAE327BBE9 for ; Fri, 28 Jan 2022 17:33:58 +0000 (GMT) Received: from localhost ([::1]:48700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDV8H-0000mO-8p for patchwork@mira.cbaines.net; Fri, 28 Jan 2022 12:33:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDV7Y-0000lD-Vg for guix-patches@gnu.org; Fri, 28 Jan 2022 12:33:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDV7P-00007P-17 for guix-patches@gnu.org; Fri, 28 Jan 2022 12:33:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nDV7O-0000vX-2q; Fri, 28 Jan 2022 12:33:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53608] [PATCH 0/2] Rejecting commits unrelated to the introductory commit Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, attila@lendvai.name, guix-patches@gnu.org Resent-Date: Fri, 28 Jan 2022 17:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53608 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53608@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxime Devos , Attila Lendvai X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Maxime Devos , Attila Lendvai Received: via spool by submit@debbugs.gnu.org id=B.16433911253489 (code B ref -1); Fri, 28 Jan 2022 17:33:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Jan 2022 17:32:05 +0000 Received: from localhost ([127.0.0.1]:60415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDV6T-0000uC-13 for submit@debbugs.gnu.org; Fri, 28 Jan 2022 12:32:05 -0500 Received: from lists.gnu.org ([209.51.188.17]:49948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDV6Q-0000u3-4g for submit@debbugs.gnu.org; Fri, 28 Jan 2022 12:32:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDV6P-000068-T5 for guix-patches@gnu.org; Fri, 28 Jan 2022 12:32:01 -0500 Received: from [2001:470:142:3::e] (port=33450 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDV6P-0008PN-Ek; Fri, 28 Jan 2022 12:32:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=dq9IcKXPO6ORxKYv39S0RYu7MLL7ruLib5MV+thdYc4=; b=YuCKyOragxhdTQ Ewo9VoWYqpXDWK4L7fO4Mn0PrR7S7qKllvVbOICMQAD9YfhrMfUBDNv4SQs/vbWOwzLagiRjA1hdu IJWV4bXnWyh2ApPGLvaekDtzIVYsv1j+l1xxVeOEMnjaMCVbZDWeVTjUG8G8V/7mAW2ZxSQKOkBUG 7OU4oSbNLpTloDjsGrZ+nEpeLstxuNemSe/QQpD0IEPKRIWHLh+zMNwgF3kH6cnULtnhmrH5CqJL8 c4+iaozTM0RC5awpr4x/eVr1sK17Sb5ev0ehraEXm8IfM10ot2bR3bn9wV2tQQtvzLQPt0SUU96iB xCMJjGqURJNvr3Oh9/HA==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=33808 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDV6M-00070m-Vx; Fri, 28 Jan 2022 12:31:59 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 28 Jan 2022 18:31:42 +0100 Message-Id: <20220128173142.7072-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello! This patch series fixes a bug in the checkout authentication code: it would be possible to authenticate a commit unrelated to the introductory commit, provided that target commit passes the authorization invariant (see the commit log for details). Users of Guix and of third-party channels are safe: this bug does not have any impact on checkout authentication in those cases. What concrete cases are affected? Suppose someone forks Guix and publishes a new channel introduction for their fork. The expectation is that any branch started before the introductory channel, for instance in the original Guix repo, would fail to be authenticated. However, because of this bug, such a branch would be considered authentic in the fork because all its commits pass the authorization invariant (IOW, they are authentic in the original repository). Thoughts? Ludo'. Ludovic Courtès (2): git: Add 'commit-descendant?'. git-authenticate: Ensure the target is a descendant of the introductory commit. doc/guix.texi | 4 ++- guix/git-authenticate.scm | 17 ++++++++-- guix/git.scm | 24 +++++++++++++- tests/channels.scm | 60 +++++++++++++++++++++++++++++++++- tests/git-authenticate.scm | 44 +++++++++++++++++++++++++ tests/git.scm | 52 ++++++++++++++++++++++++++++- tests/guix-git-authenticate.sh | 17 ++++++++-- 7 files changed, 210 insertions(+), 8 deletions(-) base-commit: 5052f76afd02e27d6484acf74c86bfa1b6f9cd0e