Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2161170ioo; Mon, 23 May 2022 11:32:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyfsVXDa1xQ0xenF1TZU1TTN+zsauy+qYRl9Tj7bi6G6JtYbLalxlebVwmBh8kKJOkPaOx X-Received: by 2002:a65:6bc4:0:b0:3c2:2f7c:cc74 with SMTP id e4-20020a656bc4000000b003c22f7ccc74mr21092926pgw.307.1653330743000; Mon, 23 May 2022 11:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330742; cv=none; d=google.com; s=arc-20160816; b=T7NiDl3E20KpbE+lbJBMTPhQOSNjcp6m8uJpbgSuzkthOXqq1zJvSAOJhh8ApesWn4 ihxgLM5ih1TSQimCx9IjOmUsuktWuYQWD2NtO080k58C3G9jjbf0o+ytmRoxFW8pyBUz OI2TPQhbnz9Ch20ZgjciLf+vnElHiO1/mZptzt7vbPJ3dpFT9OsCzY+fSWcUJlKEbnMS Ij0IcEpGYHy+SfGpoJgFq3VNbKTggaGoOiPPeMe1vjMlq5zM/Gol4qdyxr6/hsm0bvOM AIHE5u/cS0fds6woLZJf84NewvVZSfrlQEtyul3CDGKprfDswnShMmm+IGtDpl+cfvOS 5nTQ== 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=iUeWAsdNRm5nQHJoQE1a2ZCS3dSM0seOKfMARVmGC6Y=; b=kvl1D4zeZiczj4tNyd6wO6O2NF+cpBZEsxCCtmeHa/XMsAyf3mXYynWOZ5PrvXcDOM Btb1O0L9KPxTrY1h+kJx6d27/5+2SeOZv+eM/fjcuJ+5nAJ+SDP3xQd/VjIWUV4qgirE 4rrYcLVG1S2D7qeZy/Fw+fieCZIrBmx9SMiKmj/9SJ4Hltfsdld5QE6K0R7ciAyhHnsk ngxCKLYRn5cN/S/cLoA9YsjAPqTLohSrUaKlclCsp7SEhMOszMc7ekns4CkQJzZYFjvm vYji3UlIUzr7i/d9Nx9//aC/93egbgVxaX4/kOmF0KVZ/CLGHKOVsZziSSgpV61N8QnG 22gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=URRdi5fi; 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 z21-20020aa78895000000b0050d3b31772bsi8332553pfe.182.2022.05.23.11.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:32:22 -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=URRdi5fi; 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 8332DBC29; Mon, 23 May 2022 11:31:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241976AbiEWSDc (ORCPT + 99 others); Mon, 23 May 2022 14:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241775AbiEWRgD (ORCPT ); Mon, 23 May 2022 13:36:03 -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 1BEDB90CC0; Mon, 23 May 2022 10:29:57 -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 2B112B81201; Mon, 23 May 2022 17:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 853D0C385AA; Mon, 23 May 2022 17:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326916; bh=QQM2k9G4KGPPMRx/b75fnIz+rJxFZTX5YdrkkcEBeSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=URRdi5fi8PHqErj+dcHUPzsOtAX9aBTBHdngALHcdRWN33k5porxhoC+/ZuBZbwcs MBfTfG3RiHzit5X1qKOGZzq6Az2c9AjAjDQMOQTIUsxG9xh7hagB8G5r7kZCPiFKYq e3ah4Y9Sgqqam+DCsaSVJ/inSWWGtCAkSmsoR3G8= 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.17 066/158] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace Date: Mon, 23 May 2022 19:03:43 +0200 Message-Id: <20220523165841.823353651@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@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 @@ -92,7 +92,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