lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7c7f42ec-8d9d-40b6-b275-ef139bcc4b79@linuxfoundation.org>
Date: Wed, 25 Sep 2024 09:29:10 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Ba Jing <bajing@...s.chinamobile.com>, shuah@...nel.org
Cc: linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
 Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] memfd: fuse_mnt: remove unused macro

On 9/2/24 22:44, Ba Jing wrote:
> The macro FUSE_USE_VERSION is never referenced in the code,
> just remove it.
> 

How did you find this problem and how did you test this change?
This patch is incorrect - please see below.

When you find unused defines, do check first if they are indeed
unused checking tree wide to see what happens if you remove it.

> Signed-off-by: Ba Jing <bajing@...s.chinamobile.com>
> ---
>   tools/testing/selftests/memfd/fuse_mnt.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/memfd/fuse_mnt.c b/tools/testing/selftests/memfd/fuse_mnt.c
> index 6936f2a001f3..f9f06fd43c5f 100644
> --- a/tools/testing/selftests/memfd/fuse_mnt.c
> +++ b/tools/testing/selftests/memfd/fuse_mnt.c
> @@ -12,8 +12,6 @@
>    * file-system.
>    */
>   
> -#define FUSE_USE_VERSION 26
> -
>   #include <fuse.h>
>   #include <stdio.h>
>   #include <string.h>

You probably noticed https://lore.kernel.org/all/202409241613.KyXs9fiF-lkp@intel.com/
found build problems with this change.

Also you have to define this to pick up the new API from fuse.h
Removing #define FUSE_USE_VERSION 26 from this source file causes
the version 21 API to be used, hence the build errors.

/usr/include/fuse/fuse.h

/** @file
  *
  * This file defines the library interface of FUSE
  *
  * IMPORTANT: you should define FUSE_USE_VERSION before including this
  * header.  To use the newest API define it to 26 (recommended for any
  * new application), to use the old API define it to 21 (default) 22
  * or 25, to use the even older 1.X API define it to 11.
  */

#ifndef FUSE_USE_VERSION
#define FUSE_USE_VERSION 21
#endif

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ