Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2278473pxb; Fri, 8 Oct 2021 04:49:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3sxhhxXFVVcCvsYuftF70lnq1y9sTI8a4aNth6yg6KoUO+6ocNdeul9ZzPMraAJJS8mhZ X-Received: by 2002:a05:6402:438d:: with SMTP id o13mr12488904edc.0.1633693753311; Fri, 08 Oct 2021 04:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633693753; cv=none; d=google.com; s=arc-20160816; b=M3gajz0Swp0/a442o+SXQUVdezP7Lrn9euQtUrYH5APrNb7rPIil+afA3XXC9MW9wJ 2o6lQ6Gcxt0T0+hnVkHgMnGFXRDcPnnC38YjEVqvn7/vSiDbw84P7PR80nlKYmn7F3h7 sJgo77aGkkQ8hXa5IlnEHU8qrDKflkwN7ZvcDP31aqeSKLRDshJzG/3xRHMWYr9VMo+S npebEFjv704zsWjgCYYm3FrMUGPwNUcsL5WyAoff6qib1nfvGzalMEtcLQISUBREPrSS OQTY8c88d0apu38EjTPrDu2bqJoUy/Xn2kY+vUOUzGZG/rnTNGTxCznUEZLubrKYQh3H Ry+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=G+WK735ccUCpMFQm7Q8nBX5GaypGgZtDzq4g+mYelmM=; b=hYDUhE9MjFle7SeTEOq6Z6UOPa1v8arurCiSXVzolbdHaxMP4OVwON3og+eahB3JOG JrHIBirWFfV7lZeSdmPmyysDZOapar8Gw99CdxHX4UOp4Yi0tfnggdh6SV+bef4VdQeh nMCRhGAoB8KNw7qkqURV+NIBdruEsJJ3ZfsLly5JdMIabGTM9t9bAZh1GT6yEs5fiO26 0qS4YQHXOSdlU/9+G3JUypu038bu1ostDqBC/aSMgMz5AIOJi0bLDb/g9He7+37Emat9 7QXUlOKwJEbugtPdj/zcjFeK+n/rwc5QtUcZqtMkZISg5+/Q3vnXQL4JqnWq6BFseoKI DpFw== 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 f11si3904965edd.168.2021.10.08.04.48.47; Fri, 08 Oct 2021 04:49:13 -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 S242266AbhJHLtW (ORCPT + 99 others); Fri, 8 Oct 2021 07:49:22 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:51239 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242880AbhJHLr6 (ORCPT ); Fri, 8 Oct 2021 07:47:58 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1N7AEs-1mpUBR464C-017Tsv for ; Fri, 08 Oct 2021 13:46:02 +0200 Received: by mail-wr1-f50.google.com with SMTP id t8so29118571wri.1 for ; Fri, 08 Oct 2021 04:46:01 -0700 (PDT) X-Gm-Message-State: AOAM5325/qBWdybYF81mMoVJQxIkXJHfvZWj1/b00DQdrDupZij9/Ynv sYBRDjleArPqQtMtHSQO76AFrGdykxeaZx5DTJ8= X-Received: by 2002:a05:6000:1561:: with SMTP id 1mr3318468wrz.369.1633693561692; Fri, 08 Oct 2021 04:46:01 -0700 (PDT) MIME-Version: 1.0 References: <20191211212025.1981822-1-arnd@arndb.de> <20191211212025.1981822-9-arnd@arndb.de> <29QBMJU8DE71E.2YZSH8IHT5HMH@mforney.org> <20211007160634.GB7074@brightrain.aerifal.cx> <20211007165158.GC7074@brightrain.aerifal.cx> In-Reply-To: From: Arnd Bergmann Date: Fri, 8 Oct 2021 13:45:45 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control To: musl@lists.openwall.com Cc: Arnd Bergmann , Rich Felker , Michael Forney , ALSA Development Mailing List , Takashi Iwai , Baolin Wang , y2038 Mailman List , Linux Kernel Mailing List , Mark Brown , Baolin Wang Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:+hFh6TMhzooG835U1FXgefHtJnVouZBVAOuU5np591EBrvwkVqB /Ja6iPzKmnOLDf1JNrA0yLTl5aUkhJsA19gwecRxwo3LDCTIC3112jhUO4n7yajGETc+wIK P4BalAzAcc6gAUNemrDeOsBAT2e+5nnt3Jo2J+Ykyc2FP+tJDI7GxbQCZRR9Pk/7dHLyA8t KJmxmnbOx4l4KqmgNRqrA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:r9wJz8rfA4s=:FS5F5UyAlXWqzHTC2rHBIh zFJMXOQqk5WXTvOW22svwUArEdTib/yrnP+ROgDCsP1j1T9gqnoeKF0qRU/zImMv1937oayTr 5RSZgWwOpH0Lnr7r+TN9tiVkMsP7kLyZ8n3TeZj5Bf2zRAaUps2qS2m+kw02trybQ83wetl7X RGbcKsu64yOhJotfspnZOW+DPfsn6shH2phb5xjCe8god73QWvOTmPaa4pCNxlguQljLUTDUY 9U1BaHyN059r4r32UHREPLygaN9+Drfe4rZqvqRkOdecdyfPXps6Nhq4EWNgKsr4m0VUGpfoA X1Dbc4T88gjs6U3OwXOeFJs6PvlCy4VxILsB1OQNbetZcDZ9qdHgfKxEwlHYms2c0mnTyPrOz 2xVrPPcQjLfTchM0XCU5BdrblT5vBlTjAu8tINGzMqASG9hCWQMgxfm8QWRUE5M+ctrjXto0x vnLpNRpDsSJB1w89jY4ba94C8js1YlRawof/tdzo6UMNT3ixFMk9SBHt96QoeJahxQWSZEHtA OQfboLzQiwfjmdBBMgmITPmmZMMSOzi/mMaPM1GckHPdNcUqZBzqVTDQlg2bY1y9osutcd5Qn oozmSa435UmJsykZWcDVt8FYmAxpFRyHZMbRDGnHH7CkNS7kT+PdsJsr00RJwI7qG2yN7XODn QlzTujy7dyWhbZ3uJWlINK4eilSfGOjqlCnVUlaPBWvdpUeEx6BRJdawWGRS8MT7ZmaUrNshO MkM/WQdYA1UbNo+igC4dPachrWAimyufKMHj8g== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 8, 2021 at 1:11 PM Takashi Iwai wrote: > On Fri, 08 Oct 2021 11:24:39 +0200, Arnd Bergmann wrote: > > > > I've tried to understand this part of musl's convert_ioctl_struct(), but I just > > can't figure out whether it does the conversion based the on the layout that > > is currently used in the kernel, or based on the layout we should have been > > using, and would use with the above fix. Rich, can you help me here? > > So, at this moment, I'm not sure whether we should correct the struct > at all. This will lead to yet more breakage, and basically the struct > itself *works* -- the only bug is in 32bit compat handling in the > kernel (again). I'm still unsure if the musl fallback code is correct or not. > The below is a revised kernel patch (again untested), just correcting > the behavior of 32bit compat mode. 32bit apps on 32bit kernel work > fine as is, as well as 64bit apps on 64bit kernel. Right, this should cover all cases of the ioctl itself misbehaving. In addition, we still need to disallow the mmap() interface on compat kernels then. Strictly speaking, we could allow the snd_pcm_mmap_status but not snd_pcm_mmap_control to be mapped, but I'm not sure if that's better than disallowing both. Arnd