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]
Date:   Fri, 16 Dec 2022 10:02:24 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Saravana Kannan <saravanak@...gle.com>
Subject: [GIT PULL] Driver core changes for 6.2-rc1

The following changes since commit eb7081409f94a9a8608593d0fb63a1aa3d6f95d8:

  Linux 6.1-rc6 (2022-11-20 16:02:16 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git tags/driver-core-6.2-rc1

for you to fetch changes up to f18caf261398a7f2de4fa3f600deb87072fe7b8d:

  device property: Fix documentation for fwnode_get_next_parent() (2022-12-07 17:22:44 +0100)

----------------------------------------------------------------
Driver Core changes for 6.2-rc1

Here is the set of driver core and kernfs changes for 6.2-rc1.

The "big" change in here is the addition of a new macro,
container_of_const() that will preserve the "const-ness" of a pointer
passed into it.

The "problem" of the current container_of() macro is that if you pass in
a "const *", out of it can comes a non-const pointer unless you
specifically ask for it.  For many usages, we want to preserve the
"const" attribute by using the same call.  For a specific example, this
series changes the kobj_to_dev() macro to use it, allowing it to be used
no matter what the const value is.  This prevents every subsystem from
having to declare 2 different individual macros (i.e.
kobj_const_to_dev() and kobj_to_dev()) and having the compiler enforce
the const value at build time, which having 2 macros would not do
either.

The driver for all of this have been discussions with the Rust kernel
developers as to how to properly mark driver core, and kobject, objects
as being "non-mutable".  The changes to the kobject and driver core in
this pull request are the result of that, as there are lots of paths
where kobjects and device pointers are not modified at all, so marking
them as "const" allows the compiler to enforce this.

So, a nice side affect of the Rust development effort has been already
to clean up the driver core code to be more obvious about object rules.

All of this has been bike-shedded in quite a lot of detail on lkml with
different names and implementations resulting in the tiny version we
have in here, much better than my original proposal.  Lots of subsystem
maintainers have acked the changes as well.

Other than this change, included in here are smaller stuff like:
  - kernfs fixes and updates to handle lock contention better
  - vmlinux.lds.h fixes and updates
  - sysfs and debugfs documentation updates
  - device property updates

All of these have been in the linux-next tree for quite a while with no
problems, OTHER than some merge issues with other trees that should be
obvious when you hit them (block tree deletes a driver that this tree
modifies, iommufd tree modifies code that this tree also touches).  If
there are merge problems with these trees, please let me know.

Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

----------------------------------------------------------------
Andy Shevchenko (12):
      device property: Allow const parameter to dev_fwnode()
      device property: Constify fwnode connection match APIs
      device property: Constify parameter in fwnode_graph_is_endpoint()
      device property: Constify device child node APIs
      device property: Constify parameter in device_dma_supported() and device_get_dma_attr()
      resource: Replace printk(KERN_WARNING) by pr_warn(), printk() by pr_info()
      resource: Convert DEFINE_RES_NAMED() to be compound literal
      mfd: vexpress-sysreg: Fix resource compound literal assignments
      device property: Get rid of __PROPERTY_ENTRY_ARRAY_EL*SIZE*()
      device property: Move PROPERTY_ENTRY_BOOL() a bit down
      device property: Rename goto label to be more precise
      device property: Add a blank line in Kconfig of tests

Christoph Hellwig (1):
      driver core: mark driver_allows_async_probing static

Christophe JAILLET (1):
      driver core: Use kstrtobool() instead of strtobool()

Greg Kroah-Hartman (23):
      driver core: allow kobj_to_dev() to take a const pointer
      USB: allow some usb functions to take a const pointer.
      USB: make devnode() callback in usb_class_driver take a const *
      kobject: modify kobject_get_path() to take a const *
      kobject: make get_ktype() take a const pointer
      container_of: remove container_of_safe()
      driver core: class: make namespace and get_ownership take const *
      blkdev: make struct block_device_operations.devnode() take a const *
      driver core: remove devm_device_remove_groups()
      driver core: remove devm_device_remove_group()
      Merge 6.1-rc6 into driver-core-next
      kobject: make kobject_get_ownership() take a constant kobject *
      kobject: make kobject_namespace take a const *
      kobject: kset_uevent_ops: make filter() callback take a const *
      kobject: kset_uevent_ops: make name() callback take a const *
      driver core: pass a const * into of_device_uevent()
      driver core: make struct class.dev_uevent() take a const *
      driver core: make struct class.devnode() take a const *
      driver core: fix up some missing class.devnode() conversions.
      container_of: add container_of_const() that preserves const-ness of the pointer
      device.h: move kobj_to_dev() to use container_of_const()
      usb.h: take advantage of container_of_const()
      firmware_loader: fix up to_fw_sysfs() to preserve const

Ian Kent (2):
      kernfs: dont take i_lock on inode attr read
      kernfs: dont take i_lock on revalidate

Isaac J. Manjarres (1):
      driver core: Fix bus_type.match() error handling in __driver_attach()

Jim Cromie (4):
      vmlinux.lds.h: add BOUNDED_SECTION* macros
      vmlinux.lds.h: place optional header space in BOUNDED_SECTION
      vmlinux.lds.h: fix BOUNDED_SECTION_(PRE|POST)_LABEL macros
      vmlinux.lds.h: add HEADERED_SECTION_* macros

Kees Cook (1):
      devres: Use kmalloc_size_roundup() to match ksize() usage

Miaoqian Lin (1):
      device property: Fix documentation for fwnode_get_next_parent()

Pierre Gondois (2):
      cacheinfo: Decrement refcount in cache_setup_of_node()
      cacheinfo: Remove of_node_put() for fw_token

Randy Dunlap (3):
      debugfs: small Documentation cleaning
      sysfs: update Documentation
      kernfs: fix all kernel-doc warnings and multiple typos

Sakari Ailus (1):
      linux/container_of.h: Warn about loss of constness

Soha Jin (1):
      platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq

Stephen Rothwell (2):
      driver core: fix up missed scsi/cxlflash class.devnode() conversion.
      driver core: fix up missed drivers/s390/char/hmcdrv_dev.c class.devnode() conversion.

Thomas Weißschuh (1):
      kernel/ksysfs.c: export kernel cpu byteorder

Yang Yingliang (3):
      kset: fix memory leak when kset_register() returns error
      class: fix possible memory leak in __class_register()
      Documentation: devres: add missing MEM helper

 .../ABI/testing/sysfs-kernel-cpu_byteorder         |  12 ++
 Documentation/driver-api/driver-model/devres.rst   |   1 +
 Documentation/filesystems/debugfs.rst              |   8 +-
 Documentation/filesystems/sysfs.rst                |  41 ++--
 arch/powerpc/platforms/book3s/vas-api.c            |   2 +-
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c          |   4 +-
 arch/x86/kernel/cpuid.c                            |   2 +-
 arch/x86/kernel/msr.c                              |   2 +-
 block/bsg.c                                        |   2 +-
 block/genhd.c                                      |   4 +-
 drivers/base/base.h                                |   1 -
 drivers/base/bus.c                                 |   2 +-
 drivers/base/cacheinfo.c                           |  19 +-
 drivers/base/class.c                               |   7 +-
 drivers/base/core.c                                |  66 ++----
 drivers/base/dd.c                                  |   8 +-
 drivers/base/devres.c                              |   3 +
 drivers/base/firmware_loader/sysfs.c               |   6 +-
 drivers/base/firmware_loader/sysfs.h               |   6 +-
 drivers/base/platform.c                            |   4 +-
 drivers/base/property.c                            |  36 ++--
 drivers/base/test/Kconfig                          |   1 +
 drivers/block/aoe/aoechr.c                         |   2 +-
 drivers/block/pktcdvd.c                            |   2 +-
 drivers/char/mem.c                                 |   2 +-
 drivers/char/misc.c                                |   4 +-
 drivers/dma-buf/dma-buf-sysfs-stats.c              |   2 +-
 drivers/dma-buf/dma-heap.c                         |   2 +-
 drivers/firmware/dmi-id.c                          |   2 +-
 drivers/gnss/core.c                                |   6 +-
 drivers/gpu/drm/drm_sysfs.c                        |   2 +-
 drivers/hid/usbhid/hiddev.c                        |   2 +-
 drivers/infiniband/core/device.c                   |   6 +-
 drivers/infiniband/core/user_mad.c                 |   2 +-
 drivers/infiniband/core/uverbs_main.c              |   2 +-
 drivers/infiniband/hw/hfi1/device.c                |   4 +-
 drivers/input/input.c                              |   2 +-
 drivers/isdn/mISDN/core.c                          |   4 +-
 drivers/media/dvb-core/dvbdev.c                    |   8 +-
 drivers/media/pci/ddbridge/ddbridge-core.c         |   4 +-
 drivers/media/rc/rc-main.c                         |   2 +-
 drivers/mfd/vexpress-sysreg.c                      |  16 +-
 drivers/misc/cxl/file.c                            |   2 +-
 drivers/misc/genwqe/card_base.c                    |   2 +-
 drivers/misc/ocxl/file.c                           |   2 +-
 drivers/net/ipvlan/ipvtap.c                        |   4 +-
 drivers/net/macvtap.c                              |   4 +-
 drivers/nvme/host/core.c                           |   4 +-
 drivers/of/device.c                                |   6 +-
 drivers/pcmcia/cs.c                                |   4 +-
 drivers/power/supply/power_supply.h                |   2 +-
 drivers/power/supply/power_supply_sysfs.c          |   8 +-
 drivers/s390/char/hmcdrv_dev.c                     |   2 +-
 drivers/scsi/cxlflash/main.c                       |   2 +-
 drivers/tty/tty_io.c                               |   2 +-
 drivers/usb/class/usblp.c                          |   2 +-
 drivers/usb/core/file.c                            |   2 +-
 drivers/usb/gadget/udc/core.c                      |   4 +-
 drivers/usb/misc/iowarrior.c                       |   2 +-
 drivers/usb/misc/legousbtower.c                    |   2 +-
 drivers/usb/roles/class.c                          |   2 +-
 drivers/usb/typec/mux.c                            |   8 +-
 drivers/usb/typec/retimer.c                        |   2 +-
 drivers/vdpa/vdpa_user/vduse_dev.c                 |   2 +-
 drivers/vfio/vfio_main.c                           |   2 +-
 fs/kernfs/dir.c                                    | 106 ++++++----
 fs/kernfs/file.c                                   |  18 +-
 fs/kernfs/inode.c                                  |  12 +-
 fs/kernfs/kernfs-internal.h                        |   2 +-
 fs/kernfs/mount.c                                  |  10 +-
 fs/kernfs/symlink.c                                |   2 +-
 fs/nfs/sysfs.c                                     |   4 +-
 fs/pstore/pmsg.c                                   |   2 +-
 include/asm-generic/vmlinux.lds.h                  | 234 +++++++++------------
 include/linux/blkdev.h                             |   2 +-
 include/linux/container_of.h                       |  24 +--
 include/linux/device.h                             |   9 +-
 include/linux/device/class.h                       |   8 +-
 include/linux/ioport.h                             |   2 +-
 include/linux/kobject.h                            |  18 +-
 include/linux/kobject_ns.h                         |   4 +-
 include/linux/mISDNif.h                            |   2 +-
 include/linux/of_device.h                          |   4 +-
 include/linux/property.h                           |  84 ++++----
 include/linux/usb.h                                |  19 +-
 kernel/ksysfs.c                                    |  18 ++
 kernel/params.c                                    |   2 +-
 kernel/resource.c                                  |  17 +-
 lib/kobject.c                                      |  29 ++-
 net/atm/atm_sysfs.c                                |   4 +-
 net/bridge/br_if.c                                 |   2 +-
 net/core/net-sysfs.c                               |  20 +-
 net/rfkill/core.c                                  |   2 +-
 net/sunrpc/sysfs.c                                 |   8 +-
 net/wireless/sysfs.c                               |   2 +-
 sound/sound_core.c                                 |   2 +-
 96 files changed, 529 insertions(+), 528 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-cpu_byteorder

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ