From: Takashi Iwai Subject: Re: [PATCH v2] control_hw: Fix issue when applying seccomp policy Date: Sun, 19 Aug 2018 10:09:20 +0200 Message-ID: References: <20180817031227.187676-1-hychao@chromium.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D319826766C for ; Sun, 19 Aug 2018 10:09:20 +0200 (CEST) In-Reply-To: <20180817031227.187676-1-hychao@chromium.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Hsin-Yu Chao Cc: vinod.koul@intel.com, alsa-devel@alsa-project.org, dgreid@chromium.org List-Id: alsa-devel@alsa-project.org On Fri, 17 Aug 2018 05:12:27 +0200, Hsin-Yu Chao wrote: > > 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(). > > The problem behind is because ioctl() takes unsigned long cmd > argument, and the signed bit of local int variable could cause > 0xff bytes appended after casted to unsigned long. > In kernel, seccomp data struct takes 64 bits argument to check > against seccomp rules, these unexpected 0xff bytes could make > the rule check fail. > > Fix the problem by passing unsigned int to ioctl. > > Signed-off-by: Hsin-Yu Chao Thanks, applied now. Takashi