Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp812381ybk; Wed, 13 May 2020 13:51:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMlWTI0dqEctnuRxwmJuNi5X6gfYTWamsgOgytLPdMlqsRb3Xd07bB5Fn2pO0B12KLStO+ X-Received: by 2002:aa7:d3d6:: with SMTP id o22mr1332057edr.310.1589403081653; Wed, 13 May 2020 13:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589403081; cv=none; d=google.com; s=arc-20160816; b=GPPCbFxZuhKnXnjW4AKthYoPSG4Q5rQ+cQ+uq0WcLakEJBy9faFawgAUD88J3PMJip qxBNKk+v7ORIGf6sxHGKU/gxeB5lgmeRCmBKELfpKtAM1+hB/8c0/8EM+bqQyrk8zYgP QOnXYWmEbdwqvoOcAOVpU26A1NMlRqnsBsJDQYrm+8WKzTRXczoaOYgBkcRm9pekKdXa M13Euc1xdeU60mduQChOU1t/gurIiX2ep6Zxm+vJGEQnKdvUJ8B7hAyZqrEs/JDQTAF5 71vlVG+O1VwpMBb10gjhi5VsJZQU9NFnHTs4swy/w0S339GBqancv7nTdKOaxalLlkS5 Sm5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KljfGpTvga690+3IxMJzKiXIwQ+a5Bu7Hch+4BC3tsU=; b=KgE+Hlxc6lWRaSD4wAdzmTTsuUZlnvVqH94Q5PybFd4YS1zVHy4ndtmuET1vD7r2pD TOtCaqqg4JycZyJTnoe5doLOQDWrKW3oilD72iDGCTtpO66upFjzYQ+lZRRlLAmQdSSI NLdNxzk05KsYoNuhVYuqDOCCpJ2/19P6LlRa9Yg2Q/3cngLIfPCVFAxJVryQnIRhvwDc D+mpP6vrbLd8baZt++fUdHOaGGIMTOBE+MbEhZKJ5DE379ZEGog0wAE6tZQmxr0dsnu2 aC56Qfunn1cUjGxUXqxP60mp1R9HBbQI2sIjE7qBlXWQk56Gg4Eo60ejHwoJEmYq3J7h S+fQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si408470eds.384.2020.05.13.13.50.59; Wed, 13 May 2020 13:51:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389792AbgEMQ6x (ORCPT + 99 others); Wed, 13 May 2020 12:58:53 -0400 Received: from verein.lst.de ([213.95.11.211]:47611 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727120AbgEMQ6x (ORCPT ); Wed, 13 May 2020 12:58:53 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id A458168B05; Wed, 13 May 2020 18:58:50 +0200 (CEST) Date: Wed, 13 May 2020 18:58:50 +0200 From: Christoph Hellwig To: Eric Dumazet Cc: Christoph Hellwig , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] net: cleanly handle kernel vs user buffers for ->msg_control Message-ID: <20200513165850.GA26121@lst.de> References: <20200511115913.1420836-1-hch@lst.de> <20200511115913.1420836-4-hch@lst.de> <20200513160938.GA22381@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 09:18:36AM -0700, Eric Dumazet wrote: > Please try the following syzbot repro, since it crashes after your patch. Doesn't crash here, but I could totally see why it could depending in the stack initialization. Please try the patch below - these msghdr intance were something I missed because they weren't using any highlevel recvmsg interfaces. I'll do another round of audits to see if there is anything else. diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 18d05403d3b52..a0e50cc57e545 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -1075,6 +1075,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, msg.msg_control = optval; msg.msg_controllen = len; msg.msg_flags = flags; + msg.msg_control_is_user = true; lock_sock(sk); skb = np->pktoptions;