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 C67CEC433E0 for ; Thu, 30 Jul 2020 13:49:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8148208A9 for ; Thu, 30 Jul 2020 13:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728852AbgG3Nta (ORCPT ); Thu, 30 Jul 2020 09:49:30 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:39211 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726281AbgG3Nt3 (ORCPT ); Thu, 30 Jul 2020 09:49:29 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPSA (Nemesis) id 1M7JvQ-1k8qZm0vgC-007oJg; Thu, 30 Jul 2020 15:49:26 +0200 Received: by mail-qt1-f178.google.com with SMTP id s23so20305529qtq.12; Thu, 30 Jul 2020 06:49:25 -0700 (PDT) X-Gm-Message-State: AOAM533BMn694DConxOl9d3hpveys2uKfWHhCH4VJMHP/BuqPLu67ulP oOErG67Wk6fJ4GggcbgMxk2Ityg9neRED9OnB2g= X-Google-Smtp-Source: ABdhPJxYt4H9vHzfASu+mtn83yjSQoOpA3J4Tjf50fTb26SWJsSPR5JCjW96j8TGyMZE7WFUEvwkFXswX6oFLGrVaRE= X-Received: by 2002:aed:2946:: with SMTP id s64mr3072428qtd.204.1596116965004; Thu, 30 Jul 2020 06:49:25 -0700 (PDT) MIME-Version: 1.0 References: <20200726222703.102701-1-yepeilin.cs@gmail.com> <20200727131608.GD1913@kadam> <20200728130632.GI1913@kadam> <20200730083833.GD3703480@smile.fi.intel.com> <20200730114842.GH3703480@smile.fi.intel.com> In-Reply-To: <20200730114842.GH3703480@smile.fi.intel.com> From: Arnd Bergmann Date: Thu, 30 Jul 2020 15:49:08 +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: Andy Shevchenko Cc: Bartosz Golaszewski , 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" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:4L8J6U7u4enMispHGwLPSaPdYn/3ag24Ug7NY8p+/yQf2qTb+A0 H4ZCK7qUorpCmcWBV6zNckHjpPaCX6hIYOxi/mzodf2FLXeG6r7+BItc1RahU+89xVkEhoX tlyma2oxQqAzKJKlCPrU49rXpS5Rp2wS9g+cMUX6FnEgHXcbZ4b6skOhkIpBJJhNttfXuED rj2ljDoR3WlpToDR1FJfg== X-UI-Out-Filterresults: notjunk:1;V03:K0:ixAp1TSKQ9o=:lfxiAtY+WA2NeLrtT8BIe7 y2NCq/AYh/izuO/j2j2tgr/mOkAYTF1F61UGPqtqKgD3SdpXLiMRu4f5RS9u0WFOeC98wTECO yv/qN9zj1uUqtFqmXmaFc6VKIxeS0h6RXpcDVvdwEDsgGX/d5JqlOwLich9AeUcoiJKmeRXNz hLI9t9mM5Ia/C/p1Ljls544WtMO89761OCJtrHyXbtBqQS+ocFxm9Txw8jEWaa3JjMpbW3npt 0m4ktsMvi4IKROQ+ly84giRSq+PiTDfMtUyl3VSPIpfpgLoRJKCrr0VERRPbnya6m+SP/QMTa NZiv2bkex2vVOw1HVjsSZQYXKgwN+XliVlEhEyOwCt7FIlGMGA0Ni5gYAu1T84fHB2tUMiZ6r Rh6m9cKZQPKqcIVTaYkzTgvyBz2n0uw3LiSVhjOAPXeXr0lyHnpreLOGMyTfiRLCjFbn5hlaF K6ZFcFP5QiXw39OLY8Tsrn8joLoYWQ9gM6sjUDFp+Lk4XG2YZu1V82Y7Zod3+vBldx2piLmFU K0+6WMo8eb653bboZbER1CH+j/WclHd9LUUqzXsOzYggqpt/vNjvjeYcBBz9VZSoN79+lCyfS 11tLXlSe/inMa3B04PSMpZj6X2oqeRCBD4dfzeubks3OK4Aa8QBqt3RgwFtUXTgErMTv0dqjP /SFhLZf/VEaFWE9OM30/LLnqt1ttidERnzxfgtB73HljOzdTOGnLtAIOrfwPZZKsfdASu7snO nhSYBHM88Sm079y7Kw4zGp75vpEotnF37JNj7ZAfy0cSGKLYisKA8S8v1aBcDY6rKO/82gob8 sbgwU/LRQUpDy0Hsm2kbHtRtGyE666sxoW4AN7PdZ/5WYziuGTo54Gu+k6IcgrUg1kB8uZ1 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 1:48 PM Andy Shevchenko wrote: > On Thu, Jul 30, 2020 at 11:18:04AM +0200, Arnd Bergmann wrote: > > The in_ia32_syscall() check should be completely reliable in telling whether > > we are called from read() by an ia32 task or not, and we use the same > > logic for input_event, which has a similar problem (on all compat architectures, > > not just x86). > > By the way any reason why we have to have in_ia32_syscall() instead of > in_compat_syscall()? x86 is the only architecture that has different struct alignment between 32-bit and 64-bit processes, so others don't have this particular problem. On top of that, x86 also has two different 32-bit ABIs and only one of them needs the workaround, while the other (x32) uses the same struct layout as x86-64 and must use the normal code path. Arnd 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 74421C433E1 for ; Thu, 30 Jul 2020 13:49:34 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 471AA208A9 for ; Thu, 30 Jul 2020 13:49:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 471AA208A9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de 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 fraxinus.osuosl.org (Postfix) with ESMTP id 1EA0786D5B; Thu, 30 Jul 2020 13:49:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cCgYJwoheFCN; Thu, 30 Jul 2020 13:49:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7F97286D52; Thu, 30 Jul 2020 13:49:32 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5BA69C004F; Thu, 30 Jul 2020 13:49:32 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id C5341C004D for ; Thu, 30 Jul 2020 13:49:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B116D86D5B for ; Thu, 30 Jul 2020 13:49:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cSdyWEQGYGbi for ; Thu, 30 Jul 2020 13:49:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 7D4EB86490 for ; Thu, 30 Jul 2020 13:49:29 +0000 (UTC) Received: from mail-qt1-f172.google.com ([209.85.160.172]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPSA (Nemesis) id 1M7aqD-1k97Yh1Kqz-0081EV for ; Thu, 30 Jul 2020 15:49:26 +0200 Received: by mail-qt1-f172.google.com with SMTP id h21so13947719qtp.11 for ; Thu, 30 Jul 2020 06:49:25 -0700 (PDT) X-Gm-Message-State: AOAM530EZQ+w1EtL+tH5/rq8oNe+KNWowu6D4TFg9l3biOQdssUQO9L7 xr/8xJP6oPabL9eNyxLnxFObDBSticHgUkg0c8w= X-Google-Smtp-Source: ABdhPJxYt4H9vHzfASu+mtn83yjSQoOpA3J4Tjf50fTb26SWJsSPR5JCjW96j8TGyMZE7WFUEvwkFXswX6oFLGrVaRE= X-Received: by 2002:aed:2946:: with SMTP id s64mr3072428qtd.204.1596116965004; Thu, 30 Jul 2020 06:49:25 -0700 (PDT) MIME-Version: 1.0 References: <20200726222703.102701-1-yepeilin.cs@gmail.com> <20200727131608.GD1913@kadam> <20200728130632.GI1913@kadam> <20200730083833.GD3703480@smile.fi.intel.com> <20200730114842.GH3703480@smile.fi.intel.com> In-Reply-To: <20200730114842.GH3703480@smile.fi.intel.com> From: Arnd Bergmann Date: Thu, 30 Jul 2020 15:49:08 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Andy Shevchenko X-Provags-ID: V03:K1:AV1f4aqAuWJl2DAF3Zomb0JjmcPnEe0XE8DHCEoBIjTQYmW2xH/ gBUbJG05Nr/NB9qPLHwFydO+/VaLBEzFZEUn49dD8iuiW/AHcCKGxt05iPGis96gXrRz7mx pCmwrWqRMnSioOOYnS2SHB94iwBhjmZS3jhw4LuDmNJXRAzZpZ2Th2Z8oKHvgolnqEHUBGy Bg+ayXfPs10rMLX9S664w== X-UI-Out-Filterresults: notjunk:1;V03:K0:cjPOfQy/Ygc=:L9wA6TK0SlSRe9p6vaBJBs vEaVR2UDZXAEray01AsMGNmMfd1h/1wU2prjvVYN/MPhKLz1/nWHnNX0g7PuDw0KPlereW6mj dBdiFAL38ew4ZmItyOKYtZVqQEWikF7jZx7dGamjTgccaPKlHNFGYnWhfG2fetoN6PnMfvL4u 2HK8QKz2ORt3sM5PSmAQKAR4UxFwo73xUchE1PSH1QG5rMU1ta7TzWFfPkesLQPECDnL7EI3k sNiiR8a3tNvtQPkwsZP1iSWpez/oA7FICYLGbqXP4/fC0wWqd2DifhQxixFb2NxsphV0Um/pg IyN8f5pfcS0Uu6SrFH6Zvui5uSzhUcs5XvVUO63JEiv0OtKQzPztQL7TvZUQR99I/3SFV6gQr hipUo2L0XWaD57fAw9Mix0aU1eaVVLwRDu/gIastqs0TeOadS841ob7hMs+Rv9NP2bBKLRKgt fngOWWh0iiPxFZ6Z61GTnAFdQh3O/u6VEEOQzhju9uvskINuHehSgrCwytChvfSSqWyW4wEu7 QXmLu7G3/vO2dUUstWY2BZ5XAS1d1glTddJ+lb4j/rV/nVtTnsN4zF/jzn/k01yugxKlwG/7v a9zZLQHnIc+qRiExUll05kI1u384FrrbeZnMWpArkgrog3rIz5aQxLzAw5212bxe6zitHWY5h hR/GTx2mS4DiTqF7GuJpfE4VFiYDYYd/O3WOuqKwwWsW1EkPEW+oTWN02n+hBEjXFSXaL6ONA GptcLeDzJy6rfeYjxHrcq4mJa9lpOxVpIlN5VJGvoA7yyse98roL9Ul3L5Oks6aPFzeovg/BH eCkfgtew6E5p4ckHnZVcxRMVa9PEo7pAwFEy8jIn6r09aD76n38Ley9aAH2SLK+R8b5Qct/ Cc: =?UTF-8?Q?Niklas_S=C3=B6derlund?= , "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 1:48 PM Andy Shevchenko wrote: > On Thu, Jul 30, 2020 at 11:18:04AM +0200, Arnd Bergmann wrote: > > The in_ia32_syscall() check should be completely reliable in telling whether > > we are called from read() by an ia32 task or not, and we use the same > > logic for input_event, which has a similar problem (on all compat architectures, > > not just x86). > > By the way any reason why we have to have in_ia32_syscall() instead of > in_compat_syscall()? x86 is the only architecture that has different struct alignment between 32-bit and 64-bit processes, so others don't have this particular problem. On top of that, x86 also has two different 32-bit ABIs and only one of them needs the workaround, while the other (x32) uses the same struct layout as x86-64 and must use the normal code path. Arnd _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees