Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp75147rwb; Thu, 17 Nov 2022 20:53:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf6nvMCp9cQ6YsGSh3NqsMQlYSZGnW2jJc2QLj2qI6k7CPoGGcfGVIJZLISL6DLFCjJbLBF2 X-Received: by 2002:a63:4b16:0:b0:476:d0b8:1117 with SMTP id y22-20020a634b16000000b00476d0b81117mr5021699pga.104.1668747225385; Thu, 17 Nov 2022 20:53:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668747225; cv=none; d=google.com; s=arc-20160816; b=VIX/14+XRygqTgM/UcXwI60qxcec8hUAdFu+pkVMJV8xVYodi932pqIi8KJNQksDzK 2+ZBhgt649XecVRoZhepTNwAzHTJ4nEWywrzxW9aDlXjMjxFs6UhImoEXAh9PUO2pXMu LhyyPUWacYpDU0zgsTJ2LjhKh+q2HV1mRfT0ff03ZBY2PgPCwyLgdxjRpH4FhP5kEZCf DIGycgd0s8EENZVWihsb9WFA7py91neiciPuQFuS+XEz9kvFDgh01DxnpSjicVOtT7It RYBV2t7tbgVPopMLbikTda1klxKSNljUAbfVxL2ZcezP5Rsu+qfx8xzGN0wmnC2KlFYM g2Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3Dr1Bit9E2xIsyjg35lmCOjqfBFsJ1wOMewib20+A9s=; b=v3OWaD3a+WHNRCwh/smPJGEv+FtQgKVZDuSj1dp8CdpNqfumO54JoDOjpmCuiFmcEN EHPjXlQOU0yIJ3MjVMxkG9cTCvveANfMHaxCKfz7l23S4nLU0xmw35uJyfwjVOYJeriu JhqIN5KDHnlDy5W46WhkkxGDmA05+sYmBqkMeT7b6hlkBz0HNJ1+pqFsOBIgR5oyg0Kp wCsexmqb+P9ffoLqOi9llheDEZIbK3/CStKDmQSaByooQib1JW9TW/ct4HexF2atT39V W1TLik0AXx1Na1fVYGJZKCkvvcvPm2PVeR7zxMJgg4gxHuLYOLNrAuu6EcHuqO93UWKY eiVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=S2m69yrw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mi5-20020a17090b4b4500b0020d887ded6esi3131421pjb.120.2022.11.17.20.53.34; Thu, 17 Nov 2022 20:53:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=S2m69yrw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240683AbiKREk0 (ORCPT + 91 others); Thu, 17 Nov 2022 23:40:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235222AbiKREkX (ORCPT ); Thu, 17 Nov 2022 23:40:23 -0500 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D270490BD for ; Thu, 17 Nov 2022 20:40:22 -0800 (PST) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-381662c78a9so39074177b3.7 for ; Thu, 17 Nov 2022 20:40:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3Dr1Bit9E2xIsyjg35lmCOjqfBFsJ1wOMewib20+A9s=; b=S2m69yrwZynGvy8xNpigka4CC35Tdckv+IU7cZIjoPN/muy3Vk0cBC5wA0XMCBJ4sl IY3mgjEaTXF/Vk1pvaHePA7bFVIqAKsC/7M5c0wet6QSG03MTB/zprxTZqoKysZ1aOjy w7v5npbzpfrzy1ZaiQSFSKnVHdXrd+C5elFmmqxfjq7JnmMVAhFDZ09ySgVMXtM8nnPD CpyrXmRhbGHh0gDjdYFAh25WcEALsLUhwsTecG84NjHg9lu30VACF66fEiZT981A/dLl yRYp4dkopCCqwX2He7FLaZ64ZXW8KmN0O1eZ5i5kXsY0sTwjx7Hx7HNHnCS6p+9+wWPL aZEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=3Dr1Bit9E2xIsyjg35lmCOjqfBFsJ1wOMewib20+A9s=; b=o3a4kxVJGxk3g3RKnFu1nd9t/hJO9AFE4IGaqTHa7xdG2yeGfwjRRO/bEcJzblh+qg kfWY7xpH5WRUwevHp4mmVD/8/ZmchMqnCfuia45RK7SKQ5Xrz/fJOZkSic6IiIANW3PK l0fAytFbKoEdk584yDqCbb3QNMO6LLb5iren6xV2oStd5LGyvsU5Z4b2jkSjI18TIobv IT5XUuWPWrUksxniw6XnduB59VRr3m7G9OmkpXx1kLl9gJEEAyPDYQylc5VHK52OZNPf WMdfAUhELFg6F/mJUVIBDlrZ61UUg5WxrVOFAOpSI7ECH2kuyCh/iQGp7BXfa0P9WbmI HgWQ== X-Gm-Message-State: ANoB5pm8H4UtcfS+okS3x5u0R3cnTaYhDEF0EZLBHzhzdV4KKGbbsKTC zy+HRqioaB/T5dRk67i7BpMDyiCCpYQIpAAG/VIEeA== X-Received: by 2002:a81:5f04:0:b0:393:ab0b:5a31 with SMTP id t4-20020a815f04000000b00393ab0b5a31mr2980661ywb.55.1668746421116; Thu, 17 Nov 2022 20:40:21 -0800 (PST) MIME-Version: 1.0 References: <202211171422.7A7A7A9@keescook> <202211171513.28D070E@keescook> <202211171624.963F44FCE@keescook> <202211171815.D076ED9C@keescook> In-Reply-To: <202211171815.D076ED9C@keescook> From: Eric Dumazet Date: Thu, 17 Nov 2022 20:40:09 -0800 Message-ID: Subject: Re: Coverity: __sock_gen_cookie(): Error handling issues To: Kees Cook Cc: linux-kernel@vger.kernel.org, Marc Kleine-Budde , Paolo Abeni , Stefano Garzarella , Jakub Kicinski , Nikolay Aleksandrov , "David S. Miller" , Florian Fainelli , netdev@vger.kernel.org, "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2022 at 6:16 PM Kees Cook wrote: > > It looks like the existing code already works as intended, so no need to > silence the warning. The comment and reload might be nice to add, just > to clarify for anyone looking at it again in the future, though. The current code in net-next is broken, because if we succeed to change sk->sk_cookie, we return 0 (instead of @new). So your report was not a false positive. Thanks.