From patchwork Tue Nov 6 07:49:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 10669851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9AC111803 for ; Tue, 6 Nov 2018 07:49:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C7AA29B2C for ; Tue, 6 Nov 2018 07:49:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80B1D29B2F; Tue, 6 Nov 2018 07:49:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26C8529B2C for ; Tue, 6 Nov 2018 07:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729416AbeKFRNI (ORCPT ); Tue, 6 Nov 2018 12:13:08 -0500 Received: from cloud.peff.net ([104.130.231.41]:41810 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729160AbeKFRNI (ORCPT ); Tue, 6 Nov 2018 12:13:08 -0500 Received: (qmail 17602 invoked by uid 109); 6 Nov 2018 07:49:12 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Tue, 06 Nov 2018 07:49:12 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 29046 invoked by uid 111); 6 Nov 2018 07:48:30 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) SMTP; Tue, 06 Nov 2018 02:48:30 -0500 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Tue, 06 Nov 2018 02:49:10 -0500 Date: Tue, 6 Nov 2018 02:49:10 -0500 From: Jeff King To: git@vger.kernel.org Cc: Felix Eckhofer , Junio C Hamano Subject: [PATCH 0/3] fix pull/merge --verify-signature on an unborn branch Message-ID: <20181106074910.GA31978@sigill.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This bug was reported to the private security list, but I don't think it's easily exploitable, since merging or pulling into an unborn branch is pretty uncommon. The root of the issue in both commands is just that we handle unborn branches in a special code path that never learned about --verify-signatures. [1/3]: merge: extract verify_merge_signature() helper [2/3]: merge: handle --verify-signatures for unborn branch [3/3]: pull: handle --verify-signatures for unborn branch builtin/merge.c | 30 +++++------------------------- builtin/pull.c | 11 +++++++++++ commit.c | 26 ++++++++++++++++++++++++++ commit.h | 7 +++++++ t/t5573-pull-verify-signatures.sh | 7 +++++++ t/t7612-merge-verify-signatures.sh | 7 +++++++ 6 files changed, 63 insertions(+), 25 deletions(-) -Peff