From patchwork Wed Aug 15 08:17:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yu Chao X-Patchwork-Id: 10566377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9ED8E1390 for ; Wed, 15 Aug 2018 08:18:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8397829F76 for ; Wed, 15 Aug 2018 08:18:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7764A29F7A; Wed, 15 Aug 2018 08:18:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RDNS_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (unknown [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D584F29F76 for ; Wed, 15 Aug 2018 08:18:28 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5CB352676E2; Wed, 15 Aug 2018 10:18:11 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E3DC92677AE; Wed, 15 Aug 2018 10:18:08 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by alsa0.perex.cz (Postfix) with ESMTP id B4B722675DA for ; Wed, 15 Aug 2018 10:18:05 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id y4-v6so229640pgp.9 for ; Wed, 15 Aug 2018 01:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=Xwrw5eVFX/7IK6K10etMTbx2qLAW/h6HHCHApK/OpFw=; b=cJroRDswWm13xxSvmpAZv1qnuMgl2iHOWBEpf9ORDWM9hn4PQGR6b9sQZ7KsTAE9Cs 4vWwoNHjyZd6eJ9vQx8Q4O3iy2ElRA6LKGLSO8zkV3Zv2zmhvYtIjQpA8ETfn90899BE ZTipDPW04FiwZLRDBhqaF5f2D69XnV4YdQxRQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Xwrw5eVFX/7IK6K10etMTbx2qLAW/h6HHCHApK/OpFw=; b=hla5syt1aFriJHNL+nvKxJWbxZCS7aNnoq3C28XQlkZaFxoIhGvFv1nMNZ9k85hfec b74lDwMlOnPKiQzHRhQl5tNrhaVaUWMj25mVJluwg3y1zM9NM3xPJTJorjh5uUyV1tPc xYEtO+EP1hNh8mGB97PVyjHy8fGWTKk/rBQhcpTrIXCVVY3X5OsLIszmNaYO08ZSOElU 3+5WRQCRy4XV3t4zvnqGwfJLg98Mrfwy50uFrb44OHSLtmIiuW/zF799A+i1bD/dG1XH 98e0KKDPv0dI3XiIXhDesWOm/HUJqjQHRtaf4+i75bPcO6178QPz+bRuZ4Qh42WVUyuO +9og== X-Gm-Message-State: AOUpUlHGPrY3RsAW7rbPlWLIeGsyuwh4FKv/VaCmvFhSQJc5n5Ufv4xE U8W0boHee4iRA8YJFcsYP5yHWstSzK8= X-Google-Smtp-Source: AA+uWPzikVYKkJpLhyAWQX9xcgSg1abmZNXH/rLw9OhHDwO4iC65rSoJRVj+BcUA08hy+14MBDqD0g== X-Received: by 2002:a63:4951:: with SMTP id y17-v6mr24623089pgk.32.1534321083403; Wed, 15 Aug 2018 01:18:03 -0700 (PDT) Received: from hychaoz840.tpe.corp.google.com ([2401:fa00:1:10:c303:3d7e:c8f2:7f84]) by smtp.gmail.com with ESMTPSA id w192-v6sm26981238pfd.74.2018.08.15.01.18.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Aug 2018 01:18:02 -0700 (PDT) From: Hsin-Yu Chao To: alsa-devel@alsa-project.org Date: Wed, 15 Aug 2018 16:17:50 +0800 Message-Id: <20180815081750.70746-1-hychao@chromium.org> X-Mailer: git-send-email 2.16.4 Cc: vinod.koul@intel.com, dgreid@chromium.org, Hsin-Yu Chao Subject: [alsa-devel] [PATCH] control_hw: Fix issue when applying seccomp policy X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP When seccomp policy is applied to filter ioctl syscall with SNDRV_CTL_IOCTL_TLV_COMMAND, SNDRV_CTL_IOCTL_TLV_READ and SNDRV_CTL_IOCTL_TLV_WRITE in whiltelist, alsa-lib still breaks in at snd_ctl_hw_elem_tlv(). Fix the problem by passing unsigned int to ioctl. Signed-off-by: Hsin-Yu Chao --- src/control/control_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/control/control_hw.c b/src/control/control_hw.c index 68eca522..b54d65f2 100644 --- a/src/control/control_hw.c +++ b/src/control/control_hw.c @@ -215,7 +215,7 @@ static int snd_ctl_hw_elem_tlv(snd_ctl_t *handle, int op_flag, unsigned int numid, unsigned int *tlv, unsigned int tlv_size) { - int inum; + unsigned int inum; snd_ctl_hw_t *hw = handle->private_data; struct snd_ctl_tlv *xtlv;