Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2282497pxb; Fri, 8 Oct 2021 04:55:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+saqBXdd4BXk1nGrbRWR6jowYX9uKU5kGx9jb7Ml4pxwlfkDZehXy2XaVbrB8xj/3BO5i X-Received: by 2002:a17:906:948:: with SMTP id j8mr3504835ejd.371.1633694103079; Fri, 08 Oct 2021 04:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633694103; cv=none; d=google.com; s=arc-20160816; b=EQ4aDzrKkkR1kWf1g0WFUnbqX4gidwDXp+/BHLIjIMTpIc7QnIe5UsDVhx9Fbyh6yH HqaMzguZLYBdwL9OL9I057mFahsA7i2+xM23y56KaH+PSPnm/pTFEknYnpqcfR7h1d7c ijigSeAPqyF+JIubX3j5iGuT4yAP+Zu7x4v4jWJRTU9ni4JWqLRp0RQjZ3dvM0qGN0Va CxSP0cekvuGq+5p5AFxe+Rb2e3s0vYm7xnr3sWV82LAMnI9R7sOE56rKOVGq8AsDXoOe FjZuuXfsYcmH1TGZ3idN2hT31zJN68gr1envxG0gKq2PEnIQkUyXO0Bq0EcdLyP+NOCS EVrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=ARppKVzpuPeNHqxCswVOFgUbFO18bm3TDyH1EtjhH2Y=; b=KyUXN3MSKKaRV+OEZr7LQv6tf6V/G9dQrdXuSlYZwz9lsbx+7F7NyLKdogM66UEhJh l7MLs8k1WJBW4CS+Wf3va7/48HZxU0ikeplM8BEMt7/QGYXFYkZfC08NGMS9Uew46pot 2Ft8YE8MlAvjpU/KscHZRyl4xHjE+gOTWJ/20wQ2f3V2dI8p8Oxttj0neO3lvGvenK8V qCzWCXCYRtjZgbG/zLXm2IuxD7f1hy05QJ7rRTbArPNcqYX4bdoKlNX++hv6MwBxOUk1 jTsse1E9w4Q0Jvr3j6FBvlV4N4OlmYpr2hnsqU9fBI6sGCuop0HuXkvOsyxySZEg/rLG XRbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=GR2QdsjV; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz21si2959275ejb.539.2021.10.08.04.54.38; Fri, 08 Oct 2021 04:55:03 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=GR2QdsjV; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230171AbhJHLzN (ORCPT + 99 others); Fri, 8 Oct 2021 07:55:13 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:54082 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbhJHLzL (ORCPT ); Fri, 8 Oct 2021 07:55:11 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id C2B5C219B2; Fri, 8 Oct 2021 11:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1633693995; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ARppKVzpuPeNHqxCswVOFgUbFO18bm3TDyH1EtjhH2Y=; b=GR2QdsjVtFCZKUc4xc5yeZr/nQA6mhlBW6T2w+UYP869BaDTM01lmkex8mtLcrSHW4RHLm YPZNWANlazii+mWHxB+we9i9UEU2l9tzxtQxjdHa/PYC1c+t9Ye2DuKojsJ65miiB0G+bO ooqWG5CIWeOE6fDT9FHvV/EeGYZp+38= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1633693995; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ARppKVzpuPeNHqxCswVOFgUbFO18bm3TDyH1EtjhH2Y=; b=2l7vV6JwoBk/GFly1VxlIrpKeXOTF2ZbH0Ptu22haSDVRyXnYeOQ2c2xgSbo1LEXMjsL3t OIXppmKoAkyZIIAg== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 92587A3B88; Fri, 8 Oct 2021 11:53:15 +0000 (UTC) Date: Fri, 08 Oct 2021 13:53:15 +0200 Message-ID: From: Takashi Iwai To: Arnd Bergmann Cc: musl@lists.openwall.com, Rich Felker , Michael Forney , ALSA Development Mailing List , Takashi Iwai , Baolin Wang , y2038 Mailman List , Linux Kernel Mailing List , Mark Brown , Baolin Wang Subject: Re: [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control In-Reply-To: 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> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: > > > > > > > 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. We need to verify the current behavior in anyway... > > 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. thanks, Takashi