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-next>] [day] [month] [year] [list]
Message-ID: <CAJgzZorfiG26TCfwNBVYJkkkVBAQowJhRUtX4EzWSxwZbfNoyw@mail.gmail.com>
Date:   Mon, 16 Oct 2023 13:42:06 -0700
From:   enh <enh@...gle.com>
To:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-scsi@...r.kernel.org
Subject: [PATCH] scsi_status_is_good() uses __KERNEL__ constants.

Without this missing #ifdef, userspace code trying to use this header
directly won't compile. glibc manually removes it, bionic removes it
using a script. If we add this, the preprocessor can remove it instead.

Signed-off-by: Elliott Hughes <enh@...gle.com>
---
 include/scsi/scsi.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index ec093594ba53..a585e2067373 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -186,6 +186,7 @@ enum scsi_disposition {
 /* Used to obtain the PCI location of a device */
 #define SCSI_IOCTL_GET_PCI 0x5387

+#ifdef __KERNEL__
 /** scsi_status_is_good - check the status return.
  *
  * @status: the status passed up from the driver (including host and
@@ -216,5 +217,6 @@ static inline bool scsi_status_is_good(int status)
  /* FIXME: this is obsolete in SAM-3 */
  (status == SAM_STAT_COMMAND_TERMINATED));
 }
+#endif /* __KERNEL__ */

 #endif /* _SCSI_SCSI_H */
-- 
2.42.0.655.g421f12c284-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ