Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08825C433F8 for ; Mon, 29 Mar 2021 16:51:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E56D761920 for ; Mon, 29 Mar 2021 16:51:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231246AbhC2QvR (ORCPT ); Mon, 29 Mar 2021 12:51:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:44948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230421AbhC2QvE (ORCPT ); Mon, 29 Mar 2021 12:51:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 95B3061970; Mon, 29 Mar 2021 16:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617036664; bh=Go67J8x1JlZCedGzg0XPspcbs9lYbxUMKt43KrqJb0U=; h=From:To:Cc:Subject:Date:From; b=OjJ3yGo2njB2aFPcBy1VjjUPZa9efBfffRfM5ug4nR8mZkRMq+EVe42PZCUda5n+T HIAyy3yee2xFGuUQwmdi/477bUUB1EsX1T9jF/CN75eRq2eH7NYpwA9RvSghQv6W75 01TxPzg0aTtOMbLMgCoCx+aOK2QcKp4bgQJN/CNvZkSv8o3OcvO2Dm7JgXMolEtRTr BhYBZdn+7nDVcfPrk/NEc6GEnd6GTcbnFcyeE/3PM9bidm5wHH84RNcneHrk4vGQtA texN8bcpikKycgQ0+qxh1FeuoZPJvFzMbCagGn6VSawcqanndg1Rn8MnfCNsXKBlaX ZoAkP0AofA7jw== From: Sasha Levin To: stable@vger.kernel.org, dbrazdil@google.com Cc: "David S . Miller" Subject: FAILED: Patch "selinux: vsock: Set SID for socket returned by accept()" failed to apply to 4.14-stable tree Date: Mon, 29 Mar 2021 12:51:02 -0400 Message-Id: <20210329165102.2359207-1-sashal@kernel.org> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.14-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ From 1f935e8e72ec28dddb2dc0650b3b6626a293d94b Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Fri, 19 Mar 2021 13:05:41 +0000 Subject: [PATCH] selinux: vsock: Set SID for socket returned by accept() For AF_VSOCK, accept() currently returns sockets that are unlabelled. Other socket families derive the child's SID from the SID of the parent and the SID of the incoming packet. This is typically done as the connected socket is placed in the queue that accept() removes from. Reuse the existing 'security_sk_clone' hook to copy the SID from the parent (server) socket to the child. There is no packet SID in this case. Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") Signed-off-by: David Brazdil Signed-off-by: David S. Miller --- net/vmw_vsock/af_vsock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 5546710d8ac1..bc7fb9bf3351 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -755,6 +755,7 @@ static struct sock *__vsock_create(struct net *net, vsk->buffer_size = psk->buffer_size; vsk->buffer_min_size = psk->buffer_min_size; vsk->buffer_max_size = psk->buffer_max_size; + security_sk_clone(parent, sk); } else { vsk->trusted = ns_capable_noaudit(&init_user_ns, CAP_NET_ADMIN); vsk->owner = get_current_cred(); -- 2.30.1