Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6034791pxb; Mon, 8 Nov 2021 01:59:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJ8dnr0WSoDAe+u3Fqf7H0Y/+WXoZloQQGvT0AA1uj5zp9A6t0qnbeA2hyxYoxnNFiGOrh X-Received: by 2002:a05:6402:1d56:: with SMTP id dz22mr68425465edb.44.1636365596499; Mon, 08 Nov 2021 01:59:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636365596; cv=none; d=google.com; s=arc-20160816; b=xosmuz35vFKmQqycAM+QvyrAW14eroPAXiNEi0xuw2ktCIctGfGS+EnoRvxO6sl5zM fSurvGxXZf52l5GrBHB1lXk2SLbfEyKMnShpkntfWVSXW5uoEyL9lDeUguuOiRgis8nl JFjjwGD0bGws0EsDPGhFQ11yRnI7tokXuXIAR8qJA+qt6eewvZHrCqNJjCLIXRN9xwdl HXcefzqPqCpYe+U1oZRPUy2Pmsf4tyvZoI63OilFdgyHe7UEAPoAzCoxeKF/Vd/lr+8e fXfshc4GbU33VnlYUKMV72/Gn8OPnwFo2S7EBHyTEoBjKFCJrzU2SNEd+0szaQ/q/dJP llPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ew2gqTo788gmXa7QlkCGFEvHDPE8vHkjrK+8+84JUjY=; b=nz2k1xHSOytRO1BrCzbCtNcdzAAKFJ4iEZzkgzQH7pnTJYbVwsokalggc6UJBajqTf F/WUu+10IToZl7CqGGD1uIEIY+5CIaHiaIINC3LkkmMKVCxx5uCD2YNdepQVqo4Gcdf6 1zpMQ2LYYJiSK6m5srbT0plk1wkT8QWhHMw6BLOMQUxBh1JLa6pCpKkKg5vDgPeLxq50 SyRZQaAqXkdZtdyClcX3HYy+q76SL2Gwzi5VUjEgWaK4fBEeV3otXn3QYjw64b+gS7zI gPSUWN45PNt8B2LA3tkocZSzQkLs8MvkhdjJzlixtGEsiW2EAFAFPTS5EqID6/UWhnyQ preQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WCQxvTPG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si25172420edy.167.2021.11.08.01.59.31; Mon, 08 Nov 2021 01:59:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WCQxvTPG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237154AbhKHHAv (ORCPT + 99 others); Mon, 8 Nov 2021 02:00:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:42060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236168AbhKHHAq (ORCPT ); Mon, 8 Nov 2021 02:00:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 21CA060041; Mon, 8 Nov 2021 06:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636354682; bh=b2fFSboOM6vWOlcYYowMTIvz/bRMu1W2OvDJwY9x72s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WCQxvTPG6zbsWvOhGTIaX45i7RgR2OGkL9bRC6zfUcYsKkyKRbqYztbcofRtRXEl+ n4ba+37SoABBCVZg+B0R5h3RAFnFclgt+j35rDI+dKUdUeO69lEO1rWBS92wHvpfVD UvdKfKMnxEe/uToKzGstjJSk7Rp49sd6jbRGsSA8= Date: Mon, 8 Nov 2021 07:57:59 +0100 From: Greg Kroah-Hartman To: Alexey Khoroshilov Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Xin Long , Marcelo Ricardo Leitner , Jakub Kicinski , Sasha Levin , ldv-project@linuxtesting.org Subject: Re: [PATCH 5.10 68/77] sctp: add vtag check in sctp_sf_violation Message-ID: References: <20211101082511.254155853@linuxfoundation.org> <20211101082525.833757923@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 02, 2021 at 04:52:28PM +0100, Greg Kroah-Hartman wrote: > On Tue, Nov 02, 2021 at 05:12:16PM +0300, Alexey Khoroshilov wrote: > > Hello! > > > > It seems the patch may lead to NULL pointer dereference. > > > > > > 1. sctp_sf_violation_chunk() calls sctp_sf_violation() with asoc arg > > equal to NULL. > > > > static enum sctp_disposition sctp_sf_violation_chunk( > > ... > > { > > ... > > if (!asoc) > > return sctp_sf_violation(net, ep, asoc, type, arg, commands); > > ... > > > > 2. Newly added code of sctp_sf_violation() calls to sctp_vtag_verify() > > with asoc arg equal to NULL. > > > > enum sctp_disposition sctp_sf_violation(struct net *net, > > ... > > { > > struct sctp_chunk *chunk = arg; > > > > if (!sctp_vtag_verify(chunk, asoc)) > > return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); > > ... > > > > 3. sctp_vtag_verify() dereferences asoc without any check. > > > > /* Check VTAG of the packet matches the sender's own tag. */ > > static inline int > > sctp_vtag_verify(const struct sctp_chunk *chunk, > > const struct sctp_association *asoc) > > { > > /* RFC 2960 Sec 8.5 When receiving an SCTP packet, the endpoint > > * MUST ensure that the value in the Verification Tag field of > > * the received SCTP packet matches its own Tag. If the received > > * Verification Tag value does not match the receiver's own > > * tag value, the receiver shall silently discard the packet... > > */ > > if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) > > return 0; > > > > > > Found by Linux Verification Center (linuxtesting.org) with SVACE tool. > > These issues should all be the same with Linus's tree, so can you please > submit patches to the normal netdev developers and mailing list to > resolve the above issues? Given a lack of response, I am going to assume that these are not real issues. If you think they are, please submit patches to the network developers to resolve them. thanks, greg k-h