Go to file
Petr Oros 27e4be54a5 overflow: Add struct_size_t() helper
JIRA: https://issues.redhat.com/browse/RHEL-30138

Conflicts:
- removed chunk for drivers/scsi/hptiop.c due to missing c682df71996aee
  ("scsi: hptiop: Replace one-element array with flexible-array member")
  and 5b12a568cc6f69 ("scsi: hptiop: Use struct_size() helper in code
  related to struct hpt_iop_request_scsi_command"). The driver is disabled
  by config.

Upstream commit(s):
commit d67790ddf0219aa0ad3e13b53ae0a7619b3425a2
Author: Kees Cook <keescook@chromium.org>
Date:   Mon May 22 14:18:13 2023 -0700

    overflow: Add struct_size_t() helper

    While struct_size() is normally used in situations where the structure
    type already has a pointer instance, there are places where no variable
    is available. In the past, this has been worked around by using a typed
    NULL first argument, but this is a bit ugly. Add a helper to do this,
    and replace the handful of instances of the code pattern with it.

    Instances were found with this Coccinelle script:

    @struct_size_t@
    identifier STRUCT, MEMBER;
    expression COUNT;
    @@

    -       struct_size((struct STRUCT *)\(0\|NULL\),
    +       struct_size_t(struct STRUCT,
                    MEMBER, COUNT)

    Suggested-by: Christoph Hellwig <hch@infradead.org>
    Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
    Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Eric Dumazet <edumazet@google.com>
    Cc: Paolo Abeni <pabeni@redhat.com>
    Cc: James Smart <james.smart@broadcom.com>
    Cc: Keith Busch <kbusch@kernel.org>
    Cc: Jens Axboe <axboe@kernel.dk>
    Cc: Sagi Grimberg <sagi@grimberg.me>
    Cc: HighPoint Linux Team <linux@highpoint-tech.com>
    Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
    Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
    Cc: Kashyap Desai <kashyap.desai@broadcom.com>
    Cc: Sumit Saxena <sumit.saxena@broadcom.com>
    Cc: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
    Cc: Don Brace <don.brace@microchip.com>
    Cc: "Darrick J. Wong" <djwong@kernel.org>
    Cc: Dave Chinner <dchinner@redhat.com>
    Cc: Guo Xuenan <guoxuenan@huawei.com>
    Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
    Cc: Nick Desaulniers <ndesaulniers@google.com>
    Cc: Daniel Latypov <dlatypov@google.com>
    Cc: kernel test robot <lkp@intel.com>
    Cc: intel-wired-lan@lists.osuosl.org
    Cc: netdev@vger.kernel.org
    Cc: linux-nvme@lists.infradead.org
    Cc: linux-scsi@vger.kernel.org
    Cc: megaraidlinux.pdl@broadcom.com
    Cc: storagedev@microchip.com
    Cc: linux-xfs@vger.kernel.org
    Cc: linux-hardening@vger.kernel.org
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
    Reviewed-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Acked-by: Jakub Kicinski <kuba@kernel.org>
    Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
    Link: https://lore.kernel.org/r/20230522211810.never.421-kees@kernel.org

Signed-off-by: Petr Oros <poros@redhat.com>
2024-03-26 21:44:33 +01:00
Documentation Merge: mm/mglru: fix underprotected page cache 2024-03-25 06:56:13 -04:00
LICENSES
arch Merge: Pull up TI's devicetrees 2024-03-25 06:56:15 -04:00
block Merge: block: sync with v6.8 2024-03-18 16:54:21 -03:00
certs integrity: PowerVM support for loading third party code signing keys 2024-02-05 19:05:32 +08:00
crypto Merge: crypto: dh - implement FIPS PCT and a panic on a failure 2024-03-20 13:38:07 -03:00
drivers overflow: Add struct_size_t() helper 2024-03-26 21:44:33 +01:00
fs overflow: Add struct_size_t() helper 2024-03-26 21:44:33 +01:00
include overflow: Add struct_size_t() helper 2024-03-26 21:44:33 +01:00
init kbuild: Add environment variables for userprogs flags 2023-12-18 09:06:13 -03:00
io_uring io_uring: ensure local task_work is run on wait timeout 2024-02-05 16:34:25 -05:00
ipc ipc/shm: call underlying open/close vm_ops 2023-06-14 15:11:04 -06:00
kernel Merge: printk: allow disabling printk per-console device kthreads at boot 2024-03-25 06:56:13 -04:00
lib overflow: Add struct_size_t() helper 2024-03-26 21:44:33 +01:00
mm Merge: mm/mglru: fix underprotected page cache 2024-03-25 06:56:13 -04:00
net Merge: Bluetooth: Fix bogus check for re-auth no supported with non-ssp 2024-03-18 16:54:18 -03:00
redhat [redhat] kernel-5.14.0-433.el9 2024-03-25 07:08:36 -04:00
samples Merge: BPF: update to 6.6 2024-01-12 13:40:43 -05:00
scripts kbuild: Cleanup DT Overlay intermediate files as appropriate 2024-03-15 14:47:39 -05:00
security Merge: Disable evm on overlayfs 2024-03-25 06:56:14 -04:00
sound Merge tag 'kernel-5.14.0-427.6.1.el9_4' from 9.4 2024-03-22 10:04:03 -04:00
tools Merge: Update userspace rtla and rv to the latest upstream 2024-03-25 06:56:15 -04:00
usr kbuild: Add environment variables for userprogs flags 2023-12-18 09:06:13 -03:00
virt KVM: x86: Add support for "protected VMs" that can utilize private memory 2023-12-01 14:51:47 +01:00
.clang-format iommu: Add for_each_group_device() 2023-10-27 01:26:58 -07:00
.cocciconfig
.get_maintainer.conf
.get_maintainer.ignore
.gitattributes
.gitignore kbuild: Cleanup DT Overlay intermediate files as appropriate 2024-03-15 14:47:39 -05:00
.gitlab-ci.yml gitlab-ci: enable arm64/s390x/ppc64le debug builds 2024-02-26 20:21:01 +01:00
.mailmap
COPYING
CREDITS MAINTAINERS: Orphan Cadence PCIe IP 2024-02-25 08:39:32 -07:00
Kbuild
Kconfig
Kconfig.redhat redhat: kABI: add missing RH_KABI_SIZE_ALIGN_CHECKS Kconfig option 2024-01-12 14:27:16 +01:00
MAINTAINERS Merge: arm: Add SCMI performance domain and dynamic OPP support 2024-03-18 16:54:19 -03:00
Makefile kbuild: Cleanup DT Overlay intermediate files as appropriate 2024-03-15 14:47:39 -05:00
Makefile.rhelver [redhat] kernel-5.14.0-433.el9 2024-03-25 07:08:36 -04:00
README
makefile

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.