Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2829552pxv; Mon, 12 Jul 2021 03:00:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxujknZ7Fl0lDyj8sDs8QyNZShLMM43jy3m82Od9vavU3i8ETP7TQgTNM+4C0jKn9IAROkn X-Received: by 2002:a05:6e02:1a43:: with SMTP id u3mr14169363ilv.229.1626084000274; Mon, 12 Jul 2021 03:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626084000; cv=none; d=google.com; s=arc-20160816; b=IrrRzUb1ayGsYMr7yUjd/6Xo5eeMRcecNSfFTpE83kMXOfJ0gVOI0yaoaofqA2Oti5 rFtEXQAX2GpeP8F3oRXcmkakE1pavGzDZ19FCp3aLookNUOYPH6g4xWTXvg0BQytaqJj qtGDkXEjoxqMj/FXB62olqQCrZ2uvC6UdJq7M4hcGI6JPnOFmjKpRjx7T0/hfLwXsC27 RaRx/k+vmSWk85nprjcEYzkRwFs+yZSI5pMv4rMUfAuFe7EBck0TPnnv384ugpCtoj4g 0jdHvCHcZRQJtPux5YWRaO85AqeO3D+EdkGYKfQiBq0y3TCTKnF6fMUqLrdt8gF1CCYY gTaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=Aq0ET5YTdm1rWPpNSi7B0UtAwwipZjr7vSxwvu8q6+A=; b=qskJZ26WRyIMwJapHJTC8/iNOseC0IcJoAEKykycC5aqwvktp/1YoxLVz5MMG85s+e O49105b6MBbJQIHYzxF1PjnXyztm1CDpDa07/I572yyD7iQnWh4AOLOSfmXm6hlP+DcP SGFs0E8pBncp/sxlCIMwST5HqrrQ45C2xb+4a6l2/3KhNwTz5EgBGvWnJ4c5Wc5iPU5H ldJtxdW7Mx0on/xQ84PlmUnz1rLxlrufagwrvhMzf9k0b5MBMfHMadIs9qHx6yp1YdA5 8Grfxi8CIIM74Hgsygxu5pSkyxK7/AK3mlqi3ZUQxHGASUMjUSAtP6KiOV9gKnRw/8cb 7V1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=DVMWWJtS; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t6si18947785iov.63.2021.07.12.02.59.48; Mon, 12 Jul 2021 03:00:00 -0700 (PDT) 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=@virtuozzo.com header.s=relay header.b=DVMWWJtS; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243536AbhGLHHJ (ORCPT + 99 others); Mon, 12 Jul 2021 03:07:09 -0400 Received: from relay.sw.ru ([185.231.240.75]:60354 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236933AbhGLGrz (ORCPT ); Mon, 12 Jul 2021 02:47:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Content-Type:MIME-Version:Date:Message-ID:Subject :From; bh=Aq0ET5YTdm1rWPpNSi7B0UtAwwipZjr7vSxwvu8q6+A=; b=DVMWWJtSkNLQF/ICmSU bW047YV+ka+RNu6XiOdkh7P0ExSAGs6n9Pa20Fl9wfyvD9BCG+gEt5xveo7GX/LsC+s961T1Bt+2r EjHknLjKwndyNObMzC3GBbJpCOGgmIgzL0YaSPMWSKaKkZcwiPdlAg9ZprTpWRQrg+M9Z10QOkg=; Received: from [10.93.0.56] by relay.sw.ru with esmtp (Exim 4.94.2) (envelope-from ) id 1m2pgX-003ew1-9p; Mon, 12 Jul 2021 09:44:57 +0300 From: Vasily Averin Subject: [PATCH IPV6 v3 0/1] ipv6: allocate enough headroom in ip6_finish_output2() To: "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Eric Dumazet Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <74e90fba-df9f-5078-13de-41df54d2b257@virtuozzo.com> Message-ID: Date: Mon, 12 Jul 2021 09:44:56 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <74e90fba-df9f-5078-13de-41df54d2b257@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recently Syzkaller found one more issue on RHEL7-based OpenVz kernels. During its investigation I've found that upstream is affected too. TEE target send sbk with small headroom into another interface which requires an increased headroom. ipv4 handles this problem in ip_finish_output2() and creates new skb with enough headroom, though ip6_finish_output2() lacks this logic. Suzkaller created C reproducer, it can be found in v1 cover-letter https://lkml.org/lkml/2021/7/7/467 v3 changes: now I think it's better to separate bugfix itself and creation of new helper. now bugfix does not create new inline function. Unlike from v1 it creates new skb only when it is necessary, i.e. for shared skb only. In case of failure it updates IPSTATS_MIB_OUTDISCARDS counter Patch set with new helper will be sent separately. v2 changes: new helper was created and used in ip6_finish_output2 and in ip6_xmit() small refactoring in changed functions: commonly used dereferences was replaced by variables Vasily Averin (1): ipv6: allocate enough headroom in ip6_finish_output2() net/ipv6/ip6_output.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) -- 1.8.3.1