Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2824542rdh; Mon, 30 Oct 2023 08:41:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvqaVzsoo1daohVErxHv78BIwYOOvWTZnAawO+MOytgElTRJFVTQ2+3ej0dVNyLgPhM+4r X-Received: by 2002:a17:90a:cb8e:b0:280:29d0:2c6e with SMTP id a14-20020a17090acb8e00b0028029d02c6emr5049117pju.11.1698680517203; Mon, 30 Oct 2023 08:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698680517; cv=none; d=google.com; s=arc-20160816; b=015SWNs6XUgb01eefZPj/2k5eTD4IX9ZxE+BmEq3F0h9mt8an64DMMtYEsVwV4fO1H PGV3NqtwoH7Qj2H6UW95N2KFwilNIob4knyAjAGGUw1dud0OD78e6ZVxqIjGJ+xG60uo G3IivAcdm6E/LDYp9OK9+DWu+x2p1/ARQ6/KyPih0fQAk/BBbyxyBG6Ri7pbjjUtQj0g VVMpk77eIlfWRrn4DohP5VIRot2eaHs3YpFVIftE5j1vnR4u15Rwh3GHOjR7UizxkQCg 8Lk3KuqIlHGTnV+vDZQVdsAlmz88/zNKdQKFkaLNpQ6ryeJlKdvdj8FyaXSTNcShDSKp tGsw== 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:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=CPRLTSWuTrsZ1XKe1+EbPZ7W3J1mWgSbUoqx7ta8svE=; fh=ijJNX4H94Wvplau4izRgKiIo/iw5C4VmnmmUGrdBNRE=; b=acQ2b5MWf+K+dJcCeyIcSYg0qRXV23kX/d1TPRncmd+Gw4P7EXQ//6N22/YNDFfQPO bCat4vDxCe2bo3ALdAINIR5X1eDZ4WNl1Mmjhu4XipD1xkV9ZW9jiKtBCzKMK4/d2kms wqT28OQQjf0n03hpu93ozS7iENQwz41IC7LA4qsvwf9Ut3F9a+Y/hYVNrwLagICJXnOY OjW5pVHQ2dhoe+HiQkbcf9DySC9UeqKWbhSlPioVjA98ARzNdh9AgSA28fbIU2t3yuhl QvSnPM00hpQn52o4f/RMzxI7ouo3oYTAGRkINWs3csr9JTdmrbL0YBRg96NDirUWrZm7 1meQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Imd4/4nA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l4-20020a17090ad10400b0027ce6cd3144si6955474pju.126.2023.10.30.08.41.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 08:41:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Imd4/4nA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 497BF80789FA; Mon, 30 Oct 2023 08:40:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233740AbjJ3Pkb (ORCPT + 99 others); Mon, 30 Oct 2023 11:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233748AbjJ3Pka (ORCPT ); Mon, 30 Oct 2023 11:40:30 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A5BADE; Mon, 30 Oct 2023 08:40:28 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1cc5b705769so4363385ad.0; Mon, 30 Oct 2023 08:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698680428; x=1699285228; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=CPRLTSWuTrsZ1XKe1+EbPZ7W3J1mWgSbUoqx7ta8svE=; b=Imd4/4nAlvx0SbmN8SUvvCoJmfe74m/srOrF5PZlFEDTrN1POFtep4t0yjKf8G3h/R RMKZ50A/EV3qCkSmc61xaveB1Vk6XmUUZ2SFTDAC0T7o5sI3v3SpR9gHQSaujussF0JB 77Kx+wKlxQwJicKjq71YVDq308n2GRd5dac0Z26hhezMxxdhGJ461KgFVfnQocSknwJZ bm2yToycRuif1EX+Z7m1nMcWFRo9TW4+76PkKONHcpDjXT038RUihfIScL9lOPoIemI5 2I6egt5scWZM/HcJfpUCW18hz/92gGCBatQX+MHyHmUzHuEq4ttMSWXp6vT9SWYIvSop F/1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698680428; x=1699285228; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CPRLTSWuTrsZ1XKe1+EbPZ7W3J1mWgSbUoqx7ta8svE=; b=K/Np4Jx3CM1FK/vX5eB59fybHZGRKhUKdN9RfNOarFmiOkoB5vkvXiB/IuUzA2Sazq q4dkXGdHkvbdNjw3I7u5D+qkedY8NuLEfPD/O9OcuJtd5VXYc/RXpt5s06IrqmpYFN7X wEIYnBSQa9xf9krCOPjF9O3E+ZJc1GzyxUwyzETyZMiKbC1v1IGhxHeepFo9459rEv3r +sNUux3Nl3zj+ulz6TM2Reau9eRfDjQ8HgqT47TXtLm09U9YE0fTGOjeGuW+8/QWLchb bUdQQD4PNvPKItbc5HAifnbZ5pAFPL9nnOxfvYbDjjUfZBqCIKsGL51HxoVHSFTgdJYi zsHg== X-Gm-Message-State: AOJu0YywLLEQJI+cG5aJOJz6eCB1ROfDPooaCKtYccO93Qtaswq9i9OA fb6DdekyTxyRj6sdeTl6s1Q= X-Received: by 2002:a17:903:11cc:b0:1cc:5549:aab2 with SMTP id q12-20020a17090311cc00b001cc5549aab2mr1689200plh.36.1698680427752; Mon, 30 Oct 2023 08:40:27 -0700 (PDT) Received: from [192.168.1.11] ([27.4.124.129]) by smtp.gmail.com with ESMTPSA id d9-20020a170902cec900b001cc307bcdbdsm4648823plg.211.2023.10.30.08.40.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Oct 2023 08:40:27 -0700 (PDT) Message-ID: Date: Mon, 30 Oct 2023 21:10:21 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] dccp: check for ccid in ccid_hc_tx_send_packet Content-Language: en-US To: Eric Dumazet Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, dccp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+c71bc336c5061153b502@syzkaller.appspotmail.com References: <20231028144136.3462-1-bragathemanick0908@gmail.com> From: Bragatheswaran Manickavel In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 30 Oct 2023 08:40:54 -0700 (PDT) On 30/10/23 14:29, Eric Dumazet wrote: > On Sat, Oct 28, 2023 at 4:41 PM Bragatheswaran Manickavel > wrote: >> ccid_hc_tx_send_packet might be called with a NULL ccid pointer >> leading to a NULL pointer dereference >> >> Below mentioned commit has similarly changes >> commit 276bdb82dedb ("dccp: check ccid before dereferencing") >> >> Reported-by: syzbot+c71bc336c5061153b502@syzkaller.appspotmail.com >> Closes: https://syzkaller.appspot.com/bug?extid=c71bc336c5061153b502 >> Signed-off-by: Bragatheswaran Manickavel >> --- >> net/dccp/ccid.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/net/dccp/ccid.h b/net/dccp/ccid.h >> index 105f3734dadb..1015dc2b9392 100644 >> --- a/net/dccp/ccid.h >> +++ b/net/dccp/ccid.h >> @@ -163,7 +163,7 @@ static inline int ccid_packet_dequeue_eval(const int return_code) >> static inline int ccid_hc_tx_send_packet(struct ccid *ccid, struct sock *sk, >> struct sk_buff *skb) >> { >> - if (ccid->ccid_ops->ccid_hc_tx_send_packet != NULL) >> + if (ccid != NULL && ccid->ccid_ops->ccid_hc_tx_send_packet != NULL) >> return ccid->ccid_ops->ccid_hc_tx_send_packet(sk, skb); >> return CCID_PACKET_SEND_AT_ONCE; >> } >> -- >> 2.34.1 >> > If you are willing to fix dccp, I would make sure that some of > lockless accesses to dccps_hc_tx_ccid > are also double checked and fixed. > > do_dccp_getsockopt() and dccp_get_info() Hi Eric, In both do_dccp_getsockopt() and dccp_get_info(), dccps_hc_rx_ccid are checked properly before access. Thanks, Bragathe