summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
31 hoursdrm/xe/cper: Log CPER records for aggregate counter retrievalBadal Nilawar
Log CPER records for aggregate counter retrieval from userspace when cper_on_query sysfs is enabled. Assisted-by: LLM Reviewed-by: Raag Jadav <raag.jadav@intel.com> Link: https://patch.msgid.link/20261029113653.1860286-17-badal.nilawar@intel.com Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
31 hoursdrm/xe/cper: Construct CPER record for hardware errorsBadal Nilawar
Assemble the CPER record header, section descriptor and the Intel error section for Intel GPU hardware errors. Assisted-by: LLM Reviewed-by: Raag Jadav <raag.jadav@intel.com> Link: https://patch.msgid.link/20261029113653.1860286-16-badal.nilawar@intel.com Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
31 hoursdrm/xe/cper: Initialize Intel-specific CPER headerBadal Nilawar
Define the Intel-specific CPER header and initialize it from the error counter record for Intel GPU hardware errors. Assisted-by: LLM Reviewed-by: Raag Jadav <raag.jadav@intel.com> Link: https://patch.msgid.link/20261029113653.1860286-15-badal.nilawar@intel.com Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
31 hoursdrm/xe/cper: Retrieve the error counter record for CPER reportingBadal Nilawar
Retrieve error counter record required to build a CPER record. Assisted-by: LLM Reviewed-by: Raag Jadav <raag.jadav@intel.com> Link: https://patch.msgid.link/20261029113653.1860286-14-badal.nilawar@intel.com Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
31 hoursdrm/xe/cper: Add CPER reporting entry point for xe_logBadal Nilawar
Introduce xe_cper_emit() as the single entry point for emitting CPER records from xe_log. xe_log now forwards every SIGID log entry with its full context (component, location, data/len and formatted message), and xe_cper decides how to report it. Hardware SIGIDs are routed to a hardware error helper, software SIGIDs are left as TODO. Assisted-by: LLM Reviewed-by: Raag Jadav <raag.jadav@intel.com> Link: https://patch.msgid.link/20261029113653.1860286-13-badal.nilawar@intel.com Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
31 hoursMerge branch 'block-7.4' into for-nextJens Axboe
* block-7.4: (48 commits) zloop: check that the zone backing file support ->{read,write}_iter zloop: fput file after failed zone init zloop: share more code for opening a zone backing file zloop: remove a duplicate call to zloop_get_block_size nvmet: don't clear sq->ctrl for a Connect with sqsize 0 nvmet-rdma: fix double puts after a failed RDMA WRITE nvmet-rdma: disable interrupts under rsp_wr_wait_lock nvmet-rdma: flush nvmet-wq on module exit nvme-loop: don't BUG() if a scan runs beside a reset nvmet-tcp: don't read a removed port at Connect time nvmet: fix NULL dereference in debugfs host_traddr nvmet-tcp: stop listening when a port is removed nvmet: fix NULL dereference of PCI endpoint targets nvmet-auth: take only AUTH_Negotiate for a negotiation nvmet: don't truncate the length of big discards nvme-tcp: validate the TLS handshake timeout nvmet-tcp: validate the TLS handshake timeout nvmet: Free the old negotiation state when restarting authentication nvmet: Finish the blk plug when integrity allocation fails nvme-tcp: fix NULL queue->ctrl dereference on reconnect ...
31 hourszloop: check that the zone backing file support ->{read,write}_iterChristoph Hellwig
I/O to backing files requires support for iter based read/write, so check for that upfront instead of dereferencing a NULL pointer later. Fixes: eb0570c7df23 ("block: new zoned loop block device driver") Reported-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20261029150353.2503201-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
31 hourszloop: fput file after failed zone initChristoph Hellwig
Clean up after failure in zloop_init_zone, as the caller only cleans up the zones before the current one. Fixes: eb0570c7df23 ("block: new zoned loop block device driver") Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20261029150353.2503201-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
31 hourszloop: share more code for opening a zone backing fileChristoph Hellwig
Use a common path for opening and querying the block size. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20261029150353.2503201-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
31 hourszloop: remove a duplicate call to zloop_get_block_sizeChristoph Hellwig
The sequential zone path has two calls to zloop_get_block_size, one conditional on not having a block size, and one unconditionally. Remove the latter as the block size only needs to be queried once. Fixes: eb0570c7df23 ("block: new zoned loop block device driver") Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20261029150353.2503201-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
32 hoursMerge tag 'nvme-7.4-2026-10-28' of git://git.infradead.org/nvme into block-7.4Jens Axboe
nvme updates for Linux 7.4 - Fix regressions from the parallel nvme-tcp I/O queue setup: request PDU sizing with header digest, a NULL controller dereference when reconnecting with more queues, and early lock initialization - Handle TLS control records in nvme-tcp: skip records arriving ahead of the ICResp, and start error recovery when the socket read fails - Fix an nvme-tcp io_work priority inversion stalling I/O - Fix nvme-tcp address attribute race with queue teardown - Validate the TLS handshake timeout parameters for host and target - Fix fabrics connects with isolated CPUs and queue mapping bugs - Fix early boot hang and buffer size for the nvme.quirks parameter - Fix nvme-rdma NULL metadata SGL dereference with T10-PI - Fix ANA underflow check and an nvme-fc discovery reference leak - Fix nvme-loop BUG() when a namespace scan races a reset - Target port and configfs locking fixes, and port removal races - Target auth fixes for CHALLENGE failure and negotiation handling - Target fc fixes for a connection use-after-free, read data on failed commands, and admin queue allocation failure teardown - Target rdma fix for short connection requests - Target rdma fix for inline SGL out-of-bounds write - Target rdma refcount, locking, and module unload fixes - Target pci-epf SGL length and error status fixes - Target NULL dereference fixes for pci-epf and debugfs - Target ZNS NUMD overflow check - Target Connect fix for a controller leak with a zero queue size - Target fixes for a metadata SGL double-free and a leaked blk plug - Target fix for truncated large discards - Misc cleanups * tag 'nvme-7.4-2026-10-28' of git://git.infradead.org/nvme: (44 commits) nvmet: don't clear sq->ctrl for a Connect with sqsize 0 nvmet-rdma: fix double puts after a failed RDMA WRITE nvmet-rdma: disable interrupts under rsp_wr_wait_lock nvmet-rdma: flush nvmet-wq on module exit nvme-loop: don't BUG() if a scan runs beside a reset nvmet-tcp: don't read a removed port at Connect time nvmet: fix NULL dereference in debugfs host_traddr nvmet-tcp: stop listening when a port is removed nvmet: fix NULL dereference of PCI endpoint targets nvmet-auth: take only AUTH_Negotiate for a negotiation nvmet: don't truncate the length of big discards nvme-tcp: validate the TLS handshake timeout nvmet-tcp: validate the TLS handshake timeout nvmet: Free the old negotiation state when restarting authentication nvmet: Finish the blk plug when integrity allocation fails nvme-tcp: fix NULL queue->ctrl dereference on reconnect nvme-tcp: Validate the queue state under the queue lock in the address attribute nvme-tcp: fix io_work priority inversion when send_mutex is held nvme-tcp: fix request PDU size when header digest is enabled nvme-tcp: skip TLS control records while waiting for the ICResp ...
32 hoursUSB: serial: garmin_gps: fix deadlock on reset requestJohan Hovold
The garmin_gps driver has a reset feature that is supposed to reset the device when writing a private reset request packet. The reset is however done synchronously from the write() callback (and without holding the required device lock) which leads to a deadlock in the line discipline when hanging up the port as part of disconnect. Switch to using the asynchronous reset interface while dropping the redundant and synchronous stopping of the interrupt urb (write() callbacks are supposed to be atomic and USB core, USB serial core and the driver itself will unlink and kill all URBs during disconnect). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Josef Bacik <josef@toxicpanda.com> Link: https://lore.kernel.org/2026102733-prayer-drainer-56f3@gregkh Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: oti6858: fix the teardown order in closeJosef Bacik
The driver passes a baton around: the completion handler of the interrupt urb either resubmits the urb, submits the read urb or schedules one of the two delayed works, and the works and the bulk completion handlers submit the interrupt urb again. oti6858_close() cancels the works first and kills the urbs afterwards. An interrupt urb that completes in between schedules a work again: oti6858_close() cancel_delayed_work_sync(setup) cancel_delayed_work_sync(write) oti6858_read_int_callback() schedule_delayed_work(setup) usb_kill_urb(interrupt_in_urb) /* not in flight */ setup_line() usb_submit_urb(interrupt_in_urb) The port is now closed with the baton still going round. The next open fails because the interrupt urb is already submitted, and if the device is unplugged, oti6858_port_remove() frees the private data while a work may be pending or running. Poison the interrupt urb first: that waits for the handler and makes all further submissions fail, so nothing schedules the works any more. Then cancel the works, after which only the bulk urbs are left, kill those, and make the interrupt urb usable again for the next open. Don't print an error for the submissions that fail with -EPERM in this window, as oti6858_read_bulk_callback() already does. Fixes: 49cdee0ed0fc ("USB: oti6858 usb-serial driver (in Nokia CA-42 cable)") Cc: stable <stable@kernel.org> Cc: Johan Hovold <johan@kernel.org> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: io_edgeport: serialise MCR accessesJohan Hovold
Add a mutex to serialise modem control register updates to prevent concurrent tasks from interfering with each other. Note that the register updates are currently asynchronous so a task may read back a value which has not yet taken effect. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: io_edgeport: fix potential use-after-free on disconnectJohan Hovold
The driver submits command URBs asynchronously but fails to stop them on disconnect, something which could lead to a use-after-free when accessing driver data in the completion handler after a port has been unbound. Add an URB anchor to track and kill outstanding command URBs on disconnect. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: io_edgeport: fix potential fifo corruptionJohan Hovold
The device buffer size is determined during open() and the driver allocates a TX FIFO of corresponding size. Add the missing sanity check to prevent memory corruption in case a malicious device sends a second open response with a different buffer size. This issue was flagged by Sashiko when reviewing a related fix. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Link: https://sashiko.dev/#/patchset/20260714101316.823942-1-shpark061104%40gmail.com?part=1 Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: io_edgeport: move initial termios update to open()Johan Hovold
Explicitly update the terminal settings on open() instead of doing so from the interrupt completion handler when receiving an open command response, which in theory can be received after a failed open attempt. Note that this will be used to fix a FIFO corruption issue and also allows for switching to synchronous commands. Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: io_edgeport: fix potential NULL-deref at openJohan Hovold
Do not mark the port as open until after the write FIFO has been allocated and initialised to prevent a racing interrupt completion from attempting to send stale data and dereference the FIFO buffer pointer. Note that the open flag defaults to false and is cleared on close() so there is no need to reinitialise it on every open(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: io_edgeport: fix potential close() use-after-freeJohan Hovold
Add the missing open check on write() and locking when updating the port status during close() to prevent a racing interrupt completion handler from trying to submit more data for the port while its write URB and FIFO are being deallocated. This issue was flagged by Sashiko when reviewing a related fix. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Link: https://sashiko.dev/#/patchset/20260714101316.823942-1-shpark061104%40gmail.com?part=1 Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: io_edgeport: fix NULL-deref on early statusJohan Hovold
The driver submits the interrupt-in URB during probe or on first port open, which on completion may submit the bulk-in URB before all ports have been opened and their waitqueues have been initialised. If a (malicious) device sends a status message for a port that has not yet been opened this may lead to a NULL-pointer dereference in the bulk-in completion handler when attempting to wakeup blocked tasks. Move waitqueue initialisation from open() to port_probe() to address this. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot+763813d65c7e18c1b6d5@syzkaller.appspotmail.com Link: https://lore.kernel.org/6a8818d8.ae6ddae5.3da009.0031.GAE@google.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: upd78f0730: fix NULL-deref on hangupJohan Hovold
The port tty pointer is cleared on hangup before deasserting the modem control signals and should not be used in the dtr_rts() callback. Factor out a new upd78f0730_port_tiocmset() helper that can be used in upd78f0730_dtr_rts() to avoid dereferencing a NULL-pointer on hangup (e.g. on disconnect). This issue was flagged by an LLM. Fixes: ea534e0b4047 ("USB: serial: add uPD78F0730 USB to Serial Adaptor Driver") Cc: stable@vger.kernel.org # 4.11 Cc: Maksim Salau <maksim.salau@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: sierra: validate URB length in instat callbackTristan Madani
sierra_instat_callback() reads request fields and one byte past the usb_ctrlrequest header without first checking that urb->actual_length is large enough. A short USB interrupt transfer could cause an out-of-bounds read. Add two length checks matching the pattern already present in the option driver (option_instat_callback): one for the request header before accessing bRequestType, and one for the line-state data byte inside the serial-state notification handler. Use dev_err() since failing these checks causes the interrupt URB not to be resubmitted. Fixes: 033a3fb980b041 ("USB: Sierra Wireless driver update") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani <tristan@talencesecurity.com> [ johan: use sizeof(*req_pkt) consistently ] Signed-off-by: Johan Hovold <johan@kernel.org>
32 hoursUSB: serial: garmin_gps: validate packet data length in nat_receive()Hui Peng
In nat_receive() (called from garmin_write() when userspace writes to /dev/ttyUSBn in MODE_NATIVE mode), while garmin_data_p->insize is less than GARMIN_PKTHDR_LENGTH (12), the loop copies up to 12 bytes into garmin_data_p->inbuffer. Once garmin_data_p->insize reaches GARMIN_PKTHDR_LENGTH, nat_receive() computes the total packet size as: len = GARMIN_PKTHDR_LENGTH + getDataLength(garmin_data_p->inbuffer); Because getDataLength() returns a signed int from __le32_to_cpup(), a 12-byte header with a negative 32-bit length field (such as 0xfffffff5, i.e., -11) causes len to underflow to a small positive value (12 + (-11) = 1) without any bounds check at that point. Then garmin_data_p->insize >= len (12 >= 1) evaluates to true and nat_receive() calls garmin_write_bulk(port, inbuffer, 1, 0), which allocates a 1-byte slab buffer via kmemdup() and immediately reads 4 bytes from it in getLayerId(buffer) (and again in garmin_write_bulk_callback() when the URB completes): BUG: KASAN: slab-out-of-bounds in garmin_write_bulk.constprop.0+0x3eb/0x500 Read of size 4 at addr ffff888002cc0ba0 by task init/1 Call Trace: <TASK> dump_stack_lvl+0x70/0xa0 print_report+0x153/0x4c6 kasan_report+0xf1/0x120 garmin_write_bulk.constprop.0+0x3eb/0x500 garmin_write+0x60f/0x1450 serial_write+0x123/0x200 n_tty_write+0x8ea/0xeb0 file_tty_write.isra.0+0x44f/0x7a0 vfs_write+0x671/0xd20 Validate the unsigned 32-bit data length (dlen >= GPS_IN_BUFSIZ - GARMIN_PKTHDR_LENGTH, matching the existing len >= GPS_IN_BUFSIZ bound) in nat_receive() as soon as the 12-byte header is present, resetting insize and returning -EINVPKT on invalid lengths so garmin_write_bulk() is only ever called with a full valid packet header (12 <= len < GPS_IN_BUFSIZ). Tested in QEMU against Linux 7.3.0-rc3 by emulating a Garmin USB GPS device (091e:0003) via dummy_hcd + raw-gadget, switching /dev/ttyUSB0 to MODE_NATIVE via PRIV_PKTID_SET_MODE, and writing a 12-byte native packet with data length 0xfffffff5: on the unfixed kernel this triggers KASAN slab-out-of-bounds reads in garmin_write_bulk() and garmin_write_bulk_callback(), whereas on the fixed kernel nat_receive() rejects the packet with -EINVPKT and 0 KASAN faults. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Hui Peng <benquike@gmail.com> [ johan: move comment and dev_dbg(); add comment about redundant check ] Signed-off-by: Johan Hovold <johan@kernel.org>
33 hoursmmc: jz4740: Remove the host before resetting the controllerOlivier Louvignes
jz4740_mmc_remove() masks every interrupt and resets the controller before mmc_remove_host(), which removes the card and lets the card's driver send its last commands. Those commands then run on a controller that was just reset, and can wait out the driver's 5 s request timeout. With an SDIO card that cost 5 s on every unbind: on a HiBy R1 (Ingenic X1600, a BCM43430A1 driven by brcmfmac), the CMD52 that sdio_release_irq() sends from brcmfmac's remove waited 5.1 s. The command had finished (END_CMD_RES set in MSC_STAT), but MSC_IMASK read 0xffffffff although the request had unmasked END_CMD_RES. MSC_STAT can still show IS_RESETTING after jz4740_mmc_reset() returns, so the reset most likely completed after that write and undid it. Remove the host first, then quiesce the controller, as other host drivers do. On the R1, unbinding the Wi-Fi's MSC now takes 0.65 s. Fixes: 61bfbdb85687 ("MMC: Add support for the controller on JZ4740 SoCs.") Cc: stable@vger.kernel.org Signed-off-by: Olivier Louvignes <olivier@mgcrea.io> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
33 hoursgtp: Require 'CAP_NET_ADMIN' when joining the gtp multicast groupAnil Kaushik
The gtp generic netlink family sends notifications on its "gtp" multicast group when a PDP context is added or deleted, and for GTP-U echo responses. They carry the same attributes as a GETPDP reply: the MS and peer addresses, and the TEIDs, or the TID and the flow label. GETPDP requires CAP_NET_ADMIN, but generic netlink lets any user join a multicast group by default, so an unprivileged user in the network namespace of the gtp device can read all of this. Found by code inspection. Fix by marking the group with GENL_MCAST_CAP_NET_ADMIN, like the psample "packets" group, and with uns-admin-perm in the gtp netlink spec. Only users with CAP_NET_ADMIN in the user namespace owning the network namespace can then join it. This is still weaker than the check on GETPDP, which needs CAP_NET_ADMIN in the initial user namespace: in a network namespace owned by another user namespace, its root can join the group, but not use GETPDP. Genetlink has no multicast group flag for the initial user namespace, and ioam6 pairs its ops and its group the same way. This fix blocks the unprivileged users. Tested by joining the group as root, as root without CAP_NET_ADMIN, and as an unprivileged user: Before: root: joined root without CAP_NET_ADMIN: joined nobody: joined After: root: joined root without CAP_NET_ADMIN: EPERM nobody: EPERM Fixes: 50aba46c234e ("gtp: add notification mechanism") Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Anil Kaushik <anilkaushikwireless@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20261027130623.3136658-1-anilkaushikwireless@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
33 hoursrtc: rs5c372: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (rs5c372_sysfs_show_trim and rs5c372_sysfs_show_osc) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-12-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: ds1307: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in the sysfs show callback (ds3231_hwmon_show_temp) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-11-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: isl1208: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (timestamp0_show, isl1208_sysfs_show_atrim, isl1208_sysfs_show_dtrim and isl1208_sysfs_show_usr) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-10-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: ds1685: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (ds1685_rtc_sysfs_battery_show, ds1685_rtc_sysfs_auxbatt_show and ds1685_rtc_sysfs_serial_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Acked-by: Joshua Kinard <linux@kumba.dev> Link: https://patch.msgid.link/20261029132339.925021-9-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: ds1343: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (ds1343_show_glitchfilter and ds1343_show_tricklecharger) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-8-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: rx8025: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in the sysfs show callback (rx8025_sysfs_show_clock_adjust) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-7-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: abx80x: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (autocalibration_show and oscillator_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-6-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: x1205: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (x1205_sysfs_show_atrim and x1205_sysfs_show_dtrim) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-5-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: bq32k: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in the sysfs show callback (bq32k_sysfs_show_tricklecharge_bypass) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-4-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: ep93xx: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (comp_preload_show and comp_delete_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-3-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: pcf2127: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in the sysfs show callback (timestamp_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
33 hoursrtc: rv3029: use sysfs_emit() instead of sprintf()Alexandre Belloni
Use sysfs_emit() instead of sprintf() in sysfs show callbacks (rv3029_hwmon_show_temp and rv3029_hwmon_show_update_interval) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
34 hoursMerge branch 'block-7.4' into for-nextJens Axboe
* block-7.4: rnbd-srv: publish the sess_dev at the end of OPEN rnbd-srv: fix use-after-free on two CLOSE messages block/rnbd-srv: drop the sess_dev kobject unlocked block/rnbd-srv: don't free the device on a sysfs error drbd: take req_lock to skip the initial sync as peer drbd: stop the start_resync timer of a dying device
34 hoursrnbd-srv: publish the sess_dev at the end of OPENChris Mason
rnbd_sess_dev_alloc() stores the empty sess_dev in the XArray as its first step. An IO message with the new ID from another connection can find it before bdev_file is set, or hold a reference while a failing OPEN frees it after a mere RCU grace period. Both are reachable from any host that can open a device. Reserve the ID with a NULL entry and store the sess_dev once nothing can fail anymore. The error path still erases the ID, and no longer needs synchronize_rcu(). Fixes: 2de6c8de192b ("block/rnbd: server: main functionality") Cc: "Md. Haris Iqbal" <haris.iqbal@ionos.com> Cc: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Chris Mason <mason@kernel.org> Link: https://patch.msgid.link/20261028164415.1262013-41-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
34 hoursrnbd-srv: fix use-after-free on two CLOSE messagesChris Mason
process_msg_close() looks the sess_dev up with a kref, drops it right away, and only then takes the session mutex for the teardown. A session has several connections handled by different workers, so two CLOSE messages for the same ID both finish the lookup before either one tears the sess_dev down, and the second one works on freed memory. Any host that can open a device on the server can do that. Take the mutex first and look the ID up with xa_load() under it. The second CLOSE then finds nothing. Fixes: 2de6c8de192b ("block/rnbd: server: main functionality") Cc: "Md. Haris Iqbal" <haris.iqbal@ionos.com> Cc: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Chris Mason <mason@kernel.org> Link: https://patch.msgid.link/20261028164415.1262013-40-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
34 hoursblock/rnbd-srv: drop the sess_dev kobject unlockedJosef Bacik
rnbd_srv_create_dev_session_sysfs() drops the kobject reference when it fails. The release function is rnbd_destroy_sess_dev(), which takes srv_dev->lock, and the caller holds that lock: the worker deadlocks on itself. A client opening one device as "ram0" and "./ram0" gets there through -EEXIST from kobject_add(). Have process_msg_open() drop the reference after releasing the lock, and leave the rest of the cleanup to the release function. Fixes: 8cee532f469b ("block/rnbd: server: sysfs interface functions") Fixes: d3a95ccaaf4d ("block/rnbd: call kobject_put in the failure path") Cc: "Md. Haris Iqbal" <haris.iqbal@ionos.com> Cc: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Link: https://patch.msgid.link/20261028164415.1262013-18-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
34 hoursblock/rnbd-srv: don't free the device on a sysfs errorJosef Bacik
rnbd_srv_create_dev_sysfs() drops the only kobject reference on its error paths, and the release function frees the rnbd_srv_dev. process_msg_open() keeps using it and ends in destroy_device() with a list_del() and a second kfree(). This doesn't need memory pressure: a client opening a device while its last mapping goes away gets -EEXIST from kobject_add() against the old directory. Only undo kobject_add() on failure and leave the reference to destroy_device(). Initialise the kobject once, the next open retries. Fixes: 8cee532f469b ("block/rnbd: server: sysfs interface functions") Fixes: d3a95ccaaf4d ("block/rnbd: call kobject_put in the failure path") Cc: "Md. Haris Iqbal" <haris.iqbal@ionos.com> Cc: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Link: https://patch.msgid.link/20261028164415.1262013-17-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
34 hoursdrbd: take req_lock to skip the initial sync as peerJosef Bacik
_drbd_set_state() must be called with req_lock held. drbd_adm_new_c_uuid() does, receive_uuids() on the peer doesn't, so a concurrent state change gets lost: the device is Secondary again, or its failed disk UpToDate, while the work for the lost change is already queued. Fixes: b411b3637fa7 ("The DRBD driver") Cc: Philipp Reisner <philipp.reisner@linbit.com> Cc: Lars Ellenberg <lars.ellenberg@linbit.com> Cc: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Link: https://patch.msgid.link/20261028164415.1262013-15-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
34 hoursdrbd: stop the start_resync timer of a dying deviceJosef Bacik
start_resync_timer gets armed for up to a second and nothing ever deletes it, so drbd_destroy_device() can free the device with the timer pending. Shut it down where request_timer is shut down. Fixes: 370a43e7982d ("drbd: Work on the Ahead -> SyncSource transition") Cc: Philipp Reisner <philipp.reisner@linbit.com> Cc: Lars Ellenberg <lars.ellenberg@linbit.com> Cc: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Link: https://patch.msgid.link/20261028164415.1262013-13-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
35 hoursmmc: sunxi: fix clock and runtime PM leaks on probe failureAnfernee Cao
sunxi_mmc_resource_request() enables the bus, card, output and sample clocks before returning. Several failure paths later in sunxi_mmc_probe() leave them running: - If devm_request_threaded_irq() fails, the clocks enabled by sunxi_mmc_enable() are never disabled. - If dma_alloc_coherent(), mmc_of_parse() or sunxi_mmc_init_host() fails, probe only frees the DMA buffer and the mmc_host. - If mmc_add_host() fails, runtime PM has already been enabled, but pm_runtime_disable() is never called. Besides leaking the clocks, this leaves the clock enable counts unbalanced, so a reprobe (for example after -EPROBE_DEFER) calls clk_prepare_enable() on the same clocks again. Disable the IRQ and the clocks in the probe error path, and disable runtime PM on the mmc_add_host() failure path. Also handle a failure of devm_request_threaded_irq() in sunxi_mmc_resource_request(). Tested with QEMU's orangepi-pc machine: with forced sunxi_mmc_init_host() and mmc_add_host() failures the MMC clocks stay disabled in clk_summary, and a normal probe with an emulated SD card still works. This issue was found by manual code inspection. Fixes: 3cbcb16095f9 ("mmc: sunxi: Add driver for SD/MMC hosts found on Allwinner sunxi SoCs") Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Anfernee Cao <anferneemelokc5@gmail.com> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
35 hoursmmc: mmci: fix DMA channel leak when mmc_add_host() failsAnfernee Cao
mmci_probe() calls mmci_dma_setup(), which acquires the RX and TX DMA channels via dma_request_chan(). These channels are not managed by devres, and are released only by mmci_dma_release(). If the following mmc_add_host() fails, probe jumps to the clk_disable label, which only disables the clock. As probe then fails, mmci_remove() is never called, so both DMA channels are leaked. Release them by adding a dedicated unwind label, reached only after mmci_dma_setup(). This issue was found by manual code inspection. Fixes: b38a20f29a49 ("mmc: mmci: fix return value check of mmc_add_host()") Cc: stable@vger.kernel.org Signed-off-by: Anfernee Cao <anferneemelokc5@gmail.com> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
35 hourstg3: Invert restart quirk logic to restrict SNP power-down bypassNoam D. Eliyahu
Commit 9fc3bc764334 ("tg3: power down device only on SYSTEM_POWER_OFF") bypassed `tg3_power_down()` on system restarts to prevent reboot hangs and NMIs on servers where NICs were initialized via SNP (such as Dell PowerEdge R650 and R750). However, skipping the power-down flow globally causes the ACPI _PTS method to trigger fatal PCIe AER events and hangs on other models. Commit e0efe83ed325 ("tg3: Disable tg3 PCIe AER on system reboot") attempted to mitigate this by adding an AER-disable DMI quirk table. Maintaining a growing list of models for a secondary symptom misses the root cause, leaving systems like the PowerEdge T440 (sharing the BCM5720 NIC) exposed. Fix this by inverting the quirk logic: 1. Restrict SNP power-down avoidance strictly to `tg3_restart_snp_quirk_table` for the specific systems requiring it (Dell PowerEdge R650 and R750). 2. Restore standard power-down behavior for all other systems, eliminating the separate AER-disable quirk table. For systems affected by the original SNP restart issue, their shutdown flow remains completely untouched. Link: https://lore.kernel.org/netdev/20251221175050.14089-1-noam.d.eliyahu@gmail.com/T/#u Fixes: 9fc3bc764334 ("tg3: power down device only on SYSTEM_POWER_OFF") Fixes: e0efe83ed325 ("tg3: Disable tg3 PCIe AER on system reboot") Cc: stable@vger.kernel.org Signed-off-by: Noam D. Eliyahu <noam.d.eliyahu@gmail.com> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Link: https://patch.msgid.link/20261026220955.473247-1-noam.d.eliyahu@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
36 hoursnet: rnpgbe: Accept link-down events without speed magicDong Yibo
The interface can continue reporting carrier up after the link goes down because the driver ignores the firmware's link-down notification. Firmware reports link-down events with a zero port_magic and no valid speed or duplex information. The driver requires ST_VALID_MAGIC for every link event and returns before updating the cached link state when this check fails. It also writes an invalid driver snapshot to firmware instead of acknowledging the link-down state. Validate the speed magic only for link-up events. This allows link-down events to update the cached state, propagate carrier loss, and update the snapshot exported to firmware. Keep the checks for invalid link-up magic and unsupported speeds. Fixes: 92a671d510a8 ("net: rnpgbe: Add link status handling support") Signed-off-by: Dong Yibo <dong100@mucse.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/C2DFBBF04F1DCFD2+20261026075445.920572-1-dong100@mucse.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
36 hoursmmc: meson-gx: report the longest busy wait the controller can doIgor Velkov
The driver does not set max_busy_timeout, so the core takes the host for one that can wait for busy indefinitely and sends erase and cache flush as R1b with busy timeouts of up to 60 s and 30 s. The CMD_CFG timeout field holds at most 32768 ms, so the controller times out first. Report 32768 ms as max_busy_timeout. The core then sizes discards to fit and, for a longer wait, sends R1 and polls for busy itself. Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms") Cc: stable@vger.kernel.org Signed-off-by: Igor Velkov <iav@iav.lv> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
36 hoursmmc: meson-gx: report busy from DAT0 aloneIgor Velkov
meson_mmc_card_busy() reports busy only while DAT0..3 are all low. A busy card drives DAT0 low and leaves DAT1..3 to the pull-ups, and the callback is defined as "Check if the card is pulling dat[0] low". So a busy card is reported free, and the core, which prefers card_busy over CMD13 in mmc_busy_cb(), stops polling after CMD6 and erase at once. The controller hides this on R1b commands, where it waits for busy itself. Once max_busy_timeout is reported, the core sends the longer waits, the 120 s BKOPS and 240 s sanitize switches among them, as R1 and has only the polling left. Look at DAT0 only, as sdhci_card_busy() does. The checks around the voltage switch in mmc_set_uhs_voltage() still hold: the card drives DAT0..3 low together after CMD11 and keeps them low together on failure. Fixes: 186cd8b7f586 ("mmc: meson-gx: implement card_busy callback") Cc: stable@vger.kernel.org Signed-off-by: Igor Velkov <iav@iav.lv> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Ulf Hansson <ulfh@kernel.org>