Message ID | 20230519093114.28813-23-tiwai@suse.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1103420vqo; Fri, 19 May 2023 02:37:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ORCdcI9SkA7QPg1MQDyEZ5h6d3jdghfHwXQEPmOJ0oUC98tbzMYpY60AR91c8xnssUL+C X-Received: by 2002:a17:90b:b18:b0:252:e7dd:4703 with SMTP id bf24-20020a17090b0b1800b00252e7dd4703mr1584965pjb.43.1684489065929; Fri, 19 May 2023 02:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684489065; cv=none; d=google.com; s=arc-20160816; b=Kn6eM7hfoFj7eHNT0ClMABkxPFDO1RtL1Z4/oqjaj/cFiLs8b08K5XIJoh4iCrzCsO klKio7BTlhhK5puxQAijl5VzpNV7oUiO3njB1InFc+3E+RnZhIrSUb624eFusXXMrDe4 nxbKhRQfRJ3dquTlwyMavF9BW+2tS9elao0rZJanakGAaQrExvNWj6DJPLlNGiy1vkwt Umat6aX2H784QLo5/EB/+d20kuYH+iSsjJs/YWTj1dnA4JiWoFvapYlVgi347FZ4OJGf DMBMFl1bOcwgeoEFv4fmfogaiUlJXuylIYdwMI1vUAP8r4dw3RSA6hi0ZubxgvV+dvJR ssYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=XcYWfCebI4c2wHjl2VTt/v++678oQs8qU/FjGxpuSm4=; b=KDUQrBmauVzIojGFERGQXhQkomvagvD/ZE2NCisbpp92vy89rfbvuJnGRR8osZwJdL fu8Zll8klXvRARyhBxgh9wih+M7mWGq+EDWcJHXJxBW8Ev0GIAySlEV9GxCvvBmpAsVA SoFxWgzcxszH8VEAlhXnrE0akiH7pZ26GRQhQ+njrWEd3PXFh8CkIx/UFfmocTuaONCu ZXR5uWjBVrV3XSj3ZsKP3slQTvTBRQqWBptCwKii+WILDYq4hIibtz4D0entqqdbUpYK AiVI7wvEjnHeeIMTEftNMNAizXg8KDnNgtgF/oAzyBnE7jgZYWA/c/m2OdMISUYufOeW e1FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=W3C6C6OG; dkim=neutral (no key) header.i=@suse.de header.b=sMn72hTd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r8-20020a17090a940800b0024e140702efsi1413557pjo.118.2023.05.19.02.37.30; Fri, 19 May 2023 02:37:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=W3C6C6OG; dkim=neutral (no key) header.i=@suse.de header.b=sMn72hTd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231572AbjESJcp (ORCPT <rfc822;wlfightup@gmail.com> + 99 others); Fri, 19 May 2023 05:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231563AbjESJb6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 19 May 2023 05:31:58 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D0C31723 for <linux-kernel@vger.kernel.org>; Fri, 19 May 2023 02:31:44 -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-out1.suse.de (Postfix) with ESMTPS id 22B0722245; Fri, 19 May 2023 09:31:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684488703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XcYWfCebI4c2wHjl2VTt/v++678oQs8qU/FjGxpuSm4=; b=W3C6C6OG5DriJnuaTCyomVC3SHuvO6pJhZua9PXCvkf9TCrwUghZsas80WNInQ/UdWZ6gZ Dl0WY5bcDa7/iJN6IwCxDAUVRS5rZd6PB5L6/b6M3XaRTDB65NL3TQv/XWHUzHdrcj3SaL fF1kQOMWSWMhN1i3lOFnUi+K10wUU5M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684488703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XcYWfCebI4c2wHjl2VTt/v++678oQs8qU/FjGxpuSm4=; b=sMn72hTdvb7ZFG7r7IREHwUPk5KvgFKSUYeWzHEmUKmRu+DsIrAmZ40TLfzuXYSxDKQvua y19tf5JNmqYvhMAw== 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 ECF3413A12; Fri, 19 May 2023 09:31:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gIEBOf5BZ2RXJAAAMHmgww (envelope-from <tiwai@suse.de>); Fri, 19 May 2023 09:31:42 +0000 From: Takashi Iwai <tiwai@suse.de> To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 22/36] ALSA: seq: Prohibit creating ports with special numbers Date: Fri, 19 May 2023 11:31:00 +0200 Message-Id: <20230519093114.28813-23-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230519093114.28813-1-tiwai@suse.de> References: <20230519093114.28813-1-tiwai@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766314806351714912?= X-GMAIL-MSGID: =?utf-8?q?1766314806351714912?= |
Series |
ALSA: Add MIDI 2.0 support
|
|
Commit Message
Takashi Iwai
May 19, 2023, 9:31 a.m. UTC
Some port numbers are special, such as 254 for subscribers and 255 for
broadcast. Return error if application tries to create such a port.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/core/seq/seq_clientmgr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 2dac8c3355fd..0f26f20596d7 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -1206,6 +1206,8 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg) port_idx = info->addr.port; else port_idx = -1; + if (port_idx >= SNDRV_SEQ_ADDRESS_UNKNOWN) + return -EINVAL; err = snd_seq_create_port(client, port_idx, &port); if (err < 0) return err;