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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2048AC433F5 for ; Fri, 8 Oct 2021 12:14:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 76C4760FC2 for ; Fri, 8 Oct 2021 12:14:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 76C4760FC2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3994D167D; Fri, 8 Oct 2021 14:13:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3994D167D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633695275; bh=vqMyITl6Aqvd/V43mapMw3Cy+moJFfU/RrmyU7784Y4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Pn3CjX4hbLA0Tm9zf8b2l2/aqtT3qp91PbTVWVheioayElbe2klWcULxGMHnRXQXb bF6utavarbqT4QnmlUl1KB0Khk5RRwHlCvEIQU2iye1etfrXWR+jOTbjSWAvQQuzoZ FQ/nYA98s5cDG/chtaIxyr7+JM3j9fEDnuRncsTk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B7962F80229; Fri, 8 Oct 2021 14:13:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4E424F80246; Fri, 8 Oct 2021 14:13:43 +0200 (CEST) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 11DFBF80229 for ; Fri, 8 Oct 2021 14:13:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 11DFBF80229 Received: from mail-wr1-f50.google.com ([209.85.221.50]) by mrelayeu.kundenserver.de (mreue010 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MirSu-1nDd9d0b8G-00etOv for ; Fri, 08 Oct 2021 14:13:33 +0200 Received: by mail-wr1-f50.google.com with SMTP id s15so29267024wrv.11 for ; Fri, 08 Oct 2021 05:13:32 -0700 (PDT) X-Gm-Message-State: AOAM5320X6QZPGNhMkUr/2X36k0PiaRly9Qiez3K5nUCTw3hE4YqQmFg qMnoStqSFSHK1ehDb9VpsIgkRCrmwQ/6HhX/TDA= X-Google-Smtp-Source: ABdhPJx1A2D3uT0vzkwBBgcqCmigtym207jBkyjcfjbAUCVSC7jvNZMRoRn37wH1p1cCJbv0expgQMHr7/L53iVVxso= X-Received: by 2002:adf:a3da:: with SMTP id m26mr3519436wrb.336.1633695212568; Fri, 08 Oct 2021 05:13:32 -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 14:13:16 +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 Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:yx/M4maUOTgoKo8rX5vFvoHw9fM9UZ9S/SmSvCfv9deVncDwaXY Jls94hUHR6UcNPLVFAv5pSKshR5Wr9tE5z1rA/vKi5mUfp3ThbjKKfHhTEtDmrm+3ZRlOat WMQ3zLuIt3rngz35d22rHTyeBjQmCf0MCsyWr8s0/ictl9ziqJfbVK8/FJzloiuM8Z75RZs rp2n2olSYAkYA68q4ou5g== X-UI-Out-Filterresults: notjunk:1;V03:K0:5ALdFe/AGmQ=:q5FD/BKzvBlcAxZuooUZtp 2mxKo3y2YJLV+tTv0FyNJ9lTjY67i64VlYYIK0fKQAq4Pq35VhksZzuID7eANXEIQb+UavECF thdiWFp4Kx+PuuD7Mbd5NP6PMRHO0OmFJXUP8aejUimUTK8/mRs8ASvYGGYtQDJ5SUfrawphz 6voVQU/4YmakUVyBzmk1ckCUKrbNd59YchTeRMdbRyM70qoxI9uTSyd/15ie8EA2HQvYUGycn /FbUa2KRSL3CTua0qA05cUgaFHpS3HjhgABFuydYg+XICPbNXNljfk/hbLZOCdZUm3lgaWPnE SvARpRbd/wsY3yHnTr2BztqDRqIG8cmPYi4Y6CbYDbBVUvPhS5CzznSkrcGJlNDWbrIIOqlLz hgr2ZTfykUPtKNgxvxVIake1S+65eNcgWD5WkF0qjUVwATMGn/0Wxbr65TYee99JM1xZfO3Ke CDO82s/DaCJnb1VSVllMgszSGGKS9pLPlIDzCz2J9Pp5DPnWI7T9RD720YmHoo0BdDCXbJb1q ecxjXbcqBSnlu2QzwJbHswh2QB8ZZvte+z1wNMwTaaSwrmMOK5KBp/7E8BaxV+qoJnkMVrTYK 8WuSamGsuRrz/QE3wcuJK9XqCWpkWvIlXLW3u/2L4BiPV0VgEXikqvwXRsEtGBGhIJMPMwTVR Ws4qSo5ETj2/dF51nzXTihnytuDMuEqUZYwodJ74jlBMlaQB6Df81r4ZNd7XxFsX87Gpe9Tf/ YcceLOQWhNmvFeiH3Hfe+n2EdftAojsKWU8HijvHlKelyXdvMHRlqvufkto1DPyVMPRj4sVJD 4Ge9vpzhBoGgKYs3RvctL5SuVdmZ275+b3TQ4pKJrFNmDd/zLBTW5gOw55yG7Fux/qJjuyylz c2dVoOK7GyNlnb/GHTMA== Cc: ALSA Development Mailing List , Rich Felker , Arnd Bergmann , Baolin Wang , y2038 Mailman List , Linux Kernel Mailing List , Takashi Iwai , Michael Forney , Mark Brown , Baolin Wang X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Fri, Oct 8, 2021 at 1:53 PM Takashi Iwai wrote: > On Fri, 08 Oct 2021 13:45:45 +0200, Arnd Bergmann wrote: > > On Fri, Oct 8, 2021 at 1:11 PM Takashi Iwai wrote: > > > On Fri, 08 Oct 2021 11:24:39 +0200, Arnd Bergmann wrote: > > > 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. > > IIRC, the compat mmap is already disallowed even for the > SNDRV_PCM_MMAP_OFFSET_CONTROL_NEW (in pcm_control_mmap_allowed()), so > no need to change around that. Ah, right. I think it was meant to become allowed as part of commit 80fe7430c708 ("ALSA: add new 32-bit layout for snd_pcm_mmap_status/control"), which did allow the snd_pcm_mmap_status to be mmap()ed, but it appears to be the rare case where two mistakes cancel out and we don't have to change the mmap code. Arnd