Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2756864rdb; Fri, 22 Sep 2023 07:39:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/cT/t2jYUWg9CPRIt63TDjKhNIIJQDSQO8FchlaifQWF9vQpic/JYZLdhzpKjwS1beFzs X-Received: by 2002:a05:6358:7207:b0:140:f55a:ad41 with SMTP id h7-20020a056358720700b00140f55aad41mr12513664rwa.22.1695393545372; Fri, 22 Sep 2023 07:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695393545; cv=none; d=google.com; s=arc-20160816; b=xassJdBubwspqNN5ugyuirHa/vmv0EFrYY6sg45+B9GIDeKv1jv0J+fXc0IufJt3iz rCM46YVR9vzmbn7MKF7zo+kc4iIBVJAH1jqmXah644qbIQE71C2Iv0+bOSNewBTFL30o MmNxvFj0q9oFd6JZClVZiBRraMxsCrBgL2h43KdTiI8EiSnu329KQ5nOuw3rIkKE3fU4 HjKtAi6TSoPCsgtY2bIwYpITuo78X5XX2/JhePfqKlXCLVPQ33Z8YSh3UjwWbsiQprGe MYd3maJU5PWe+jZCOXo4kdQy0r8wGwN6yJq5GPtYajaPineNmUltF076Bxok5MJVRnrS yetg== 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=hr4dJrGCAHGoorv5nC8n0VYn5plN0T8DDF/tRgAs9xw=; fh=Ajq/cIiy92LurpPvZ+4HEi9e4Z1eLgC1P+Z0zWGQJTs=; b=mX62PfJe1C3ijqf+FJBQQGsGQI9IMeI9gy3to3DVyuCaRIlZPl3NGly1cv9I87CHPY 9TFGdPzHP0T4i7kgcp003xFiERj1/+VFt5myE++gaM/82VRTu+D8V3NhwBmTI1PANfoI l3prdkbNH2nnU9HMdJpqz7re+6ucPzgILeOykoG6NkPRfPmA0DSoIbEYJbattFA0Gucn M4GPk2zQBokIF1XdHRI0P9wgEkKtftdL4a9wn9e4p/J5+p4IQHk5qzzTSZ+D/YuzIL6m nsTWF2+ThYHJ5h/+Q9eCbHrliDRHS6cLeymUpMoXm/inIWMOVRvo0ykB3fYXu/9D6T2h 8XNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=yQ9zS8ML; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=956IPJl5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o15-20020a656a4f000000b00578d08489a8si4430487pgu.832.2023.09.22.07.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 07:39:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=yQ9zS8ML; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=956IPJl5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7D3D882B1C5B; Thu, 21 Sep 2023 11:13:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229650AbjIUSNC (ORCPT + 99 others); Thu, 21 Sep 2023 14:13:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbjIUSMQ (ORCPT ); Thu, 21 Sep 2023 14:12:16 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FCFA645BE; Thu, 21 Sep 2023 10:32:11 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1C1591FE17; Thu, 21 Sep 2023 13:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1695302058; 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=hr4dJrGCAHGoorv5nC8n0VYn5plN0T8DDF/tRgAs9xw=; b=yQ9zS8MLtbBzIv4XI+Fx8UAy9OA58BxnvA0q2n1vhQLjUSsNzM4w4MdLAlqHixUwTRUdoz XubkwoYkWO2vMUvbTapSgZvfIRIZERoGsyfrIx8lbCcnL4Q5xOqDi0chiiy+ZoYKd3EIit dDKtvAuqYXOAhz9Frc0BAj0JX4LPLQU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1695302058; 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=hr4dJrGCAHGoorv5nC8n0VYn5plN0T8DDF/tRgAs9xw=; b=956IPJl5aJAhxsQTTbR4rPzctFBiEm6NaXj8nUVK+t2LBvTby0r5Safd7j/+V6jKUnW38T CX4LhyiTf45bK1Bw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A5F23134B0; Thu, 21 Sep 2023 13:14:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id o5KBJ6lBDGVtMQAAMHmgww (envelope-from ); Thu, 21 Sep 2023 13:14:17 +0000 Date: Thu, 21 Sep 2023 15:14:17 +0200 Message-ID: <87o7hvzn12.wl-tiwai@suse.de> From: Takashi Iwai To: David Howells Cc: Jens Axboe , Al Viro , Linus Torvalds , Christoph Hellwig , Christian Brauner , David Laight , Matthew Wilcox , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jaroslav Kysela , Takashi Iwai , Oswald Buddenhagen , Suren Baghdasaryan , Kuninori Morimoto , alsa-devel@alsa-project.org Subject: Re: [PATCH v5 01/11] sound: Fix snd_pcm_readv()/writev() to use iov access functions In-Reply-To: <20230920222231.686275-2-dhowells@redhat.com> References: <20230920222231.686275-1-dhowells@redhat.com> <20230920222231.686275-2-dhowells@redhat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 11:13:06 -0700 (PDT) On Thu, 21 Sep 2023 00:22:21 +0200, David Howells wrote: > > Fix snd_pcm_readv()/writev() to use iov access functions rather than poking > at the iov_iter internals directly. > > Signed-off-by: David Howells > cc: Jaroslav Kysela > cc: Takashi Iwai > cc: Oswald Buddenhagen > cc: Jens Axboe > cc: Suren Baghdasaryan > cc: Kuninori Morimoto > cc: alsa-devel@alsa-project.org Reviewed-by: Takashi Iwai Would you apply it through your tree, or shall I apply this one via sound git tree? thanks, Takashi > --- > sound/core/pcm_native.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c > index bd9ddf412b46..9a69236fa207 100644 > --- a/sound/core/pcm_native.c > +++ b/sound/core/pcm_native.c > @@ -3527,7 +3527,7 @@ static ssize_t snd_pcm_readv(struct kiocb *iocb, struct iov_iter *to) > if (runtime->state == SNDRV_PCM_STATE_OPEN || > runtime->state == SNDRV_PCM_STATE_DISCONNECTED) > return -EBADFD; > - if (!to->user_backed) > + if (!user_backed_iter(to)) > return -EINVAL; > if (to->nr_segs > 1024 || to->nr_segs != runtime->channels) > return -EINVAL; > @@ -3567,7 +3567,7 @@ static ssize_t snd_pcm_writev(struct kiocb *iocb, struct iov_iter *from) > if (runtime->state == SNDRV_PCM_STATE_OPEN || > runtime->state == SNDRV_PCM_STATE_DISCONNECTED) > return -EBADFD; > - if (!from->user_backed) > + if (!user_backed_iter(from)) > return -EINVAL; > if (from->nr_segs > 128 || from->nr_segs != runtime->channels || > !frame_aligned(runtime, iov->iov_len)) >