Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp185605pxf; Thu, 25 Mar 2021 01:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDkrZyV1cZ+W4eUBp8h4mhXwjfZSg0XpXCxCH5m3OSM32uJEuXcXThtTbg2omjO5LrjpDJ X-Received: by 2002:a17:906:f9db:: with SMTP id lj27mr8099305ejb.399.1616660640200; Thu, 25 Mar 2021 01:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616660640; cv=none; d=google.com; s=arc-20160816; b=Mgt/gEo8qpTq8oPw21PKLoeXv8ffi9UxxyyMDfJjhqeKtucZMtkxbQt2xLnAwtgfU5 7oavl1fGtOXnjX1pPVjRtWNIY3009K81is4pqGfnlt9A3Pc0f1MRfwiZmd4kEVgUHwia 2ZlxLfbkOULQm5jBTC2cwQam6qv3YRKOOCMU8g2ib0gbkIvt4UhmkBcLxMW3HTZ4DflT 4dE4/Sv4RtrbCMlFbydn9jXh+Krg9SdiUd9I6vK9QZaXm8dD/Xcp+M8lew8wHI1KX2I8 tyl9Ofxtj2rSIjBPNqRXIvxjWTtxAob6Y/hpcczngvAnbmKoMXfsmA42KiKmwPaTWsuP GiiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mwM2SreNjinm5R/W2w3CxcJnRoqyfJkSmd4Ey8StaXk=; b=vn1gypKdfMStMSrHFlLZT0ICjwDvYEIiYLJYMe/lQKoxSn2L2CqTNl5f8zO9YcX7yW V4i0n4XTiOExniQsUC4klwATl0DL86cK4g1+8Uq1eT8BEkgFOG9gtDXfpqDPpE739dxt 9YxEDsXWshu1EyffJIJ6vnTITp5LN/cYuK/0pr2B40vkg9tO7i90331DeLSMOn9nmrSI FlsaKhZZMXymNlK1U3Bp858MIsIrGuHLjvMu3kvZER08lppaU+ZPk7BBrVQFZ228cQAn 7y5NhmAACMLsjg/PSKJGa3xE2sVsO+1JI3MgdKDA16D0e+2nRKSNnF02AEvH/DY9u52F 8rog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=VkeBsqdl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l10si3608202edb.348.2021.03.25.01.23.37; Thu, 25 Mar 2021 01:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=VkeBsqdl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229448AbhCYIWg (ORCPT + 99 others); Thu, 25 Mar 2021 04:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbhCYIWP (ORCPT ); Thu, 25 Mar 2021 04:22:15 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C4BAC06174A; Thu, 25 Mar 2021 01:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=mwM2SreNjinm5R/W2w3CxcJnRoqyfJkSmd4Ey8StaXk=; b=VkeBsqdl/8z1J9XCE2L0+qH8S1 z3JWZgRMp6dp0GZmrqYdEUxwx2kWvmaYOdOc7PSrAbCxCSm8ecYtdwbCHGu97hjrndpN16VPphURD mb1WeBMHm9L/sWOZ7f98QBicDSj4i6zG7s4lXBCresk+A1w/wpN4mQH54YPjwSAQ0WE5J+O5XhnZZ AwtNHHow6UWwrz6EthuceC6t0kop2Wce32J+Vq7Wc8Xws9Lcg0E8HQW9E/dxZADeS3eQdIvqIFqQv 9P0eKzeEm/XoXCJY3eHkxpNEBlqDCiYlRM+lB88NrUqjjXg5qsrYnVuWzu4blBxfkFNWrX0bJhIrp OFCDh8AQ==; Received: from [2001:4bb8:191:f692:9658:56e2:eade:cbfa] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lPLFs-004X63-3w; Thu, 25 Mar 2021 08:22:12 +0000 From: Christoph Hellwig To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Andy Lutomirski , Will Drewry Subject: split receive_fd_replace from __receive_fd Date: Thu, 25 Mar 2021 09:22:08 +0100 Message-Id: <20210325082209.1067987-1-hch@lst.de> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The receive_fd_replace case shares almost no logic with the more general __receive_fd case, so split it into a separate function. BTW, I'm not sure if receive_fd_replace is such a useful primitive to start with, why not just open code it in seccomp?