Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2162819ioo; Mon, 23 May 2022 11:34:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwyOKyE01o30VAvEnVI88xGuFcNrIClnqcp4ObNd5rjKxT0RiK6cH1I1uxbCNUuaw8Yitn X-Received: by 2002:a17:902:ab05:b0:15f:3aad:6269 with SMTP id ik5-20020a170902ab0500b0015f3aad6269mr24306519plb.23.1653330884527; Mon, 23 May 2022 11:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330884; cv=none; d=google.com; s=arc-20160816; b=L8QhTG4CPh6NejDe6cdLc0a57+adWforySZPazH1FRGCCqcZVJqulb582eI+cJMwCA cN101B0cOKTk70LrjwadRYLWl6PdqKQMfD6cgFs/was4oQ/y57IaDsrdgOBaUYV33WmK I1hOQKqnAKcbFqdXtiS+yKOTOvBSE/vvSORYQHn9qgxpnMg8ITiroIq1tuKiuDnRZ+BR BLLc7i545tzx7pIFgLXCD9l21Q/VQy5U04rD/TJYQaXDdPqQ5KnhulzS7n00JQLBSUVT 6+qDVceoMpDFQsEOGsobxVnLpVhQQU2TRF0o0Q0r01uvApEDHoVc+XHJ0U1dN2OHw+33 VLxw== 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=taKtZG9GU5Zh4GQAQesW8VAiaWnomv360QouC5FCLlwLtpoOImudFsO8hjpXsddcp+ CIDp+C64ubo7IO5+yeJ8BrdhCXhizNhdB4O1Y2Uivgzt9tW+wEXq6p1wD/rTOmWgKDfU /bBkq7XNfk2qokLyjhEcTvq87PlfvimfN/R2I1Ioaoa6HAqlqs+cr0xrvpVgt/iWU0VP nLnlmcRxnMvXVncIBxFZ1vg4fLRrQCJmr95tbAC/Y2P7Jcl+nqqO3FfTQGw377TrkwYp 16AlZvMCUGuzORK95T5WqW5aFCJ284PGNfTfLdFzuCkJYdovumnwQpYrCtUOBzlRm+7e UgEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S9FTREnp; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id na8-20020a17090b4c0800b001e00edc0c6csi40219pjb.121.2022.05.23.11.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:34:44 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S9FTREnp; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 DBD191A449F; Mon, 23 May 2022 11:33:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241621AbiEWRbA (ORCPT + 99 others); Mon, 23 May 2022 13:31:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241782AbiEWRWg (ORCPT ); Mon, 23 May 2022 13:22:36 -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 102717CB08; Mon, 23 May 2022 10:19:29 -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 90BB8B811FF; Mon, 23 May 2022 17:19:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B10CFC385AA; Mon, 23 May 2022 17:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326368; bh=QQM2k9G4KGPPMRx/b75fnIz+rJxFZTX5YdrkkcEBeSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S9FTREnp/Ri/3wfNHCNXLw81Hgjw1kdtb672iPByJKAIFtOgV6EBKnpYgr60W7Q9b b2tt1KFK84cJQ427Q8tVElZ7j+uVhfaywAELuvshWp273yPDTVxeMHuUuKD1vjaq+X xkovUkC1N+3wUrEdFC3KVqgypDeT8K2JUV2558zI= 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.15 060/132] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace Date: Mon, 23 May 2022 19:04:29 +0200 Message-Id: <20220523165833.209250206@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165823.492309987@linuxfoundation.org> References: <20220523165823.492309987@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