Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4639533ybl; Mon, 13 Jan 2020 17:37:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyufiPsJ2wwLYu87ceGBWYUUycqKPTGc8u/0Hu7m7XpWYy4gPRJ43o+H84cDgK20euUnj0g X-Received: by 2002:aca:d806:: with SMTP id p6mr15374962oig.17.1578965870427; Mon, 13 Jan 2020 17:37:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578965870; cv=none; d=google.com; s=arc-20160816; b=FeaBrSJwj4JB4kvrDFqnZlKgSPR2gJB6nnR3ciOuJFYqO4+AqmKT2WhAZp589Tloli Iir16O2yXdbwkcLI52+/vcjdG0546WcgPFEc7XQ5lKJw7clSw88Gsbat3ykExwDPYVf7 KGpzQVA9Ue8kU5kaRyil/7b7h63HQuhRT4nAjKhGYNgT/i0tpZuEA12fVHg06VzW5pLr F1IVLuEixA7gfBXMtheVbgx7poARTZhWqxZvNo4Nu4NIlT3S1C92qDSMrdVFvSTNBaUM KRFdJc6XJ1xXq+d9+6qQK1Av+OcLUAmpAWXg1wyett+FGf2egK7h1Z4NPqxO8Hq7hjl8 lvvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Es2iIa5uM6z+FBYxdNBIIR3L6LPGY9nfZZ3Ee4fEYfs=; b=KSoDd5qWvvpe2Ql+3yC/CZFSi5mYSnGkWDibeddszKXBTQ9JL6hprIFGhR/sRaXGFF gWxt8nGsleZmBg3whtca2SDfNRhnwleCBl498lSsLiXA4caXreLuelqQrj7KpYPuhAeQ 5rDaIDtxJOHf+eDw08pTtD6V77ztZbZrqV7ptZdgljgjw600rc4x69jrHSkM3cHkWafD 1mhz5jwEtiV8cUJppAgUD2VjnuqbEL7PdcnfKz9FDt1TzFlAya52tfEn8jsvPlCnYd/m uSvse9z8palO35Whfe+SHeP6q95SZYuyl+h2eyt1GJiVryLEQJKwYrRfb1SG8EmxFviL AsYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="nOt/WGOb"; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si7152310oiy.81.2020.01.13.17.37.24; Mon, 13 Jan 2020 17:37:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="nOt/WGOb"; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728897AbgANBfp (ORCPT + 99 others); Mon, 13 Jan 2020 20:35:45 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:40410 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728890AbgANBfp (ORCPT ); Mon, 13 Jan 2020 20:35:45 -0500 Received: by mail-oi1-f194.google.com with SMTP id c77so10288809oib.7 for ; Mon, 13 Jan 2020 17:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Es2iIa5uM6z+FBYxdNBIIR3L6LPGY9nfZZ3Ee4fEYfs=; b=nOt/WGObnC4Br2dP+J+Se0J9rW2GPMCpwB+WAGjyktEruCZ7WmGMeRoI17agv8KPLp uFl+QMD/9hD6+gDXEgBOI25S4lCx36NyByU+lJ8TUD5lNeQfibE/YJ6yvfZ+FnVJOOPj OKe0lQ7bp4GBUkvY17YVz6aykB8v4S0jeVnbBnwchcZuai/KB8RvBFQ1tMaUMQpb352q mmkK96trS8rH9uBfAcsrmu5W4pDaXn5HXsY9QLJSWSWUs+XEo/JbHsw73tKUCtgxUmuE fxdlbb1J2isnWajQP4EaVuoQzJsX4TfQbvWGQ3jrohZkqazi5y9DQOnyiwIpYy+cLA+P 4kog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Es2iIa5uM6z+FBYxdNBIIR3L6LPGY9nfZZ3Ee4fEYfs=; b=XS1Je0iBOeRMgcfARG4yIIAz7lGgdN4acQ0RtkIY/dQxhWzO6QgBzBqqJ3MLxYXDJJ uXh4i4+PsBAx7/sNkeHFiCOT61W5yPmPF2FRXGuAWxTgm28BtHtM/dPRLh9C1meDjcDA yS+8gZaL78xxlvxOEusZscBNOhCMDeCSYMAKgRPZVeQ8GW9vDJI/6bnfPpzBtrNFTgwQ JYmHvrQSQIBn8pCwXvwI7mf6o1tvkt6+Z8hoGAIbVFnZFf7U1Xu2C3kGrMuW4Q5vZZ2Q +a3J9HlV/fLSIiYycGaNS4EvWxMBxNKcewK6rcHDGxpLGyz2g0IL46YAb9AMbqHKWw2U z2Kg== X-Gm-Message-State: APjAAAUp2kXDlEFQyyTa5HNcYSMjOR5t4ZDEaWzm2ZbpZuoiOS2QzMNH BpQt1GmsEN+S0RrtlpKlS4cMmOUaQGlL2znsMyugC4x+ X-Received: by 2002:aca:481:: with SMTP id 123mr15307992oie.110.1578965744179; Mon, 13 Jan 2020 17:35:44 -0800 (PST) MIME-Version: 1.0 References: <20200112004226.GA432297@kotori.hexchain.org> In-Reply-To: <20200112004226.GA432297@kotori.hexchain.org> From: Luiz Augusto von Dentz Date: Mon, 13 Jan 2020 17:35:32 -0800 Message-ID: Subject: Re: [PATCH] avctp: Fix EINVAL on uinput creation To: i@hexchain.org Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, On Sat, Jan 11, 2020 at 4:49 PM Haochen Tong wrote: > > The struct uinput_dev variable is on stack, so clear its content to > avoid accidentally writing garbage values to kernel. This fixes "Can't > create uinput device: Invalid argument (22)" in some cases. > > Signed-off-by: Haochen Tong Ive the remove the line above since we don't use it for userspace patches, see HACKING. > --- > profiles/audio/avctp.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c > index d3b5dfab9..f7a3de211 100644 > --- a/profiles/audio/avctp.c > +++ b/profiles/audio/avctp.c > @@ -1182,6 +1182,8 @@ static int uinput_create(struct btd_device *device, const char *name, > } > } > > + memset(&dev, 0, sizeof(struct uinput_dev)); Ive change the above like to use sizeof(dev) > if (name) { > strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE); > dev.name[UINPUT_MAX_NAME_SIZE - 1] = '\0'; > > base-commit: b4270d79e19ee70ccab6c087a7b470dad8a8a8bf > -- > 2.24.1 Applied, thanks. -- Luiz Augusto von Dentz