Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1745588ybg; Thu, 30 Jul 2020 01:16:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5WEeWVtnIp7reGLQctcHto1xTWI5FQx+vJH5D+ePrAKdVztoWrWKBjXxpQTn3xddEYhxV X-Received: by 2002:a17:906:b2d2:: with SMTP id cf18mr1400254ejb.551.1596097004791; Thu, 30 Jul 2020 01:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596097004; cv=none; d=google.com; s=arc-20160816; b=XMTluKQvewdgrQm92qPmIaUaKUTnVdjJ3hX2FrOt7g3WjsFx7s1GMXxWTHtsMGkTCC kzNGCYZcedyRUtmbeyyA0/tAAYe5JGaVN7TsatDc/oR5hIGFlGD5kVah6hzn4rdIgpJK JLBsZ5AY1uBY+Ld8ewG+nxzvqKpePxxvxKK2CO/itHaX5aMKTYVRmPmd2/S+PLUICKUO qIvYCMov4HChvzqpuw+t09cmZkqh96w5ZsQs1MRPvh30cyoH2GqAO9FW1XEsG9zr9d9l uZil2RB/5DHd02g1bal571b8w0Q4RUgmjgUeu7A7nvTTr1SN9FACEGbi2bhH/QPjtj/+ SDtA== 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=mCeRPVsWTC/q/22auaVlYy8jSk8OWmp5NYt3WaYUs6I=; b=tsiJW+apWlOkUqY1D235empHJW855BPJceEGQKNkPMBtElciRjqmWqvLoa4GvHs87k tl0X9X5sMyGdWoXGwwo31HJoHr2RJQCwwYKIbdQP8IlZTLUyPa06DVywf1CAGiBm48vv Qy54eLR9PgSj2Zo8NWYqokHlBT9JKUiZZSHBdGkDa+PE1eOgObrbTBvnC7uOUIgGVoSI woUV2wRvgWmC5YYTUFcmtDzvOuRPqWAUbBk/XzXyXqK7Odg4nwSxXY9BN2oT1J92GkXK hNccsilhKBOqDgJN4DlS4qPrVI+eVJYMlfnP4yGewteDCwmcmgHAati0Rclva/I1EaiD ZpCw== 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 k17si1699443eds.353.2020.07.30.01.16.22; Thu, 30 Jul 2020 01:16:44 -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 S1730052AbgG3IPu (ORCPT + 99 others); Thu, 30 Jul 2020 04:15:50 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:45173 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729032AbgG3IPp (ORCPT ); Thu, 30 Jul 2020 04:15:45 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MY6TD-1kHxuV1Fsr-00YUKZ; Thu, 30 Jul 2020 10:15:42 +0200 Received: by mail-qt1-f176.google.com with SMTP id x12so11210249qtp.1; Thu, 30 Jul 2020 01:15:42 -0700 (PDT) X-Gm-Message-State: AOAM532Ly3J/00BP5r02+s9oIEYyILDMBnNb6VdzpkVQjuqGGB2a34S/ HjU5XYYp2T2kz62PUS2Y/MOmGn9GZbML1uu8iY8= X-Received: by 2002:ac8:5195:: with SMTP id c21mr1813995qtn.304.1596096941108; Thu, 30 Jul 2020 01:15:41 -0700 (PDT) MIME-Version: 1.0 References: <20200726220557.102300-1-yepeilin.cs@gmail.com> <20200726222703.102701-1-yepeilin.cs@gmail.com> <20200727131608.GD1913@kadam> <20200728130632.GI1913@kadam> In-Reply-To: From: Arnd Bergmann Date: Thu, 30 Jul 2020 10:15:24 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [Linux-kernel-mentees] [PATCH v3] media/v4l2-core: Fix kernel-infoleak in video_put_user() To: Bartosz Golaszewski Cc: Dan Carpenter , Linus Walleij , Peilin Ye , Mauro Carvalho Chehab , Greg Kroah-Hartman , syzkaller-bugs , Hans Verkuil , Sakari Ailus , Laurent Pinchart , Vandana BN , Ezequiel Garcia , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , linux-kernel-mentees@lists.linuxfoundation.org, Linux Media Mailing List , "linux-kernel@vger.kernel.org" , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:rvPNdbTTV7PaspPk9G0gnb1jPuuq8fWQC4VHq/Sx6CBresvnL3l tNEWWc3/5FJzPB5NxQZx9mprgop9zm6vIYT5oXYqyEcivzLtClTQcMNu/tKCSRttoPHeW5R ZuUWB9ACTR2fx6p6M7ebBmo3KoffQQz386BmQQsmVmjnQdGrbpuqUvIf5JRzH14mKa3ijSy xcBemIrm27HsLeX/n3ItA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Q+oEQ8b4lzY=:voa7ymqcQ0Gw85U92BLmZd WleBmJHJhjeTVct+sGqSmb5VHOd9vg/U8wdBAajs7qrFZlt5qlTnFYS0gEzA2TPN1V3+MCz+B F2weSfp8HPvbWAYsDOXAY6eellq9j4sfriTaNJDqavBrMHbMK7qAk2mKSCeYrElM9qncJVGhs gSBugGNqB/cAUCuXqpRhxDPRlMCgqO7k3bzV1aArzMLf+fScjWRoSY2CKrashR7z3WMtYJQiL hmLMFkddnSYtCbc/lEh/u+FnpY8265y5v942dBKeIYaq5J4/b+7QbMAKdZRBd0zZVgR1jv3if scHZqcDhQdXcBSnseeIM7QvwoFSt4yZXkPvfQ5LH/u2kYlm1MVK645BYoP5QD4v7OuKNdIiiZ uaD+iWMR4ovnrAG77oGPD6kvi1TGxQVxQyehqSGGXjyE05DEy9TQWFVbSlUUf0ELKtM5bCjky xDmS6Sqxo1kB0HTrQIRC9b7/qKRi3IC03hJlJBm+YXPBDYMgZKmvWF40Wmu7p57jRVDtIxGcM pCUrFhaN+QbqaJxd7Ub+UTdAKEXU/5F++8RcdCaJw+ZLB8jhvx/3d7C0uvdHX1GOLCfcb+0T1 k8+zFwM89tRfQuePNbzt9ogYNtRS+RfCoAA9A7ygXGG1wzgQ8nKP4HvIFUQUTAihBxLLqHSPc itxHa+B64V/nQfYUCwsaZ4EQaUd1b9Da0eOMnAwNwBKVRPeoDOCDrODICrtfv9RTcTyCqorYN CX+K0IeMEqYdL/0bIRzuCsHZ9znEv6HWH7UiwebHXDhwP4lJ8i6Im22pjADK8uaOP5ewBLwUt OIrbKzXqm/X6PVa3IbYFofodkpjo3u4J0ZcKMkdODwvzNuOiHZ7OZYGaCbcFgWV2w0nqdlDxM V5Kb2oeCEUBcuTO2tlxOomO6jn3uPi5qy2R3EnWRWcAHXKcCxZlxNgVgTyYMWwOgj33bIWeMZ d/5pBDqXZl/6R+B4jZMeQcM12vo4bAdVRIj6RYOjpGJQBwQo3Lj5b Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2020 at 10:07 AM Bartosz Golaszewski wrote: > > On Tue, Jul 28, 2020 at 3:58 PM Arnd Bergmann wrote: > > > > On Tue, Jul 28, 2020 at 3:06 PM Dan Carpenter wrote: > > Something like > > > > static int lineevent_put_data(void __user *uptr, struct gpioevent_data *ge) > > { > > #ifdef __x86_64__ > > /* i386 has no padding after 'id' */ > > if (in_ia32_syscall()) { > > struct { > > compat_u64 timestamp __packed; > > u32 id; > > } compat_ge = { ge->timestamp, ge->id }; > > > > if (copy_to_user(uptr, &compat_ge, sizeof(compat_ge))) > > return -EFAULT; > > > > return sizeof(compat_ge); > > } > > #endif > > > > if (copy_to_user(uptr, ge, sizeof(*ge)) > > return -EFAULT; > > > > return sizeof(*ge); > > } > > > > Arnd > > Hi Arnd, > > Andy actually had a patch for that but since this isn't a regression > (it never worked), we decided to leave it as it is and get it right in > v2 API. I would argue that it needs to be fixed anyway, unless you also want to remove the v1 interface for native mode. If this works on 32-bit kernels, on 64-bit kernels with 64-bit user space and on compat 32-bit user space on 64-bit non-x86 architectures, I see no reason to leave it broken specifically on x86 compat user space. There are still reasons to use 32-bit x86 user space for low-memory machines even though native i386 kernels are getting increasingly silly. Arnd