Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DE87C64ED6 for ; Mon, 27 Feb 2023 10:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbjB0KV3 (ORCPT ); Mon, 27 Feb 2023 05:21:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjB0KV1 (ORCPT ); Mon, 27 Feb 2023 05:21:27 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85AE5F742 for ; Mon, 27 Feb 2023 02:21:26 -0800 (PST) Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 4E7203F4B9 for ; Mon, 27 Feb 2023 10:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1677493285; bh=zsCDCB3XtidP3kEhU8Gi1pJlYQVOTcLpAGwHtfPU994=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YvwHehFomSdFUN58yw1ZzNtrmwPxac3sGgiemfVfwi+xG+3EgoydWluMpGRGe/pXc QXVCzCgpDYZ19MgpXYFEtPL2+6hN4C5P5SnwrkJQ9QdqKEuVb2Ws1b0Q5MjN1QFDoU A8nSvxLBfN+VkSmlvn3dLYoSVTkZ//hRerRhg9eBZethlbw4SkCpfYqmKpJEMgqqb3 ulIXO29DrtciYNixrg0eEguYLS7i8acSKrrmW1zTsfgWRX+WHPk7uc9qvYkK4iPOw/ bkhBzAabsmMmkjSPUdeDhEHSX18zFoq0GWkBiT7rSE+xrG9pctNyIohZcG7KXJUo0e 41gp6Kkik+WzQ== Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-536d63d17dbso131080267b3.22 for ; Mon, 27 Feb 2023 02:21:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zsCDCB3XtidP3kEhU8Gi1pJlYQVOTcLpAGwHtfPU994=; b=x/NjnYyQ7YbJsKVkq5rQcUkbUKylkOgPBktPpMiYI4vAHtMkQHu73OHEyrTq3htEfM ZerkLDsm7tU+Fbshijek92kvf4jmlR9mNcP+d2LjvxJc1+nV19gLYoRzpKKiFUGKSWBI b4A7WNE7w8Fv7vVSeqCIF7ucXrVirhd2s5fdiWiM61ntU0hSL600OUu/YQqH9BNjiSfu uNMGFvbOR6CBQApTFZk2au/Xjdg9a+gTI2rwzHyRm92G9Hm3aLxWP32vQkljy32SNBde KyPoB8MDFsZWc09HOOAMzM1CiIA4i6TTWa9rwmG+DiDoB1FvflW8fSYdAqTSI/JK0ZfH xNFw== X-Gm-Message-State: AO0yUKVZ5+KzFWu/zQz7dL1T94/pxWmJjvZi8zFav0ct0AaTqf7sr8sG M/vgdMuOXajgGzsuKi9ZPej2OOfMOOUcHeGDIHIEu+TvXR2Uq9oqGR1W43nkb9r0KtOlbsBFTEK +2Qn8s172h7JlVT6ixUn3cLR7x28rfmNMkIHudFi3aJFQcel+mc99GnlLDFnq92jXOA== X-Received: by 2002:a05:6902:158c:b0:8bd:4ab5:18f4 with SMTP id k12-20020a056902158c00b008bd4ab518f4mr6961226ybu.6.1677493284162; Mon, 27 Feb 2023 02:21:24 -0800 (PST) X-Google-Smtp-Source: AK7set+rGvI3MUFePg0BXtepXu6AiPdqPrF6Mljz9WZ2to+nM0MjGJbbnUKymUpWGEx7DqGAjleENMoMOF+dRFPkK7s= X-Received: by 2002:a05:6902:158c:b0:8bd:4ab5:18f4 with SMTP id k12-20020a056902158c00b008bd4ab518f4mr6961213ybu.6.1677493283931; Mon, 27 Feb 2023 02:21:23 -0800 (PST) MIME-Version: 1.0 References: <20230226201730.515449-1-aleksandr.mikhalitsyn@canonical.com> In-Reply-To: From: Aleksandr Mikhalitsyn Date: Mon, 27 Feb 2023 11:21:13 +0100 Message-ID: Subject: Re: [PATCH net-next] scm: fix MSG_CTRUNC setting condition for SO_PASSSEC To: Eric Dumazet Cc: davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Jakub Kicinski , Paolo Abeni Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 27, 2023 at 11:01=E2=80=AFAM Eric Dumazet = wrote: > > On Sun, Feb 26, 2023 at 9:17=E2=80=AFPM Alexander Mikhalitsyn > wrote: > > > > Currently, we set MSG_CTRUNC flag is we have no > > msg_control buffer provided and SO_PASSCRED is set > > or if we have pending SCM_RIGHTS. > > > > For some reason we have no corresponding check for > > SO_PASSSEC. > Hi Eric, > Can you describe what side effects this patch has ? > > I think it could break some applications, who might not be able to > recover from MSG_CTRUNC in this case. > This should be documented, in order to avoid a future revert. Yes, it can break applications but only those who use SO_PASSSEC and not properly check MSG_CTRUNC. According to the recv(2) man: MSG_CTRUNC indicates that some control data was discarded due to lack of space in the buffer for ancillary data. So, there is no specification about a particular SCM type. It seems more co= rrect to handle SCM_SECURITY the same way as SCM_RIGHTS / SCM_CREDENTIALS. > > In any case, net-next is currently closed. Oh, I'm sorry. Kind regards, Alex