From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17088 invoked from network); 7 Oct 2021 13:11:33 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 7 Oct 2021 13:11:33 -0000 Received: (qmail 32514 invoked by uid 550); 7 Oct 2021 13:11:30 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32478 invoked from network); 7 Oct 2021 13:11:29 -0000 X-Gm-Message-State: AOAM533pUzmwQOkGtqdI8YnipsHBcNrV9MU2/cOjQ7i4T4sm/Jff+0as VrfagsSDqgvS0sLe/2WOFwoLgEEw+ww0edMZJWc= X-Google-Smtp-Source: ABdhPJz+35NXT/p5TszOUNgOpymxZVTmTArKWJKi2r6OibnWqxiqzjsuLR4U9FbC9D/iKpGK8f1e5LZYTuC8A3v+RKY= X-Received: by 2002:adf:a3da:: with SMTP id m26mr5182095wrb.336.1633612277427; Thu, 07 Oct 2021 06:11:17 -0700 (PDT) MIME-Version: 1.0 References: <20191211212025.1981822-1-arnd@arndb.de> <20191211212025.1981822-9-arnd@arndb.de> <29QBMJU8DE71E.2YZSH8IHT5HMH@mforney.org> In-Reply-To: From: Arnd Bergmann Date: Thu, 7 Oct 2021 15:11:00 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Takashi Iwai Cc: Arnd Bergmann , Michael Forney , ALSA Development Mailing List , Takashi Iwai , Baolin Wang , y2038 Mailman List , Linux Kernel Mailing List , Mark Brown , Baolin Wang , musl@lists.openwall.com Content-Type: text/plain; charset="UTF-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y9oAsyBfx0A6q3fY1BywgsYbjDdGXMhYGyhEAF T1ZHWLk8BYHclc40BNztcxdYdyFs6WEtXNizPBXw8JCdMRYK5GILzqoOLprhgQvlyPISrZyQx AQPYbcBtMZXOuOAWZzZw== Subject: [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control On Thu, Oct 7, 2021 at 2:43 PM Takashi Iwai wrote: > On Thu, 07 Oct 2021 13:48:44 +0200, Arnd Bergmann wrote: > > On Thu, Oct 7, 2021 at 12:53 PM Takashi Iwai wrote: > > > On Wed, 06 Oct 2021 19:49:17 +0200, Michael Forney wrote: > > > > As far as I can tell, the broken interface will always result in > > user space seeing a zero value for "avail_min". Can you > > make a prediction what that would mean for actual > > applications? Will they have no audio output, run into > > a crash, or be able to use recover and appear to work normally > > here? > > No, fortunately it's only about control->avail_min, and fiddling this > value can't break severely (otherwise it'd be a security problem ;) > > In the buggy condition, it's always zero, and the kernel treated as if > 1, i.e. wake up as soon as data is available, which is OK-ish for most > applications. Apps usually don't care about the wake-up condition so > much. There are subtle difference and may influence on the stability > of stream processing, but the stability usually depends more strongly > on the hardware and software configurations. > > That being said, the impact by this bug (from the application behavior > POV) is likely quite small, but the contamination is large; as you > pointed out, it's much larger than I thought. Ok, got it. > The definition in uapi/sound/asound.h is a bit cryptic, but IIUC, > __snd_pcm_mmap_control64 is used for 64bit archs, right? If so, the > problem rather hits more widely on 64bit archs silently. Then, the > influence by this bug must be almost negligible, as we've had no bug > report about the behavior change. While __snd_pcm_mmap_control64 is only used on 32-bit architectures when 64-bit time_t is used. At the moment, this means all users of musl-1.2.x libc, but not glibc. On 64-bit architectures, __snd_pcm_mmap_control and __snd_pcm_mmap_control64 are meant to be identical, and this is actually true regardless of the bug, since __pad_before_uframe and __pad_after_uframe both end up as zero-length arrays here. > We may just fix it in kernel and for new library with hoping that no > one sees the actual problem. Or, we may provide a complete new set of > mmap offsets and ioctl to cover both broken and fixed interfaces... > The decision depends on how perfectly we'd like to address the bug. > As of now, I'm inclined to go for the former, but I'm open for more > opinions. Adding the musl list to Cc for additional testers, anyone interested please see [1] for the original report. It would be good to hear from musl users that are already using audio support with 32-bit applications on 64-bit kernels, which is the case that has the problem today. Have you noticed any problems with audio support here? If not, we can probably "fix" the kernel here and make the existing binaries behave the same way on 32-bit kernels. If there are applications that don't work in that environment today, I think we need to instead change the kernel to accept the currently broken format on both 32-bit and 64-bit kernels, possibly introducing yet another format that works as originally intended but requires a newly built kernel. Arnd [1] https://lore.kernel.org/all/29QBMJU8DE71E.2YZSH8IHT5HMH@mforney.org/