Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6119360pxb; Mon, 8 Nov 2021 03:33:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWVDYJeCfE54ixVLaP7jkbqXzeOEK8dmWVHxD+0IquW46wdB0lVG0+XxDwN/rlVm7wMqAV X-Received: by 2002:a92:6408:: with SMTP id y8mr56136735ilb.34.1636371198243; Mon, 08 Nov 2021 03:33:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636371198; cv=none; d=google.com; s=arc-20160816; b=WsGhbVhxtDyqBXsYMDpbfjEoHAi5gO7WYRU6Pw+6gKN8hbfEe12L43Zmxok0+IIPM8 HiWw8nF7cP+gfTaK5QVMW/iq5zDuJZORdPN1VAt530RCcbPRbEcRKjXaGD89qRRqw+v4 tb1WlkE4zNTbJHiAHhRP7KKGw5t9Tka/+NcXlj5WbcjKQAcIza9QUC6V3BKCCTg58ClV d/1eVQbV5a8Myzph6BWlv5dy7rbREZCuWDELmC74jySREswR6cXlTqoYVfOZJv33MndF LKxV/rKHVJnAKj41dqGL5YCGzfk3d/a02xUYV5bJyp/5nbtwFVijiAF3Kfg/gNRZiQC0 SZsw== 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=geXkjLTHT0zPGBGtbiCLoRzFP12uGztyeCXvJGjOikc=; b=bKonrWt+LAotKlwcXA/6qorlrnt7Sy2w3JUmZK5O0PjI2kI1NzqXVXsI0tLCjeaaym iV8IvkOv729BydZYUDSgtvRXtycfu9GktnYTHwzMpTDtHkgT2sVcRdObMjzdBDqtB7GE 1E2gUKldASHvLAFx5slX3ShTfvc+YrPN8eLL6NfZa3NlOZgD7NqV0eg0Pps92CZX9UPE y9MpyU0mK9ujq6+2HIB8s2O3qFwyJCncgoHq+R9d+69ZSsDpv+H+jaBDml4OZq/12JP+ F8XyLKiJicTEqjnBJY9eZGTz6sncBwLLMhC9j3OpIf7VncSA75bC62ndqzvTRVElqomE VQkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n16fUCLJ; 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 m2si33182003ilh.104.2021.11.08.03.33.06; Mon, 08 Nov 2021 03:33:18 -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=n16fUCLJ; 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 S236275AbhKHHqL (ORCPT + 99 others); Mon, 8 Nov 2021 02:46:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:38330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbhKHHqK (ORCPT ); Mon, 8 Nov 2021 02:46:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7144561179; Mon, 8 Nov 2021 07:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636357407; bh=fJNkYy2VfWxWOmdLqyNzL495wn67Xy7+DIMPMdlQ5sM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=n16fUCLJPnqKnmqvR1U6WUsVeKbYd0wT1AkaZxkIzivQRITTlMG1RT35OkoSNVvlY w/fmog3tLnVYV52mZ15FDosrID2YjKqii6s5AmhswP6F/d90sq6RAFnQpUK2polsfA mwKe6ddMy4/7FGUN9zbt2wAXSzpJvsIMp4IT+lKE= Date: Mon, 8 Nov 2021 08:43:24 +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> <06ea9fcf-12ab-29af-1621-6b1bb38a2265@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06ea9fcf-12ab-29af-1621-6b1bb38a2265@ispras.ru> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 08, 2021 at 10:23:11AM +0300, Alexey Khoroshilov wrote: > On 08.11.2021 09:57, Greg Kroah-Hartman wrote: > > 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 > > Hi Greg, > > During discussion with the network developers it was defined that the > code is unreachable and should be removed. The corresponding patch is > already in network tree: > > https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=e7ea51cd879c Great, thanks for letting me know. greg k-h