Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4582417yba; Wed, 17 Apr 2019 14:48:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3Ckxy7D7HBXAxQW251Lp1Sox5absbCCQl8cEIYKPH+9SRI9Rlio8qrC2PzJTv/xyUq+y7 X-Received: by 2002:a17:902:2962:: with SMTP id g89mr42544425plb.264.1555537697420; Wed, 17 Apr 2019 14:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555537697; cv=none; d=google.com; s=arc-20160816; b=fEzwPFfC+UEM1WpRr/i+krpIGc+IBjUCSUprVqyTJrf8wXq1IQ92MDbJ9s1qDfJv2v X27UX38Lb/CwicOB0RmQmZB6WavBY8Scv9wQ30hA7v73O/ad6KoeLtW+481x1OsUxQCM XbCGZU2KwWhoFwdRWSFARHNy3+1aGrh6XfShGAHLl4VE+LcW1On5QTTZ3bGX7kxDvgTZ 3LSBpqjaklysSNG/wTxGJVPjmrOE/WGy5BvPE3CeaVw1fvo4cE5vGj2/C4NQHn38gEEm 5u3/GM2tMcjlnhJ+9l6S3UYOkNxo1rRpuGrXBNexmCHpZc5e41LtX4m9oqj3PQlmGPLN iGDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=zDiTBpfEbk9L0JBEZbIRNNkBl1De1K+96r++3FFrrhc=; b=kS32Xi+yNCTvs0/e4+XEMd0EkRvpPSOE3IFeFC4IPrdAWiG4gzs3rd2XpB2m8arLrJ q8FB7gnW9dbho0zjTHNwp9OiEdm0E3+RW5caat2d+5kmbKTAoAdblTYXerHmZI5MlY0K eYvjmBtjPCILJ/4Ho+fDNkwJJx9yWn75SqZ+Y2nHuRk3DHy6QfdhNAMPgcwdUovQb2AC +e6v4uGU/QXCOYY6tq/3UHd4346vfQXU9W0XJMQbmMML54ClRmD/J5a/PF/MtGxXjPW1 8HTx8jrTnq5VHT8dqoWc036cGhjQqVU2pVOTznVCGswDAg27y7Ek3kIsENG26BKQHKrb dScQ== 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 b5si18269122pgw.359.2019.04.17.14.47.59; Wed, 17 Apr 2019 14:48:17 -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 S2387914AbfDQVo6 (ORCPT + 99 others); Wed, 17 Apr 2019 17:44:58 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:46973 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726162AbfDQVo4 (ORCPT ); Wed, 17 Apr 2019 17:44:56 -0400 Received: by mail-qt1-f195.google.com with SMTP id z17so29083217qts.13; Wed, 17 Apr 2019 14:44:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zDiTBpfEbk9L0JBEZbIRNNkBl1De1K+96r++3FFrrhc=; b=Hwl7CL4ETf3+LigEnoYmVduQeSL0vJACHct/xQbcpOmZvhaVVHZehs6Q5l8F9XtOKO xJJEx70MylKWRjPLaHxB4K3QanNbkFHXsDdDtoDV8r8BDHUVLKFNKy41YgwvNySi+h29 NKZ8d6wRp9aYwH+zSIABP2ZVlpohRUWTaIaxEFfiuz8qnywD4KomtZARUwyJvIjYcXob 5Lsu2rbNQVsoLAgsCQgMmE1eF1GipV2IsfYp7KVEhRDcf7nEj8NpOv+H1QjMzo2RXhS6 qAQE9XsIu+roYPseTs+iEZMKUiyqfxuWl+5wfxKpbBkbBY0OQoAernHbHs16RNSMSDEb noMg== X-Gm-Message-State: APjAAAUdrXYSOEOjIZrVNNYGFPQU993qlz4vDh4UcXdMb4LCxxKGGlwa rKL4YIg8Ob+WxL/9OQZcno03DeOJnQ3KniULvuM= X-Received: by 2002:a0c:d2fa:: with SMTP id x55mr70992108qvh.161.1555537495685; Wed, 17 Apr 2019 14:44:55 -0700 (PDT) MIME-Version: 1.0 References: <20190416202013.4034148-1-arnd@arndb.de> <20190416202013.4034148-5-arnd@arndb.de> <20190417211637.GV2217@ZenIV.linux.org.uk> In-Reply-To: <20190417211637.GV2217@ZenIV.linux.org.uk> From: Arnd Bergmann Date: Wed, 17 Apr 2019 23:44:38 +0200 Message-ID: Subject: Re: [PATCH v3 04/26] compat_ioctl: move PPPIOCSCOMPRESS32 to ppp-generic.c To: Al Viro Cc: Linux FS-devel Mailing List , y2038 Mailman List , Linux Kernel Mailing List , Paul Mackerras , "David S. Miller" , linux-ppp@vger.kernel.org, Networking Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 17, 2019 at 11:16 PM Al Viro wrote: > > 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... Ok, done. > > 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... Ack, changed it now. Arnd