Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3074376imw; Mon, 11 Jul 2022 00:50:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s89Uacfus31gnSjOsYvEwvl3ZykX905/yCAhmUxMvnawEyzjM2PPjEY5neGNYXo8yNupHq X-Received: by 2002:a17:907:a40a:b0:72a:a61d:9ac8 with SMTP id sg10-20020a170907a40a00b0072aa61d9ac8mr17254091ejc.43.1657525854732; Mon, 11 Jul 2022 00:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657525854; cv=none; d=google.com; s=arc-20160816; b=bF1R8FOjrSYrgc4rGs3mFOYDMQlxZH5V1oJRUvP/O8UdRl3rMtVG+JAYgEM0OEIQNJ J7FypyR28QM5M7BK5fySCDtP2K7q2WXpJOm9N9JKq4GgQ9jLlvqcQvL4oLVT+SrwRn0P zYnIMn9srqwJvc57vxXv4PhaX4lPO3NlK/TIdNq8CqCBjol5P5Vd5E/tlcncn/qEj/9X Jm2Oj3MiJSg2l8XuhFz65veJhwbKzlZrSZED8j4ADBMDJH1z8703L95erJiMP7BOM6Dj omGOSH67qfd3RuIv/xpJddLTkIE6u9LSyYeQMznfNrff2TIFN4H6mWQ2/G36P0n4YT8M 7qEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=oBtvw+nRA2OJBjBbePOBjcDKFS70OEcZP1WkchQaSRw=; b=zHhUd2G9ZpHrDufDZ3MQ0vsLzpf90eB5l0kmOZGtTI4zKviuLUbMOVBM8grYrvrv5W /cTc3ZENj4aOLSHoWiQlq+/oBQcHcfr/C1S7VcxxnKgvK9ImI5Gg/7sitepyZNQtPDZq IrnSITZqCjth9Cmzi4ysLZxsRmf+t/AxGwtrdjF7r2uzyaziRDWdt5HqomKf4wbzCd8b KFr2uLXjLsQ7gI+YkeTpRqM8Kqy/keLQOUlghuHsaF3KagRW2u6kkbLq4TiVu3s/p9q+ PTDAMaVt0NzuYNikGrKo34VNNf/cCQhYz2aW7ngwVN8l8eg5xRMwz3g9ot2nc7IEo/uU mEYA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ej2-20020a056402368200b0043a59da51a0si7490320edb.95.2022.07.11.00.50.30; Mon, 11 Jul 2022 00:50:54 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbiGKHVh (ORCPT + 99 others); Mon, 11 Jul 2022 03:21:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiGKHVd (ORCPT ); Mon, 11 Jul 2022 03:21:33 -0400 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC7561055F; Mon, 11 Jul 2022 00:21:31 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=26;SR=0;TI=SMTPD_---0VIxofy0_1657524082; Received: from 30.227.65.231(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0VIxofy0_1657524082) by smtp.aliyun-inc.com; Mon, 11 Jul 2022 15:21:24 +0800 Message-ID: <0408b739-3506-608a-4284-1086443a154d@linux.alibaba.com> Date: Mon, 11 Jul 2022 15:21:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] smc: fix refcount bug in sk_psock_get (2) To: Hawkins Jiawei , syzbot+5f26f85569bd179c18ce@syzkaller.appspotmail.com Cc: andrii@kernel.org, ast@kernel.org, borisp@nvidia.com, bpf@vger.kernel.org, daniel@iogearbox.net, davem@davemloft.net, edumazet@google.com, yoshfuji@linux-ipv6.org, dsahern@kernel.org, john.fastabend@gmail.com, kafai@fb.com, kgraul@linux.ibm.com, kpsingh@kernel.org, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, songliubraving@fb.com, syzkaller-bugs@googlegroups.com, yhs@fb.com, skhan@linuxfoundation.org, 18801353760@163.com, paskripkin@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org References: <00000000000026328205e08cdbeb@google.com> <20220709024659.6671-1-yin31149@gmail.com> From: Wen Gu In-Reply-To: <20220709024659.6671-1-yin31149@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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 2022/7/9 10:46 am, Hawkins Jiawei wrote: > > syzbot is try to setup TLS on a SMC socket. > > During SMC fallback process in connect syscall, kernel will sets the > smc->sk.sk_socket->file->private_data to smc->clcsock > in smc_switch_to_fallback(), and set smc->clcsock->sk_user_data > to origin smc in smc_fback_replace_callbacks(). > > Later, sk_psock_get() will treat the smc->clcsock->sk_user_data > as sk_psock type, which triggers the refcnt warning. > Thanks for your analysis. Although syzbot found this issue in SMC, seems that it is a generic issue about sk_user_data usage? Fixing it from SK_USER_DATA_PTRMASK as you plan should be a right way.