Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2120960ioo; Mon, 23 May 2022 10:30:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoXIjvpRTMxU9aizjnLWErkzjzQ3gVVni7YghYpzuR9BcXhRWg8LHHafSt1s8OepuyB/8t X-Received: by 2002:a17:90a:d711:b0:1df:23c7:169 with SMTP id y17-20020a17090ad71100b001df23c70169mr115157pju.74.1653327036486; Mon, 23 May 2022 10:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653327036; cv=none; d=google.com; s=arc-20160816; b=Li5bP74FI3lCp2y1JjYiozZ+AmWYzjRGXQmtS6ZbcueMlq5r9sJeCQ+rFh+u/n6dmG GYAGUveSWgVC9GOzyNiQjP9Wc8KG3GKlp2O5b2IgSL8vA4ejgp8+efYWDu1U/XNI+uUe Z7Soh2FTe/ap4jXGBiTByDJ+pbrgKfFPCULsZ7hztHIU0bVrAvW7xIIeKOtdxAOkww6Z NLtU9/2TPnEa/7WCBElgW9nf2CBli1nA+nS4x3eT8TDRauNr2Oe/sJUbYmh896ZeOljd eF5+pOq1TezHjW4bUtjv8lfjPduWi5gX/Rh/G0REpP2+kx1SLxxUj8xj/xfaCcfI6YYK IHXg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EwolrTYePiConYBwC/CmO76NJW5s7eocmmL7dmiD1fg=; b=CI9Y/aOZS/skElYNGP7Sq1zfGXL3p0UPNqOJq1wZDkbqFRWag0oL5gMNtn4JGfy2hd 8BRhmap0fSQpdo8OlIxyeI0sqLYUwDVZv43Xx93rW8QKKuzpgMa/5FOStPoplOJ+v+XU VsvlQ+UycbzNbX8N1auIAH8y5nJsEtmA+zVMeNj327amrptk95/1DLUykwhY0iGDmecc 35KeI92H/7llA1hg56vHGpnN82gK6mOd4JCCMsSoePoVBiQTJXy5e39pFsb+MBDXyt3B zH46zE7jJxgXQxpPF2JBV6tph5yLbCt08zAmEWTBf98h1BvhWWtNxHdG7VztXeOVcQcu 6kFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zK0Dkypi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e18-20020a056a001a9200b0051036547a4fsi16119603pfv.115.2022.05.23.10.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:30:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zK0Dkypi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ED2378FD45; Mon, 23 May 2022 10:30:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240297AbiEWRZn (ORCPT + 99 others); Mon, 23 May 2022 13:25:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240588AbiEWRQb (ORCPT ); Mon, 23 May 2022 13:16:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E89726345; Mon, 23 May 2022 10:15:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CEBB0B81229; Mon, 23 May 2022 17:15:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D2EDC385A9; Mon, 23 May 2022 17:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326130; bh=43ADYlVSU0bl+oIij0x957OoDs9ZCDv4I1yKzplQidc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zK0Dkypi6mJ0PwCnOQacVGyYABwhR8d/dV+tVPukLVaanm3Pm/IwT6DW7DVUzeQHL nUo+qMAE+xgPa64EbvHMcDhfWnNx6memaARl9NqjHCfQtSZHDnLiLIFHxvkZrhPcsz 8KQafUsCUDFP3LkzaZTVKLmszlyfSP5Yn7PFbT74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= , =?UTF-8?q?Christian=20K=C3=B6nig?= Subject: [PATCH 5.4 33/68] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace Date: Mon, 23 May 2022 19:05:00 +0200 Message-Id: <20220523165808.093124227@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Jérôme Pouiller commit 7c3e9fcad9c7d8bb5d69a576044fb16b1d2e8a01 upstream. The typedefs u32 and u64 are not available in userspace. Thus user get an error he try to use DMA_BUF_SET_NAME_A or DMA_BUF_SET_NAME_B: $ gcc -Wall -c -MMD -c -o ioctls_list.o ioctls_list.c In file included from /usr/include/x86_64-linux-gnu/asm/ioctl.h:1, from /usr/include/linux/ioctl.h:5, from /usr/include/asm-generic/ioctls.h:5, from ioctls_list.c:11: ioctls_list.c:463:29: error: ‘u32’ undeclared here (not in a function) 463 | { "DMA_BUF_SET_NAME_A", DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h | ^~~~~~~~~~~~~~~~~~ ioctls_list.c:464:29: error: ‘u64’ undeclared here (not in a function) 464 | { "DMA_BUF_SET_NAME_B", DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h | ^~~~~~~~~~~~~~~~~~ The issue was initially reported here[1]. [1]: https://github.com/jerome-pouiller/ioctl/pull/14 Signed-off-by: Jérôme Pouiller Reviewed-by: Christian König Fixes: a5bff92eaac4 ("dma-buf: Fix SET_NAME ioctl uapi") CC: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20220517072708.245265-1-Jerome.Pouiller@silabs.com Signed-off-by: Christian König Signed-off-by: Greg Kroah-Hartman --- include/uapi/linux/dma-buf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/uapi/linux/dma-buf.h +++ b/include/uapi/linux/dma-buf.h @@ -44,7 +44,7 @@ struct dma_buf_sync { * between them in actual uapi, they're just different numbers. */ #define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *) -#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, u32) -#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, u64) +#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, __u32) +#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, __u64) #endif