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=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 F0193C433E0 for ; Thu, 30 Jul 2020 08:38:44 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C79E6204EA for ; Thu, 30 Jul 2020 08:38:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C79E6204EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B019D87B2E; Thu, 30 Jul 2020 08:38:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7icZtL3e01Pq; Thu, 30 Jul 2020 08:38:44 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 22D9887A72; Thu, 30 Jul 2020 08:38:44 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0E7FDC0050; Thu, 30 Jul 2020 08:38:44 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 50010C004D for ; Thu, 30 Jul 2020 08:38:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3D3A187A72 for ; Thu, 30 Jul 2020 08:38:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LNT2XYUema8d for ; Thu, 30 Jul 2020 08:38:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by hemlock.osuosl.org (Postfix) with ESMTPS id 76BC387ACE for ; Thu, 30 Jul 2020 08:38:39 +0000 (UTC) IronPort-SDR: tMzCEsTTG0njbJPsYN97XRBNkwlDPpUxkoxV76Ihe4XblInZ7XGyguRYUmGe1DJmA+34GjdZXy /vjX4uFdiDsA== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="139100412" X-IronPort-AV: E=Sophos;i="5.75,413,1589266800"; d="scan'208";a="139100412" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 01:38:38 -0700 IronPort-SDR: bu9+V7we/ln6rOtutU8VW/C7vRqStryaQhZ5FopFJpxPzgTrfnd9ppiLVy5XN+Il+YKNfCbadZ hmcqCWQkAPrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,413,1589266800"; d="scan'208";a="394921540" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga001.fm.intel.com with ESMTP; 30 Jul 2020 01:38:35 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1k145B-004slM-Ry; Thu, 30 Jul 2020 11:38:33 +0300 Date: Thu, 30 Jul 2020 11:38:33 +0300 From: Andy Shevchenko To: Arnd Bergmann Message-ID: <20200730083833.GD3703480@smile.fi.intel.com> References: <20200726220557.102300-1-yepeilin.cs@gmail.com> <20200726222703.102701-1-yepeilin.cs@gmail.com> <20200727131608.GD1913@kadam> <20200728130632.GI1913@kadam> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: Niklas =?iso-8859-1?Q?S=F6derlund?= , "linux-kernel@vger.kernel.org" , Bartosz Golaszewski , syzkaller-bugs , Linux Media Mailing List , Peilin Ye , Laurent Pinchart , Sakari Ailus , Vandana BN , Hans Verkuil , Mauro Carvalho Chehab , Ezequiel Garcia , Linus Walleij , Dan Carpenter , linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [Linux-kernel-mentees] [PATCH v3] media/v4l2-core: Fix kernel-infoleak in video_put_user() X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Thu, Jul 30, 2020 at 10:15:24AM +0200, Arnd Bergmann wrote: > 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. It was possible to "fix" (mitigate to some extent) before libgpiod got support for several events in a request. Now it seems to be impossible to fix. AFAIU we must discard any request to more than one event in it. However I'm not an expert in compat IOCTL code (you are :-) and perhaps you may provide ideas better than mine. -- With Best Regards, Andy Shevchenko _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees