From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74CDDC433DF for ; Fri, 15 May 2020 06:33:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50CD72065F for ; Fri, 15 May 2020 06:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726525AbgEOGd1 (ORCPT ); Fri, 15 May 2020 02:33:27 -0400 Received: from verein.lst.de ([213.95.11.211]:55034 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726205AbgEOGd1 (ORCPT ); Fri, 15 May 2020 02:33:27 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 499BB68BFE; Fri, 15 May 2020 08:33:24 +0200 (CEST) Date: Fri, 15 May 2020 08:33:24 +0200 From: Christoph Hellwig To: David Miller Cc: hch@lst.de, kuba@kernel.org, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] ipv6: symbol_get to access a sit symbol Message-ID: <20200515063324.GA31377@lst.de> References: <20200514145101.3000612-1-hch@lst.de> <20200514145101.3000612-5-hch@lst.de> <20200514.175355.167885308958584692.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200514.175355.167885308958584692.davem@davemloft.net> 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 Thu, May 14, 2020 at 05:53:55PM -0700, David Miller wrote: > You're not undoing one, but two levels of abstraction here. > > Is this "ipip6_tunnel_locate()" call part of the SIT ioctl implementation? Yes. Take a look at the convoluted case handling the SIOCADDTUNNEL and SIOCCHGTUNNEL commands in ipip6_tunnel_ioctl. > Where did it come from? Why are ->ndo_do_ioctl() implementations no longer > allowed from here? The problem is that we feed kernel pointers to it, which requires set_fs address space overrides that I plan to kill off entirely. > Honestly, this feels like a bit much. My initial plan was to add a ->tunnel_ctl method to the net_device_ops, and lift the copy_{to,from}_user for SIOCADDTUNNEL, SIOCCHGTUNNEL, SIOCDELTUNNEL and maybe SIOCGETTUNNEL to net/socket.c. But that turned out to have two problems: - first these ioctls names use SIOCDEVPRIVATE range, that can also be implemented by other drivers - the ip_tunnel_parm struture is only used by the ipv4 tunneling drivers (including sit), the "real" ipv6 tunnels use a ip6_tnl_parm or ip6_tnl_parm structure instead But if you don't like the symbol_get approach, I could do the tunnel_ctl operation, just for the іpv4-ish tunnels, and only for the kernel callers. ---end quoted text---