Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4562133yba; Wed, 17 Apr 2019 14:17:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPn8um5/mcgvK8/cR4h4U9k2Q27pqUjSCHbD26iZA0jyORxIPK4IgI4SKig8oIp1IJrZiW X-Received: by 2002:a17:902:7b87:: with SMTP id w7mr15849285pll.247.1555535870888; Wed, 17 Apr 2019 14:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555535870; cv=none; d=google.com; s=arc-20160816; b=PJ/A3SO66yvaItcbedwJHDybdh+gXEOVFqblG3qYWRJlVi7YDmqEHoYrqvZQ8UtyHm XlZrXee9OEEADwlIrMsDH6z75+qfd8n3erBltoXBur/MQ6fc4Lc6DJwEGWcoUZZzGRYZ oZDqsuYNDXn6ScVtJ3NMFrHVUhKS5GeXgZNL8W3oWwNPoY4eUscnfJT8gxho9KkKh97/ hAq9Zma8KFsY2UNnTcyTHGsNnfGKLFEd9GMSfPZN1pCuq0CaQ/npHJqMrTI28Eei3JSu P9Mtb/f4Gu5mqsNzdQowPlE5Bfgip+kwqgkQHQHEwwwB6uIjpurap52o9QLn5quogbZ+ fcXg== 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=diWji8ZfNTh4vzixXt0K67pOWyVeRKNZTUw8udyuNn0=; b=XSH0+hray+hmuNRkxIMEpfz09fqgT5o0dxIKp8x/tRpPvD2Y9fK9vPSI3wYpIxVMuW PRevRc5mV/kW7/UvLsYr8lA9hZDoQLwfQfBau7VqIhty4iC+cg4/WEJn7q4VI5r8uOKE llIGV4bebOU3Wb09YuqyH7xvSRDKYhpoaSYlLvyzHu7/1xMyqViwuWA4wIfue1IoBOpZ mYxRAnCEc8GcPgj4Nisi5m9bB+0+3HQtLb/igmybQk9nG27uJvxH5JrDbZqxotVWwtT4 lr4bCybihVIttAZMNG7A6ksjORwArf55LYySYGlAI5xApNkUJi/PaNyptT9exKeryqWP W4UA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si38508124pgc.304.2019.04.17.14.17.35; Wed, 17 Apr 2019 14:17:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733245AbfDQVQl (ORCPT + 99 others); Wed, 17 Apr 2019 17:16:41 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:50860 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727013AbfDQVQk (ORCPT ); Wed, 17 Apr 2019 17:16:40 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hGrv4-0007ri-3U; Wed, 17 Apr 2019 21:16:38 +0000 Date: Wed, 17 Apr 2019 22:16:38 +0100 From: Al Viro To: Arnd Bergmann Cc: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org, linux-kernel@vger.kernel.org, Paul Mackerras , "David S. Miller" , linux-ppp@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v3 04/26] compat_ioctl: move PPPIOCSCOMPRESS32 to ppp-generic.c Message-ID: <20190417211637.GV2217@ZenIV.linux.org.uk> References: <20190416202013.4034148-1-arnd@arndb.de> <20190416202013.4034148-5-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190416202013.4034148-5-arnd@arndb.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 16, 2019 at 10:19:42PM +0200, Arnd Bergmann wrote: > +#ifdef CONFIG_COMPAT > +struct ppp_option_data32 { > + compat_caddr_t ptr; Huh? compat_uptr_t, surely? I realize that compat_ioctl.c is bogus that way right now, but let's not spread that crap into the places where it's harder to find... > err = -EFAULT; > - if (copy_from_user(&data, (void __user *) arg, sizeof(data))) > - goto out; > +#ifdef CONFIG_COMPAT > + if (compat) { > + struct ppp_option_data32 data32; > + > + if (copy_from_user(&data32, (void __user *) arg, > + sizeof(data32))) > + goto out; > + > + data.ptr = compat_ptr(data32.ptr); > + data.length = data32.length; > + data.transmit = data32.transmit; > + } else > +#endif > + { > + if (copy_from_user(&data, (void __user *) arg, sizeof(data))) > + goto out; > + } *UGH* Do that in caller, please. And sod the flag argument...