Linux 5.15.220
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.15.220 kernel.
All users of the 5.15 kernel series must upgrade.
The updated 5.15.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.15.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/filesystems/fscrypt.rst | 4 Makefile | 2 arch/arm64/kvm/arm.c | 6 arch/s390/kvm/vsie.c | 1 drivers/accessibility/speakup/main.c | 1 drivers/base/power/main.c | 6 drivers/crypto/atmel-tdes.c | 5 drivers/crypto/mxs-dcp.c | 2 drivers/crypto/qce/aead.c | 58 ------ drivers/crypto/qce/common.c | 55 +---- drivers/crypto/qce/common.h | 16 - drivers/crypto/qce/regs-v5.h | 4 drivers/crypto/qce/sha.c | 30 --- drivers/crypto/qce/sha.h | 1 drivers/crypto/qce/skcipher.c | 97 ---------- drivers/fpga/dfl-fme-perf.c | 2 drivers/hid/hid-ft260.c | 162 +++++++++++++--- drivers/hid/hid-input.c | 17 + drivers/hid/hid-magicmouse.c | 25 ++ drivers/hid/hid-uclogic-core.c | 12 + drivers/infiniband/sw/rxe/rxe_qp.c | 3 drivers/mtd/maps/vmu-flash.c | 8 drivers/nvme/host/core.c | 12 - drivers/nvme/host/fabrics.c | 8 drivers/nvme/host/fault_inject.c | 2 drivers/nvme/host/fc.c | 8 drivers/nvme/target/admin-cmd.c | 20 +- drivers/nvme/target/core.c | 42 ++-- drivers/nvme/target/discovery.c | 14 - drivers/nvme/target/fabrics-cmd.c | 32 +-- drivers/nvme/target/io-cmd-bdev.c | 12 - drivers/nvme/target/nvmet.h | 2 drivers/nvme/target/passthru.c | 10 - drivers/nvme/target/rdma.c | 10 - drivers/nvme/target/tcp.c | 17 + drivers/nvme/target/zns.c | 30 +-- drivers/target/target_core_fabric_configfs.c | 8 drivers/usb/c67x00/c67x00-sched.c | 4 drivers/usb/core/devio.c | 2 drivers/usb/core/hub.c | 7 drivers/usb/gadget/function/f_tcm.c | 2 drivers/usb/host/xhci-dbgtty.c | 15 + drivers/usb/misc/usbtest.c | 1 drivers/usb/serial/option.c | 20 +- drivers/usb/serial/spcp8x5.c | 13 - fs/cifs/smb2ops.c | 4 fs/ext4/fast_commit.c | 10 - fs/ext4/ialloc.c | 4 fs/ext4/super.c | 40 ++-- fs/fuse/dir.c | 9 fs/fuse/file.c | 4 fs/jfs/inode.c | 2 fs/jfs/jfs_extent.c | 10 + fs/nilfs2/ioctl.c | 261 ++++++++++++--------------- include/linux/hid.h | 1 include/linux/inetdevice.h | 5 include/linux/nvme.h | 4 include/linux/sched.h | 8 include/target/target_core_fabric.h | 2 io_uring/io-wq.c | 9 kernel/bpf/offload.c | 10 - kernel/kcov.c | 122 ++++++------ lib/Kconfig.debug | 5 mm/swapfile.c | 7 net/bridge/br_multicast.c | 4 net/can/j1939/j1939-priv.h | 1 net/can/j1939/main.c | 5 net/can/j1939/socket.c | 55 +++++ net/core/filter.c | 1 net/ipv4/igmp.c | 14 - net/ipv6/ah6.c | 29 +-- net/ipv6/seg6_local.c | 7 net/netfilter/ipvs/ip_vs_xmit.c | 6 net/nfc/nci/ntf.c | 26 ++ net/smc/smc_core.c | 27 +- net/xfrm/espintcp.c | 9 net/xfrm/xfrm_user.c | 2 security/selinux/ss/conditional.c | 12 - sound/core/pcm_lib.c | 11 - sound/core/pcm_native.c | 32 ++- sound/soc/tegra/tegra_pcm.c | 3 sound/usb/card.c | 14 + sound/usb/midi.c | 2 83 files changed, 841 insertions(+), 744 deletions(-)
Aleksandr Nogikh (1):
usb: usbtest: disable dynamic ID support
Asim Viladi Oglu Manizada (1):
xfrm: ah6: validate routing header segments_left
Baokun Li (2):
fuse: fix invalidate lock leak on setattr writeback failure
fuse: fix invalidate lock leak on open O_TRUNC DAX failure
Bartosz Golaszewski (1):
crypto: qce - Remove unsafe/deprecated algorithms
Bryam Vargas (1):
nfc: nci: add data_len bound checks to activation parameter extractors
Christian Borntraeger (1):
KVM: s390: vsie: zero stale crypto bits
Eric Biggers (2):
ext4: don't enable DAX on new encrypted files mm/swap: reject swapon() on filesystem-level encrypted files
Eric Dumazet (1):
ipv4: igmp: Fix potential UAF in igmp_gq_start_timer()
Florian Westphal (1):
ipvs: reload ip header after head reallocation
Greg Kroah-Hartman (1):
Linux 5.15.220
Griffin Kroah-Hartman (3):
fpga: dfl: fme: add error handling
usb: core: Add lock to usb_wakeup_notification()
usb: core: Strengthen error handling in hub_hub_status()
Guanghui Yang (1):
ext4: propagate errors from fast commit range replay
Haoxiang Li (1):
accessibility: speakup: unregister tty ldisc on later init failures
Ibrahim Hashimov (2):
nvmet-tcp: bound SGL data length before allocating command buffers
HID: uclogic: fix use-after-free of inrange_timer on remove
Ji'an Zhou (1):
ALSA: PCM: Fix wait queue list corruption in snd_pcm_drain() on linked streams
Jiale Yao (1):
USB: serial: option: fix slab OOB read in interrupt URB callback
Jiayuan Chen (1):
bpf: Fix use-after-free in offloaded map/prog info fill
Johan Hovold (1):
USB: serial: spcp8x5: drop broken carrier detect support
Jon Hunter (1):
ASoC: tegra: Fix Master Volume Control
Jose Villaseñor Montfort (2):
HID: magicmouse: prevent unbounded recursion in magicmouse_raw_event()
HID: input: read battery capacity from its actual report offset
Kuniyuki Iwashima (1):
smc: Use __sk_dst_get() and dst_dev_rcu() in smc_vlan_by_tcpsk().
Kyle Zeng (1):
ipv6: seg6: clear IPv4 control block on IPIP decapsulation
Lucas De Marchi (2):
xhci: dbgtty: Fix unregister on tty_register_driver() failure
xhci: dbgtty: Fix unregister on tty_alloc_driver() failure
Marouane El Moufid (1):
ALSA: usb-audio: fix OOB write in snd_usbmidi_novation_output()
Md Sadre Alam (1):
crypto: qce - fix CCM AAD buffer underallocation
Mehul Rao (1):
ALSA: pcm: fix use-after-free on linked stream runtime in snd_pcm_drain()
Michael Zaidman (7):
HID: ft260: fix i2c probing for hwmon devices
HID: ft260: improve i2c write performance
HID: ft260: improve i2c large reads performance
HID: ft260: skip unexpected HID input reports
HID: ft260: wake up device from power saving mode
HID: ft260: missed NACK from busy device
HID: ft260: validate i2c input report length
Miguel Peñaranda (1):
usb: usbfs: fix use-after-free of usb_device in usbdev_release()
Norbert Szetei (1):
net: bridge: mcast: fix use-after-free of a master VLAN's multicast context
Oliver Upton (1):
KVM: arm64: Prevent access to vCPU events before init
Oswald Buddenhagen (1):
ALSA: pcm: fix wait_time calculations
Peiyang He (1):
RDMA/rxe: Fix OOB in free_rd_atomic_resources()
Raman Varabets (1):
HID: ft260: fix stack-use-after-return write in I2C read race
Ryusuke Konishi (2):
nilfs2: correct return value kernel-doc descriptions for ioctl functions
nilfs2: reject invalid block index in GC ioctl
Sabrina Dubroca (1):
xfrm: espintcp: fix UAF during close
Sasha Levin (3):
Revert "PM: sleep: Use complete() in device_pm_sleep_init()" Revert "mtd: maps: vmu-flash: fix fault in unaligned fixup" Revert "smb: client: use kvzalloc() for megabyte buffer in simple fallocate"
Sebastian Andrzej Siewior (2):
bpf: Remove tst_run from lwt_seg6local_prog_ops.
kcov: replace local_irq_save() with a local_lock_t
Shuangpeng Bai (2):
usb: gadget: f_tcm: keep port count until LUN teardown completes
USB: c67x00: fix use-after-free in c67x00_add_iso_urb()
Stephen Smalley (1):
selinux: switch two allocations to use kzalloc_objs()
Tetsuo Handa (4):
can: j1939: implement NETDEV_UNREGISTER notification handler
can: j1939: add missing calls in NETDEV_UNREGISTER notification handler
can: j1939: make j1939_sk_bind() fail if device is no longer registered
kcov: fix data corruption and race conditions on PREEMPT_RT
Thorsten Blum (2):
crypto: atmel-tdes - use scatterlist length before DMA mapping
crypto: mxs-dcp - fix source scatterlist length access
Vasiliy Kovalev (2):
jfs: add check read-only before truncation in jfs_truncate_nolock()
jfs: add check read-only before txBeginAnon() call
Vishnu Razdan (1):
io_uring/io-wq: fix worker accounting when canceling creation callbacks
Weiwen Hu (1):
nvme: rename CDR/MORE/DNR to NVME_STATUS_*
Will Porter (1):
ALSA: usb-audio: Complete cleanup after system-resume errors
Zhiling Zou (1):
xfrm: drop ESP-in-TCP packets with no ingress device
Zihan Xi (1):
xfrm: fix xfrm_state_construct() auth-trunc leak
Greg Kroah-Hartman
maintainerDocumentation/filesystems/fscrypt.rst +4 -0
@@ -1063,6 +1063,10 @@ astute users may notice some differences in behavior: - DAX (Direct Access) is not supported on encrypted files. +- Encrypted files cannot be used directly as swap files. To swap to + an encrypted file, set up a loopback device on top of it. + Alternatively, encrypted swap can use a dm-crypt device. + - The maximum length of an encrypted symlink is 2 bytes shorter than the maximum length of an unencrypted symlink. For example, on an EXT4 filesystem with a 4K block size, unencrypted symlinks can be up
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 15 -SUBLEVEL = 219 +SUBLEVEL = 220 EXTRAVERSION = NAME = Trick or Treat
arch/arm64/kvm/arm.c +6 -0
@@ -1313,6 +1313,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,case KVM_GET_VCPU_EVENTS : {struct kvm_vcpu_events events; +if (!kvm_vcpu_initialized (vcpu)) +return -ENOEXEC ; +if (kvm_arm_vcpu_get_events (vcpu, &events))return -EINVAL ;
@@ -1324,6 +1327,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,case KVM_SET_VCPU_EVENTS : {struct kvm_vcpu_events events; +if (!kvm_vcpu_initialized (vcpu)) +return -ENOEXEC ; +if (copy_from_user (&events, argp,sizeof (events)))return -EFAULT ;
arch/s390/kvm/vsie.c +1 -0
@@ -145,6 +145,7 @@ static int setup_apcb10(struct kvm_vcpu *vcpu, struct kvm_s390_apcb1 *apcb_s,if (read_guest_real (vcpu, apcb_o, &tmp,sizeof (struct kvm_s390_apcb0 )))return -EFAULT ; +memset (apcb_s,0 ,sizeof (*apcb_s)); apcb_s->apm[0 ] = apcb_h->apm[0 ] & tmp.apm[0 ]; apcb_s->aqm[0 ] = apcb_h->aqm[0 ] & tmp.aqm[0 ] &0xffff000000000000UL ; apcb_s->adm[0 ] = apcb_h->adm[0 ] & tmp.adm[0 ] &0xffff000000000000UL ;
drivers/accessibility/speakup/main.c +1 -0
@@ -2430,6 +2430,7 @@ static int __init speakup_init(void)mutex_lock (&spk_mutex);synth_release ();mutex_unlock (&spk_mutex); +spk_ttyio_unregister_ldisc ();speakup_kobj_exit (); error_kobjects:
drivers/base/power/main.c +1 -5
@@ -102,7 +102,7 @@ void device_pm_sleep_init(struct device *dev) dev->power.is_noirq_suspended = false; dev->power.is_late_suspended = false;init_completion (&dev->power.completion); -complete (&dev->power.completion); +complete_all (&dev->power.completion); dev->power.wakeup =NULL ;INIT_LIST_HEAD (&dev->power.entry); }
@@ -239,10 +239,6 @@ static void dpm_wait(struct device *dev, bool async)if (!dev)return ; -/* Devices with no PM support don't use the completion. */ -if (dev->power.no_pm) -return ; -if (async || (pm_async_enabled && dev->power.async_suspend))wait_for_completion (&dev->power.completion); }
drivers/crypto/atmel-tdes.c +2 -3
@@ -499,14 +499,13 @@ static int atmel_tdes_crypt_start(struct atmel_tdes_dev *dd)IS_ALIGNED (dd->out_sg->length, dd->ctx->block_size); fast = in && out; -if (sg_dma_len (dd->in_sg) !=sg_dma_len (dd->out_sg)) +if (dd->in_sg->length != dd->out_sg->length) fast =0 ; }if (fast) { - count =min_t (size_t, dd->total,sg_dma_len (dd->in_sg)); - count =min_t (size_t, count,sg_dma_len (dd->out_sg)); + count =min_t (size_t, dd->total, dd->in_sg->length); err =dma_map_sg (dd->dev, dd->in_sg,1 ,DMA_TO_DEVICE );if (!err) {
drivers/crypto/mxs-dcp.c +1 -1
@@ -333,7 +333,7 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq)for_each_sg (req->src, src,sg_nents (req->src), i) { src_buf =sg_virt (src); - len =sg_dma_len (src); + len = src->length; tlen += len; limit_hit = tlen > req->cryptlen;
drivers/crypto/qce/aead.c +2 -56
88 lines not on this page · raw message
drivers/crypto/qce/common.c +12 -43
113 lines not on this page · raw message
drivers/crypto/qce/common.h +3 -13
@@ -22,7 +22,7 @@/* IV length in bytes */ #define QCE_AES_IV_LENGTH AES_BLOCK_SIZE -/* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */ +/* max of AES_BLOCK_SIZE */ #define QCE_MAX_IV_SIZE AES_BLOCK_SIZE/* maximum nonce bytes */
@@ -33,14 +33,10 @@#define QCE_MAX_ALIGN_SIZE 64/* cipher algorithms */ -#define QCE_ALG_DES BIT(0) -#define QCE_ALG_3DES BIT(1)#define QCE_ALG_AES BIT(2)/* hash and hmac algorithms */ -#define QCE_HASH_SHA1 BIT(3)#define QCE_HASH_SHA256 BIT(4) -#define QCE_HASH_SHA1_HMAC BIT(5)#define QCE_HASH_SHA256_HMAC BIT(6)#define QCE_HASH_AES_CMAC BIT(7)
@@ -58,21 +54,15 @@#define QCE_ENCRYPT BIT(30)#define QCE_DECRYPT BIT(31) -#define IS_DES (flags) (flags & QCE_ALG_DES) -#define IS_3DES (flags) (flags & QCE_ALG_3DES)#define IS_AES (flags) (flags & QCE_ALG_AES) -#define IS_SHA1 (flags) (flags & QCE_HASH_SHA1)#define IS_SHA256 (flags) (flags & QCE_HASH_SHA256) -#define IS_SHA1_HMAC (flags) (flags & QCE_HASH_SHA1_HMAC)#define IS_SHA256_HMAC (flags) (flags & QCE_HASH_SHA256_HMAC)#define IS_CMAC (flags) (flags & QCE_HASH_AES_CMAC) -#define IS_SHA (flags) (IS_SHA1(flags) || IS_SHA256(flags)) -#define IS_SHA_HMAC (flags) \ - (IS_SHA1_HMAC(flags) || IS_SHA256_HMAC(flags)) +#define IS_SHA (flags) IS_SHA256(flags) +#define IS_SHA_HMAC (flags) IS_SHA256_HMAC(flags)#define IS_CBC (mode) (mode & QCE_MODE_CBC) -#define IS_ECB (mode) (mode & QCE_MODE_ECB)#define IS_CTR (mode) (mode & QCE_MODE_CTR)#define IS_XTS (mode) (mode & QCE_MODE_XTS)#define IS_CCM (mode) (mode & QCE_MODE_CCM)
drivers/crypto/qce/regs-v5.h +0 -4
@@ -203,7 +203,6 @@#define AUTH_SIZE_SHIFT 9#define AUTH_SIZE_MASK GENMASK(13, 9) -#define AUTH_SIZE_SHA1 0#define AUTH_SIZE_SHA256 1#define AUTH_SIZE_ENUM_1_BYTES 0#define AUTH_SIZE_ENUM_2_BYTES 1
@@ -284,15 +283,12 @@#define ENCR_KEY_SZ_SHIFT 3#define ENCR_KEY_SZ_MASK GENMASK(5, 3) -#define ENCR_KEY_SZ_DES 0 -#define ENCR_KEY_SZ_3DES 1#define ENCR_KEY_SZ_AES128 0#define ENCR_KEY_SZ_AES256 2#define ENCR_ALG_SHIFT 0#define ENCR_ALG_MASK GENMASK(2, 0)#define ENCR_ALG_NONE 0 -#define ENCR_ALG_DES 1#define ENCR_ALG_AES 2#define ENCR_ALG_KASUMI 4#define ENCR_ALG_SNOW_3G 5
drivers/crypto/qce/sha.c +2 -28
@@ -24,10 +24,6 @@ struct qce_sha_saved_state {static LIST_HEAD (ahash_algs); -static const u32 std_iv_sha1[SHA256_DIGEST_SIZE /sizeof (u32)] = { -SHA1_H0 ,SHA1_H1 ,SHA1_H2 ,SHA1_H3 ,SHA1_H4 ,0 ,0 ,0 -}; -static const u32 std_iv_sha256[SHA256_DIGEST_SIZE /sizeof (u32)] = {SHA256_H0 ,SHA256_H1 ,SHA256_H2 ,SHA256_H3 ,SHA256_H4 ,SHA256_H5 ,SHA256_H6 ,SHA256_H7
@@ -346,9 +342,7 @@ static int qce_ahash_hmac_setkey(struct crypto_ahash *tfm, const u8 *key,return 0 ; } -if (digestsize ==SHA1_DIGEST_SIZE ) - alg_name ="sha1-qce" ; -else if (digestsize ==SHA256_DIGEST_SIZE ) +if (digestsize ==SHA256_DIGEST_SIZE ) alg_name ="sha256-qce" ;else return -EINVAL ;
@@ -409,15 +403,6 @@ struct qce_ahash_def { };static const struct qce_ahash_def ahash_def[] = { - { - .flags =QCE_HASH_SHA1 , - .name ="sha1" , - .drv_name ="sha1-qce" , - .digestsize =SHA1_DIGEST_SIZE , - .blocksize =SHA1_BLOCK_SIZE , - .statesize =sizeof (struct qce_sha_saved_state ), - .std_iv = std_iv_sha1, - }, { .flags =QCE_HASH_SHA256 , .name ="sha256" ,
@@ -427,15 +412,6 @@ static const struct qce_ahash_def ahash_def[] = { .statesize = sizeof(struct qce_sha_saved_state), .std_iv = std_iv_sha256, }, - { - .flags = QCE_HASH_SHA1_HMAC, - .name = "hmac(sha1)", - .drv_name = "hmac-sha1-qce", - .digestsize = SHA1_DIGEST_SIZE, - .blocksize = SHA1_BLOCK_SIZE, - .statesize = sizeof(struct qce_sha_saved_state), - .std_iv = std_iv_sha1, - }, { .flags = QCE_HASH_SHA256_HMAC, .name = "hmac(sha256)",
@@ -473,9 +449,7 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def, alg->halg.digestsize = def->digestsize; alg->halg.statesize = def->statesize; -if (IS_SHA1 (def->flags)) - tmpl->hash_zero = sha1_zero_message_hash; -else if (IS_SHA256 (def->flags)) +if (IS_SHA256 (def->flags)) tmpl->hash_zero = sha256_zero_message_hash; base = &alg->halg.base;
drivers/crypto/qce/sha.h +0 -1
@@ -7,7 +7,6 @@#define _SHA_H_#include <crypto/scatterwalk.h> -#include <crypto/sha1.h> #include <crypto/sha2.h> #include "common.h"
drivers/crypto/qce/skcipher.c +2 -95
133 lines not on this page · raw message
drivers/fpga/dfl-fme-perf.c +2 -0
@@ -925,6 +925,8 @@ static int fme_perf_pmu_register(struct platform_device *pdev,PERF_PMU_CAP_NO_EXCLUDE ; name =devm_kasprintf (priv->dev,GFP_KERNEL ,"dfl_fme%d" , pdev->id); +if (!name) +return -ENOMEM ; ret =perf_pmu_register (pmu, name,-1 );if (ret)
drivers/hid/hid-ft260.c +127 -35
272 lines not on this page · raw message
drivers/hid/hid-input.c +13 -4
@@ -367,19 +367,27 @@ static int hidinput_query_battery_capacity(struct hid_device *dev) {u8 *buf;int ret; +/* +* The capacity field may not be the first field in the report: some +* devices (e.g. the Apple Magic Trackpad 2 over Bluetooth) precede it +* with status flags. Read it from its actual byte offset in the report +* (report_offset is in bits; the leading byte is the report id). +*/ +int offset =1 + dev->battery_report_offset /8 ; +int len = offset +1 ; - buf =kmalloc (4 ,GFP_KERNEL ); + buf =kmalloc (max (len,4 ),GFP_KERNEL );if (!buf)return -ENOMEM ; - ret =hid_hw_raw_request (dev, dev->battery_report_id, buf,4 , + ret =hid_hw_raw_request (dev, dev->battery_report_id, buf,max (len,4 ), dev->battery_report_type,HID_REQ_GET_REPORT ); -if (ret <2 ) { +if (ret < len) {kfree (buf);return -ENODATA ; } - ret =hidinput_scale_battery_capacity (dev, buf[1 ]); + ret =hidinput_scale_battery_capacity (dev, buf[offset]);kfree (buf);return ret; }
@@ -497,6 +505,7 @@ static int hidinput_setup_battery(struct hid_device *dev, unsigned report_type, dev->battery_max = max; dev->battery_report_type = report_type; dev->battery_report_id = field->report->id; + dev->battery_report_offset = field->report_offset;/* * Stylus is normally not connected to the device and thus we
drivers/hid/hid-magicmouse.c +20 -5
@@ -368,8 +368,8 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda } } -static int magicmouse_raw_event (struct hid_device *hdev, -struct hid_report *report,u8 *data,int size) +static int __magicmouse_raw_event (struct hid_device *hdev, +struct hid_report *report,u8 *data,int size,bool nested) {struct magicmouse_sc *msc =hid_get_drvdata (hdev);struct input_dev *input = msc->input;
@@ -480,6 +480,15 @@ static int magicmouse_raw_event(struct hid_device *hdev,* packet. */ +/* +* A double report only ever wraps two normal reports, so it is +* never nested. Refuse to recurse a second time; otherwise a +* malicious device could chain DOUBLE_REPORT_ID packets to drive +* unbounded recursion and overflow the kernel stack. +*/ +if (nested) +return 0 ; +/* Ensure that we have at least 2 elements (report type and size) */ if (size <2 )return 0 ;
@@ -491,9 +500,9 @@ static int magicmouse_raw_event(struct hid_device *hdev,return 0 ; } -magicmouse_raw_event (hdev, report, data +2 , data[1 ]); -magicmouse_raw_event (hdev, report, data +2 + data[1 ], - size -2 - data[1 ]); +__magicmouse_raw_event (hdev, report, data +2 , data[1 ], true); +__magicmouse_raw_event (hdev, report, data +2 + data[1 ], + size -2 - data[1 ], true);return 0 ;default :return 0 ;
@@ -516,6 +525,12 @@ static int magicmouse_raw_event(struct hid_device *hdev,return 1 ; } +static int magicmouse_raw_event (struct hid_device *hdev, +struct hid_report *report,u8 *data,int size) +{ +return __magicmouse_raw_event (hdev, report, data, size, false); +} +static int magicmouse_event (struct hid_device *hdev,struct hid_field *field,struct hid_usage *usage,__s32 value) {
drivers/hid/hid-uclogic-core.c +11 -1
@@ -346,7 +346,17 @@ static void uclogic_remove(struct hid_device *hdev) {struct uclogic_drvdata *drvdata =hid_get_drvdata (hdev); -del_timer_sync (&drvdata->inrange_timer); +/* +* Shut the in-range timer down before stopping the device. +* uclogic_raw_event_pen() re-arms inrange_timer on every pen report +* and keeps running until hid_hw_stop() stops the transport, so a +* plain timer_delete_sync() here can be undone by a report landing in +* the window before hid_hw_stop(). timer_shutdown_sync() cancels the +* timer and makes any later re-arm a no-op, so it is provably dead +* before hid_hw_stop() frees the input device drvdata->pen_input +* points at. +*/ +timer_shutdown_sync (&drvdata->inrange_timer);hid_hw_stop (hdev);kfree (drvdata->desc_ptr);uclogic_params_cleanup (&drvdata->params);
drivers/infiniband/sw/rxe/rxe_qp.c +1 -2
@@ -598,10 +598,9 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask,int max_dest_rd_atomic = attr->max_dest_rd_atomic ?roundup_pow_of_two (attr->max_dest_rd_atomic) :0 ; - qp->attr.max_dest_rd_atomic = max_dest_rd_atomic; -free_rd_atomic_resources (qp); + qp->attr.max_dest_rd_atomic = max_dest_rd_atomic; err =alloc_rd_atomic_resources (qp, max_dest_rd_atomic);if (err)return err;
drivers/mtd/maps/vmu-flash.c +5 -3
@@ -610,7 +610,7 @@ static int vmu_connect(struct maple_device *mdev) basic_flash_data =be32_to_cpu (mdev->devinfo.function_data[c -1 ]); - card = kzalloc_obj(struct memcard); + card =kmalloc (sizeof (struct memcard ),GFP_KERNEL );if (!card) { error = -ENOMEM ; goto fail_nomem;
@@ -628,13 +628,15 @@ static int vmu_connect(struct maple_device *mdev)* Not sure there are actually any multi-partition devices in the * real world, but the hardware supports them, so, so will we */ - card->parts = kzalloc_objs(struct vmupart, card->partitions); + card->parts =kmalloc_array (card->partitions,sizeof (struct vmupart ), +GFP_KERNEL );if (!card->parts) { error = -ENOMEM ; goto fail_partitions; } - card->mtd = kzalloc_objs(struct mtd_info, card->partitions); + card->mtd =kmalloc_array (card->partitions,sizeof (struct mtd_info ), +GFP_KERNEL );if (!card->mtd) { error = -ENOMEM ; goto fail_mtd_info;
drivers/nvme/host/core.c +6 -6
@@ -308,7 +308,7 @@ static void nvme_retry_req(struct request *req)u16 crd;/* The mask and shift result must be <= 3 */ - crd = (nvme_req (req)->status &NVME_SC_CRD ) >>11 ; + crd = (nvme_req (req)->status &NVME_STATUS_CRD ) >>11 ;if (crd) delay =nvme_req (req)->ctrl->crdt[crd -1 ] *100 ;
@@ -329,7 +329,7 @@ static inline enum nvme_disposition nvme_decide_disposition(struct request *req)return COMPLETE ;if (blk_noretry_request (req) || - (nvme_req (req)->status &NVME_SC_DNR ) || + (nvme_req (req)->status &NVME_STATUS_DNR ) ||nvme_req (req)->retries >= nvme_max_retries)return COMPLETE ;
@@ -1519,7 +1519,7 @@ static int nvme_identify_ns(struct nvme_ctrl *ctrl, unsigned nsid, goto out_free_id; } - error =NVME_SC_INVALID_NS |NVME_SC_DNR ; + error =NVME_SC_INVALID_NS |NVME_STATUS_DNR ;if ((*id)->ncap ==0 )/* namespace not allocated or attached */ goto out_free_id;
@@ -4015,7 +4015,7 @@ static void nvme_ns_remove_by_nsid(struct nvme_ctrl *ctrl, u32 nsid)static void nvme_validate_ns (struct nvme_ns *ns,struct nvme_ns_ids *ids) {struct nvme_id_ns *id; -int ret =NVME_SC_INVALID_NS |NVME_SC_DNR ; +int ret =NVME_SC_INVALID_NS |NVME_STATUS_DNR ;if (test_bit (NVME_NS_DEAD , &ns->flags)) goto out;
@@ -4024,7 +4024,7 @@ static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_ids *ids)if (ret) goto out; - ret =NVME_SC_INVALID_NS |NVME_SC_DNR ; + ret =NVME_SC_INVALID_NS |NVME_STATUS_DNR ;if (!nvme_ns_ids_equal (&ns->head->ids, ids)) {dev_err (ns->ctrl->device,"identifiers changed for nsid %d\n" , ns->head->ns_id);
@@ -4042,7 +4042,7 @@ static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_ids *ids)* * TODO: we should probably schedule a delayed retry here. */ -if (ret >0 && (ret &NVME_SC_DNR )) +if (ret >0 && (ret &NVME_STATUS_DNR ))nvme_ns_remove (ns); }
drivers/nvme/host/fabrics.c +4 -4
@@ -161,7 +161,7 @@ int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val)if (unlikely (ret !=0 ))dev_err (ctrl->device,"Property Get error: %d, offset %#x\n" , - ret >0 ? ret & ~NVME_SC_DNR : ret, off); + ret >0 ? ret & ~NVME_STATUS_DNR : ret, off);return ret; }
@@ -207,7 +207,7 @@ int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val)if (unlikely (ret !=0 ))dev_err (ctrl->device,"Property Get error: %d, offset %#x\n" , - ret >0 ? ret & ~NVME_SC_DNR : ret, off); + ret >0 ? ret & ~NVME_STATUS_DNR : ret, off);return ret; }EXPORT_SYMBOL_GPL (nvmf_reg_read64);
@@ -249,7 +249,7 @@ int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val)if (unlikely (ret))dev_err (ctrl->device,"Property Set error: %d, offset %#x\n" , - ret >0 ? ret & ~NVME_SC_DNR : ret, off); + ret >0 ? ret & ~NVME_STATUS_DNR : ret, off);return ret; }EXPORT_SYMBOL_GPL (nvmf_reg_write32);
@@ -284,7 +284,7 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl, int errval, int offset, struct nvme_command *cmd, struct nvmf_connect_data *data) { - int err_sctype = errval & ~NVME_SC_DNR; + int err_sctype = errval & ~NVME_STATUS_DNR;switch (err_sctype) {case (NVME_SC_CONNECT_INVALID_PARAM ):
drivers/nvme/host/fault_inject.c +1 -1
@@ -75,7 +75,7 @@ void nvme_should_fail(struct request *req)/* inject status code and DNR bit */ status = fault_inject->status;if (fault_inject->dont_retry) - status |=NVME_SC_DNR ; + status |=NVME_STATUS_DNR ;nvme_req (req)->status = status; } }
drivers/nvme/host/fc.c +4 -4
@@ -3108,7 +3108,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)if (ctrl->ctrl.icdoff) {dev_err (ctrl->ctrl.device,"icdoff %d is not supported!\n" , ctrl->ctrl.icdoff); - ret =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + ret =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; goto out_disconnect_admin_queue; }
@@ -3116,7 +3116,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)if (!nvme_ctrl_sgl_supported (&ctrl->ctrl)) {dev_err (ctrl->ctrl.device,"Mandatory sgls are not supported!\n" ); - ret =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + ret =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; goto out_disconnect_admin_queue; }
@@ -3287,7 +3287,7 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status)dev_info (ctrl->ctrl.device,"NVME-FC{%d}: reset: Reconnect attempt failed (%d)\n" , ctrl->cnum, status); -if (status >0 && (status &NVME_SC_DNR )) +if (status >0 && (status &NVME_STATUS_DNR )) recon = false; }else if (time_after_eq (jiffies, rport->dev_loss_end)) recon = false;
@@ -3304,7 +3304,7 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status)queue_delayed_work (nvme_wq, &ctrl->connect_work, recon_delay); }else {if (portptr->port_state ==FC_OBJSTATE_ONLINE ) { -if (status >0 && (status &NVME_SC_DNR )) +if (status >0 && (status &NVME_STATUS_DNR ))dev_warn (ctrl->ctrl.device,"NVME-FC{%d}: reconnect failure\n" , ctrl->cnum);
drivers/nvme/target/admin-cmd.c +10 -10
@@ -342,7 +342,7 @@ static void nvmet_execute_get_log_page(struct nvmet_req *req)pr_debug ("unhandled lid %d on qid %d\n" , req->cmd->get_log_page.lid, req->sq->qid); req->error_loc = offsetof(struct nvme_get_log_page_command , lid); -nvmet_req_complete (req,NVME_SC_INVALID_FIELD |NVME_SC_DNR ); +nvmet_req_complete (req,NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ); }static void nvmet_execute_identify_ctrl (struct nvmet_req *req)
@@ -491,7 +491,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)if (le32_to_cpu (req->cmd->identify.nsid) ==NVME_NSID_ALL ) { req->error_loc = offsetof(struct nvme_identify , nsid); - status =NVME_SC_INVALID_NS |NVME_SC_DNR ; + status =NVME_SC_INVALID_NS |NVME_STATUS_DNR ; goto out; }
@@ -657,7 +657,7 @@ static void nvmet_execute_identify_desclist(struct nvmet_req *req)if (sg_zero_buffer (req->sg, req->sg_cnt,NVME_IDENTIFY_DATA_SIZE - off, off) !=NVME_IDENTIFY_DATA_SIZE - off) - status =NVME_SC_INTERNAL |NVME_SC_DNR ; + status =NVME_SC_INTERNAL |NVME_STATUS_DNR ; out:nvmet_req_complete (req, status);
@@ -814,7 +814,7 @@ u16 nvmet_set_feat_async_event(struct nvmet_req *req, u32 mask)if (val32 & ~mask) { req->error_loc = offsetof(struct nvme_common_command , cdw11); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }WRITE_ONCE (req->sq->ctrl->aen_enabled, val32);
@@ -840,7 +840,7 @@ void nvmet_execute_set_features(struct nvmet_req *req) ncqr = (cdw11 >>16 ) &0xffff ; nsqr = cdw11 &0xffff ;if (ncqr ==0xffff || nsqr ==0xffff ) { - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;break ; } nvmet_set_result(req,
@@ -853,14 +853,14 @@ void nvmet_execute_set_features(struct nvmet_req *req) status =nvmet_set_feat_async_event (req,NVMET_AEN_CFG_ALL );break ;case NVME_FEAT_HOST_ID : - status =NVME_SC_CMD_SEQ_ERROR |NVME_SC_DNR ; + status =NVME_SC_CMD_SEQ_ERROR |NVME_STATUS_DNR ;break ;case NVME_FEAT_WRITE_PROTECT : status =nvmet_set_feat_write_protect (req);break ;default : req->error_loc = offsetof(struct nvme_common_command , cdw10); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;break ; }
@@ -946,7 +946,7 @@ void nvmet_execute_get_features(struct nvmet_req *req)if (!(req->cmd->common.cdw11 &cpu_to_le32 (1 <<0 ))) { req->error_loc = offsetof(struct nvme_common_command , cdw11); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;break ; }
@@ -959,7 +959,7 @@ void nvmet_execute_get_features(struct nvmet_req *req)default : req->error_loc = offsetof(struct nvme_common_command , cdw10); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;break ; }
@@ -976,7 +976,7 @@ void nvmet_execute_async_event(struct nvmet_req *req)mutex_lock (&ctrl->lock);if (ctrl->nr_async_event_cmds >=NVMET_ASYNC_EVENTS ) {mutex_unlock (&ctrl->lock); -nvmet_req_complete (req,NVME_SC_ASYNC_LIMIT |NVME_SC_DNR ); +nvmet_req_complete (req,NVME_SC_ASYNC_LIMIT |NVME_STATUS_DNR );return ; } ctrl->async_event_cmds[ctrl->nr_async_event_cmds++] = req;
drivers/nvme/target/core.c +21 -21
157 lines not on this page · raw message
drivers/nvme/target/discovery.c +7 -7
@@ -178,7 +178,7 @@ static void nvmet_execute_disc_get_log_page(struct nvmet_req *req)if (req->cmd->get_log_page.lid !=NVME_LOG_DISC ) { req->error_loc = offsetof(struct nvme_get_log_page_command , lid); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; goto out; }
@@ -186,7 +186,7 @@ static void nvmet_execute_disc_get_log_page(struct nvmet_req *req)if (offset &0x3 ) { req->error_loc = offsetof(struct nvme_get_log_page_command , lpo); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; goto out; }
@@ -251,7 +251,7 @@ static void nvmet_execute_disc_identify(struct nvmet_req *req)if (req->cmd->identify.cns !=NVME_ID_CNS_CTRL ) { req->error_loc = offsetof(struct nvme_identify , cns); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; goto out; }
@@ -313,7 +313,7 @@ static void nvmet_execute_disc_set_features(struct nvmet_req *req)default : req->error_loc = offsetof(struct nvme_common_command , cdw10); - stat =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + stat =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;break ; }
@@ -338,7 +338,7 @@ static void nvmet_execute_disc_get_features(struct nvmet_req *req)default : req->error_loc = offsetof(struct nvme_common_command , cdw10); - stat =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + stat =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;break ; }
@@ -354,7 +354,7 @@ u16 nvmet_parse_discovery_cmd(struct nvmet_req *req) cmd->common.opcode); req->error_loc = offsetof(struct nvme_common_command , opcode); -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ; }switch (cmd->common.opcode) {
@@ -379,7 +379,7 @@ u16 nvmet_parse_discovery_cmd(struct nvmet_req *req)default :pr_debug ("unhandled cmd %d\n" , cmd->common.opcode); req->error_loc = offsetof(struct nvme_common_command , opcode); -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ; } }
drivers/nvme/target/fabrics-cmd.c +16 -16
@@ -18,7 +18,7 @@ static void nvmet_execute_prop_set(struct nvmet_req *req)if (req->cmd->prop_set.attrib &1 ) { req->error_loc = offsetof(struct nvmf_property_set_command , attrib); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; goto out; }
@@ -29,7 +29,7 @@ static void nvmet_execute_prop_set(struct nvmet_req *req)default : req->error_loc = offsetof(struct nvmf_property_set_command , offset); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; } out:nvmet_req_complete (req, status);
@@ -50,7 +50,7 @@ static void nvmet_execute_prop_get(struct nvmet_req *req) val = ctrl->cap;break ;default : - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;break ; } }else {
@@ -65,7 +65,7 @@ static void nvmet_execute_prop_get(struct nvmet_req *req) val = ctrl->csts;break ;default : - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;break ; } }
@@ -97,7 +97,7 @@ u16 nvmet_parse_fabrics_cmd(struct nvmet_req *req)pr_debug ("received unknown capsule type 0x%x\n" , cmd->fabrics.fctype); req->error_loc = offsetof(struct nvmf_common_command , fctype); -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ; }return 0 ;
@@ -116,14 +116,14 @@ static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req)pr_warn ("queue size zero!\n" ); req->error_loc = offsetof(struct nvmf_connect_command , sqsize); req->cqe->result.u32 =IPO_IATTR_CONNECT_SQE (sqsize); - ret =NVME_SC_CONNECT_INVALID_PARAM |NVME_SC_DNR ; + ret =NVME_SC_CONNECT_INVALID_PARAM |NVME_STATUS_DNR ; goto err; }if (ctrl->sqs[qid] !=NULL ) {pr_warn ("qid %u has already been created\n" , qid); req->error_loc = offsetof(struct nvmf_connect_command , qid); -return NVME_SC_CMD_SEQ_ERROR |NVME_SC_DNR ; +return NVME_SC_CMD_SEQ_ERROR |NVME_STATUS_DNR ; }if (sqsize > mqes) {
@@ -131,14 +131,14 @@ static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req) sqsize, mqes, ctrl->cntlid); req->error_loc = offsetof(struct nvmf_connect_command , sqsize); req->cqe->result.u32 =IPO_IATTR_CONNECT_SQE (sqsize); -return NVME_SC_CONNECT_INVALID_PARAM |NVME_SC_DNR ; +return NVME_SC_CONNECT_INVALID_PARAM |NVME_STATUS_DNR ; } old =cmpxchg (&req->sq->ctrl,NULL , ctrl);if (old) {pr_warn ("queue already connected!\n" ); req->error_loc = offsetof(struct nvmf_connect_command , opcode); -return NVME_SC_CONNECT_CTRL_BUSY |NVME_SC_DNR ; +return NVME_SC_CONNECT_CTRL_BUSY |NVME_STATUS_DNR ; }/* note: convert queue size from 0's-based value to 1's-based value */
@@ -191,14 +191,14 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req)pr_warn ("invalid connect version (%d).\n" ,le16_to_cpu (c->recfmt)); req->error_loc = offsetof(struct nvmf_connect_command , recfmt); - status =NVME_SC_CONNECT_FORMAT |NVME_SC_DNR ; + status =NVME_SC_CONNECT_FORMAT |NVME_STATUS_DNR ; goto out; }if (unlikely (d->cntlid !=cpu_to_le16 (0xffff ))) {pr_warn ("connect attempt for invalid controller ID %#x\n" , d->cntlid); - status =NVME_SC_CONNECT_INVALID_PARAM |NVME_SC_DNR ; + status =NVME_SC_CONNECT_INVALID_PARAM |NVME_STATUS_DNR ; req->cqe->result.u32 =IPO_IATTR_CONNECT_DATA (cntlid); goto out; }
@@ -255,7 +255,7 @@ static void nvmet_execute_io_connect(struct nvmet_req *req)if (c->recfmt !=0 ) {pr_warn ("invalid connect version (%d).\n" ,le16_to_cpu (c->recfmt)); - status =NVME_SC_CONNECT_FORMAT |NVME_SC_DNR ; + status =NVME_SC_CONNECT_FORMAT |NVME_STATUS_DNR ; goto out; }
@@ -264,13 +264,13 @@ static void nvmet_execute_io_connect(struct nvmet_req *req) ctrl =nvmet_ctrl_find_get (d->subsysnqn, d->hostnqn,le16_to_cpu (d->cntlid), req);if (!ctrl) { - status =NVME_SC_CONNECT_INVALID_PARAM |NVME_SC_DNR ; + status =NVME_SC_CONNECT_INVALID_PARAM |NVME_STATUS_DNR ; goto out; }if (unlikely (qid > ctrl->subsys->max_qid)) {pr_warn ("invalid queue id (%d)\n" , qid); - status =NVME_SC_CONNECT_INVALID_PARAM |NVME_SC_DNR ; + status =NVME_SC_CONNECT_INVALID_PARAM |NVME_STATUS_DNR ; req->cqe->result.u32 =IPO_IATTR_CONNECT_SQE (qid); goto out_ctrl_put; }
@@ -303,13 +303,13 @@ u16 nvmet_parse_connect_cmd(struct nvmet_req *req)pr_debug ("invalid command 0x%x on unconnected queue.\n" , cmd->fabrics.opcode); req->error_loc = offsetof(struct nvme_common_command , opcode); -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ; }if (cmd->fabrics.fctype != nvme_fabrics_type_connect) {pr_debug ("invalid capsule type 0x%x on unconnected queue.\n" , cmd->fabrics.fctype); req->error_loc = offsetof(struct nvmf_common_command , fctype); -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ; }if (cmd->connect.qid ==0 )
drivers/nvme/target/io-cmd-bdev.c +6 -6
@@ -124,11 +124,11 @@ u16 blk_to_nvme_status(struct nvmet_req *req, blk_status_t blk_sts)*/ switch (blk_sts) {case BLK_STS_NOSPC : - status =NVME_SC_CAP_EXCEEDED |NVME_SC_DNR ; + status =NVME_SC_CAP_EXCEEDED |NVME_STATUS_DNR ; req->error_loc = offsetof(struct nvme_rw_command , length);break ;case BLK_STS_TARGET : - status =NVME_SC_LBA_RANGE |NVME_SC_DNR ; + status =NVME_SC_LBA_RANGE |NVME_STATUS_DNR ; req->error_loc = offsetof(struct nvme_rw_command , slba);break ;case BLK_STS_NOTSUPP :
@@ -136,10 +136,10 @@ u16 blk_to_nvme_status(struct nvmet_req *req, blk_status_t blk_sts)switch (req->cmd->common.opcode) {case nvme_cmd_dsm:case nvme_cmd_write_zeroes: - status =NVME_SC_ONCS_NOT_SUPPORTED |NVME_SC_DNR ; + status =NVME_SC_ONCS_NOT_SUPPORTED |NVME_STATUS_DNR ;break ;default : - status =NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; + status =NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ; }break ;case BLK_STS_MEDIUM :
@@ -148,7 +148,7 @@ u16 blk_to_nvme_status(struct nvmet_req *req, blk_status_t blk_sts)break ;case BLK_STS_IOERR :default : - status =NVME_SC_INTERNAL |NVME_SC_DNR ; + status =NVME_SC_INTERNAL |NVME_STATUS_DNR ; req->error_loc = offsetof(struct nvme_common_command , opcode); }
@@ -339,7 +339,7 @@ static void nvmet_bdev_execute_flush(struct nvmet_req *req)u16 nvmet_bdev_flush (struct nvmet_req *req) {if (blkdev_issue_flush (req->ns->bdev)) -return NVME_SC_INTERNAL |NVME_SC_DNR ; +return NVME_SC_INTERNAL |NVME_STATUS_DNR ;return 0 ; }
drivers/nvme/target/nvmet.h +1 -1
@@ -653,7 +653,7 @@ static inline void nvmet_req_cns_error_complete(struct nvmet_req *req)pr_debug ("unhandled identify cns %d on qid %d\n" , req->cmd->identify.cns, req->sq->qid); req->error_loc = offsetof(struct nvme_identify , cns); -nvmet_req_complete (req,NVME_SC_INVALID_FIELD |NVME_SC_DNR ); +nvmet_req_complete (req,NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ); }static inline void nvmet_req_bio_put (struct nvmet_req *req,struct bio *bio)
drivers/nvme/target/passthru.c +5 -5
@@ -243,7 +243,7 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req) ns =nvme_find_get_ns (ctrl, nsid);if (unlikely (!ns)) {pr_err ("failed to get passthru ns nsid:%u\n" , nsid); - status =NVME_SC_INVALID_NS |NVME_SC_DNR ; + status =NVME_SC_INVALID_NS |NVME_STATUS_DNR ; goto out; }
@@ -362,7 +362,7 @@ u16 nvmet_parse_passthru_io_cmd(struct nvmet_req *req)* emulated in the future if regular targets grow support for * this feature. */ -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ; }return nvmet_setup_passthru_command (req);
@@ -414,7 +414,7 @@ static u16 nvmet_passthru_get_set_features(struct nvmet_req *req)case NVME_FEAT_RESV_PERSIST :/* No reservations, see nvmet_parse_passthru_io_cmd() */ default : -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ; } }
@@ -482,7 +482,7 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req) req->p.use_workqueue = true;return NVME_SC_SUCCESS ; } -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ;case NVME_ID_CNS_NS : req->execute = nvmet_passthru_execute_cmd; req->p.use_workqueue = true;
@@ -494,7 +494,7 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req) req->p.use_workqueue = true;return NVME_SC_SUCCESS ; } -return NVME_SC_INVALID_OPCODE |NVME_SC_DNR ; +return NVME_SC_INVALID_OPCODE |NVME_STATUS_DNR ;default :return nvmet_setup_passthru_command (req); }
drivers/nvme/target/rdma.c +5 -5
@@ -852,12 +852,12 @@ static u16 nvmet_rdma_map_sgl_inline(struct nvmet_rdma_rsp *rsp)if (!nvme_is_write (rsp->req.cmd)) { rsp->req.error_loc = offsetof(struct nvme_common_command , opcode); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }if (off + len > rsp->queue->dev->inline_data_size) {pr_err ("invalid inline data offset!\n" ); -return NVME_SC_SGL_INVALID_OFFSET |NVME_SC_DNR ; +return NVME_SC_SGL_INVALID_OFFSET |NVME_STATUS_DNR ; }/* no data command? */
@@ -921,7 +921,7 @@ static u16 nvmet_rdma_map_sgl(struct nvmet_rdma_rsp *rsp)pr_err ("invalid SGL subtype: %#x\n" , sgl->type); rsp->req.error_loc = offsetof(struct nvme_common_command , dptr); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }case NVME_KEY_SGL_FMT_DATA_DESC :switch (sgl->type &0xf ) {
@@ -933,12 +933,12 @@ static u16 nvmet_rdma_map_sgl(struct nvmet_rdma_rsp *rsp)pr_err ("invalid SGL subtype: %#x\n" , sgl->type); rsp->req.error_loc = offsetof(struct nvme_common_command , dptr); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }default :pr_err ("invalid SGL type: %#x\n" , sgl->type); rsp->req.error_loc = offsetof(struct nvme_common_command , dptr); -return NVME_SC_SGL_INVALID_TYPE |NVME_SC_DNR ; +return NVME_SC_SGL_INVALID_TYPE |NVME_STATUS_DNR ; } }
drivers/nvme/target/tcp.c +15 -2
@@ -394,13 +394,26 @@ static int nvmet_tcp_map_data(struct nvmet_tcp_cmd *cmd)if (!len)return 0 ; +/* +* inline_data_size only bounds the in-capsule (type 0x01) SGL +* descriptor below. A non-inline transport SGL data-block +* descriptor skips that check entirely and would otherwise reach +* sgl_alloc() with an attacker-controlled len of up to 4 GiB, +* pinning that much kernel memory for a command that may never +* complete. Bound every descriptor type here, before allocating +* anything, using the same ceiling this file already applies to +* per-PDU H2C data. +*/ +if (len >NVMET_TCP_MAXH2CDATA ) +return NVME_SC_SGL_INVALID_DATA |NVME_STATUS_DNR ; +if (sgl->type == ((NVME_SGL_FMT_DATA_DESC <<4 ) |NVME_SGL_FMT_OFFSET )) {if (!nvme_is_write (cmd->req.cmd)) -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ;if (len > cmd->req.port->inline_data_size) -return NVME_SC_SGL_INVALID_OFFSET |NVME_SC_DNR ; +return NVME_SC_SGL_INVALID_OFFSET |NVME_STATUS_DNR ; cmd->pdu_len = len; } cmd->req.transfer_len += len;
drivers/nvme/target/zns.c +15 -15
@@ -104,7 +104,7 @@ void nvmet_execute_identify_cns_cs_ns(struct nvmet_req *req)if (le32_to_cpu (req->cmd->identify.nsid) ==NVME_NSID_ALL ) { req->error_loc = offsetof(struct nvme_identify , nsid); - status =NVME_SC_INVALID_NS |NVME_SC_DNR ; + status =NVME_SC_INVALID_NS |NVME_STATUS_DNR ; goto out; }
@@ -125,7 +125,7 @@ void nvmet_execute_identify_cns_cs_ns(struct nvmet_req *req) }if (!bdev_is_zoned (req->ns->bdev)) { - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; req->error_loc = offsetof(struct nvme_identify , nsid); goto out; }
@@ -162,17 +162,17 @@ static u16 nvmet_bdev_validate_zone_mgmt_recv(struct nvmet_req *req)if (sect >=get_capacity (req->ns->bdev->bd_disk)) { req->error_loc = offsetof(struct nvme_zone_mgmt_recv_cmd , slba); -return NVME_SC_LBA_RANGE |NVME_SC_DNR ; +return NVME_SC_LBA_RANGE |NVME_STATUS_DNR ; }if (out_bufsize <sizeof (struct nvme_zone_report )) { req->error_loc = offsetof(struct nvme_zone_mgmt_recv_cmd , numd); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }if (req->cmd->zmr.zra !=NVME_ZRA_ZONE_REPORT ) { req->error_loc = offsetof(struct nvme_zone_mgmt_recv_cmd , zra); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }switch (req->cmd->zmr.pr) {
@@ -181,7 +181,7 @@ static u16 nvmet_bdev_validate_zone_mgmt_recv(struct nvmet_req *req)break ;default : req->error_loc = offsetof(struct nvme_zone_mgmt_recv_cmd , pr); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }switch (req->cmd->zmr.zrasf) {
@@ -197,7 +197,7 @@ static u16 nvmet_bdev_validate_zone_mgmt_recv(struct nvmet_req *req)default : req->error_loc = offsetof(struct nvme_zone_mgmt_recv_cmd , zrasf); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }return NVME_SC_SUCCESS ;
@@ -346,7 +346,7 @@ static u16 blkdev_zone_mgmt_errno_to_nvme_status(int ret)return NVME_SC_SUCCESS ;case -EINVAL :case -EIO : -return NVME_SC_ZONE_INVALID_TRANSITION |NVME_SC_DNR ; +return NVME_SC_ZONE_INVALID_TRANSITION |NVME_STATUS_DNR ;default :return NVME_SC_INTERNAL ; }
@@ -470,7 +470,7 @@ static u16 nvmet_bdev_execute_zmgmt_send_all(struct nvmet_req *req)default :/* this is needed to quiet compiler warning */ req->error_loc = offsetof(struct nvme_zone_mgmt_send_cmd , zsa); -return NVME_SC_INVALID_FIELD |NVME_SC_DNR ; +return NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; }return NVME_SC_SUCCESS ;
@@ -488,7 +488,7 @@ static void nvmet_bdev_zmgmt_send_work(struct work_struct *w)if (op ==REQ_OP_LAST ) { req->error_loc = offsetof(struct nvme_zone_mgmt_send_cmd , zsa); - status =NVME_SC_ZONE_INVALID_TRANSITION |NVME_SC_DNR ; + status =NVME_SC_ZONE_INVALID_TRANSITION |NVME_STATUS_DNR ; goto out; }
@@ -500,13 +500,13 @@ static void nvmet_bdev_zmgmt_send_work(struct work_struct *w)if (sect >=get_capacity (bdev->bd_disk)) { req->error_loc = offsetof(struct nvme_zone_mgmt_send_cmd , slba); - status =NVME_SC_LBA_RANGE |NVME_SC_DNR ; + status =NVME_SC_LBA_RANGE |NVME_STATUS_DNR ; goto out; }if (sect & (zone_sectors -1 )) { req->error_loc = offsetof(struct nvme_zone_mgmt_send_cmd , slba); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; goto out; }
@@ -557,13 +557,13 @@ void nvmet_bdev_execute_zone_append(struct nvmet_req *req)if (sect >=get_capacity (req->ns->bdev->bd_disk)) { req->error_loc = offsetof(struct nvme_rw_command , slba); - status =NVME_SC_LBA_RANGE |NVME_SC_DNR ; + status =NVME_SC_LBA_RANGE |NVME_STATUS_DNR ; goto out; }if (sect & (bdev_zone_sectors (req->ns->bdev) -1 )) { req->error_loc = offsetof(struct nvme_rw_command , slba); - status =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; + status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; goto out; }
@@ -597,7 +597,7 @@ void nvmet_bdev_execute_zone_append(struct nvmet_req *req) }if (total_len !=nvmet_rw_data_len (req)) { - status =NVME_SC_INTERNAL |NVME_SC_DNR ; + status =NVME_SC_INTERNAL |NVME_STATUS_DNR ; goto out_put_bio; }
drivers/target/target_core_fabric_configfs.c +8 -0
@@ -689,6 +689,14 @@ static void target_fabric_port_unlink( }core_dev_del_lun (se_tpg, lun); + +if (tf->tf_ops->fabric_post_unlink) { +/* +* Allow fabrics to release state that must remain valid until +* core_dev_del_lun() has drained all active LUN references. +*/ + tf->tf_ops->fabric_post_unlink (se_tpg, lun); + } }static void target_fabric_port_release (struct config_item *item)
drivers/usb/c67x00/c67x00-sched.c +2 -2
@@ -761,13 +761,13 @@ static int c67x00_add_iso_urb(struct c67x00_hcd *c67x00, struct urb *urb) ret); urb->iso_frame_desc[urbp->cnt].actual_length =0 ; urb->iso_frame_desc[urbp->cnt].status = ret; -if (urbp->cnt +1 == urb->number_of_packets) -c67x00_giveback_urb (c67x00, urb,0 ); } urbp->ep_data->next_frame =frame_add (urbp->ep_data->next_frame, urb->interval); urbp->cnt++; +if (ret && urbp->cnt == urb->number_of_packets) +c67x00_giveback_urb (c67x00, urb,0 ); }return 0 ; }
drivers/usb/core/devio.c +1 -1
@@ -1099,7 +1099,6 @@ static int usbdev_release(struct inode *inode, struct file *file)if (!ps->suspend_allowed)usb_autosuspend_device (dev);usb_unlock_device (dev); -usb_put_dev (dev);put_pid (ps->disc_pid);put_cred (ps->cred);
@@ -1108,6 +1107,7 @@ static int usbdev_release(struct inode *inode, struct file *file)free_async (as); as =async_getcompleted (ps); } +usb_put_dev (dev);kfree (ps);return 0 ;
drivers/usb/core/hub.c +6 -1
@@ -714,10 +714,12 @@ void usb_wakeup_notification(struct usb_device *hdev, {struct usb_hub *hub;struct usb_port *port_dev; +unsigned long flags;if (!hdev)return ; +spin_lock_irqsave (&device_state_lock, flags); hub =usb_hub_to_struct_hub (hdev);if (hub) { port_dev = hub->ports[portnum -1 ];
@@ -727,6 +729,7 @@ void usb_wakeup_notification(struct usb_device *hdev,set_bit (portnum, hub->wakeup_bits);kick_hub_wq (hub); } +spin_unlock_irqrestore (&device_state_lock, flags); }EXPORT_SYMBOL_GPL (usb_wakeup_notification);
@@ -952,10 +955,12 @@ static int hub_hub_status(struct usb_hub *hub,mutex_lock (&hub->status_mutex); ret =get_hub_status (hub->hdev, &hub->status->hub); -if (ret <0 ) { +if (ret < (int )sizeof (hub->status->hub)) {if (ret != -ENODEV )dev_err (hub->intfdev,"%s failed (err = %d)\n" , __func__, ret); +if (ret >=0 ) + ret = -EIO ; }else { *status =le16_to_cpu (hub->status->hub.wHubStatus); *change =le16_to_cpu (hub->status->hub.wHubChange);
drivers/usb/gadget/function/f_tcm.c +1 -1
@@ -1714,7 +1714,7 @@ static const struct target_core_fabric_ops usbg_ops = { .fabric_make_tpg = usbg_make_tpg, .fabric_drop_tpg = usbg_drop_tpg, .fabric_post_link = usbg_port_link, - .fabric_pre_unlink = usbg_port_unlink, + .fabric_post_unlink = usbg_port_unlink, .fabric_init_nodeacl = usbg_init_nodeacl, .tfc_wwn_attrs = usbg_wwn_attrs,
drivers/usb/host/xhci-dbgtty.c +11 -4
@@ -576,8 +576,8 @@ static int dbc_tty_init(void) dbc_tty_driver =tty_alloc_driver (64 ,TTY_DRIVER_REAL_RAW |TTY_DRIVER_DYNAMIC_DEV );if (IS_ERR (dbc_tty_driver)) { -idr_destroy (&dbc_tty_minors); -return PTR_ERR (dbc_tty_driver); + ret =PTR_ERR (dbc_tty_driver); + goto fail; } dbc_tty_driver->driver_name ="dbc_serial" ;
@@ -597,10 +597,17 @@ static int dbc_tty_init(void) ret =tty_register_driver (dbc_tty_driver);if (ret) {pr_err ("Can't register dbc tty driver\n" ); -tty_driver_kref_put (dbc_tty_driver); -idr_destroy (&dbc_tty_minors); + goto fail_put; } +return ret; + +fail_put: +tty_driver_kref_put (dbc_tty_driver); +fail: +idr_destroy (&dbc_tty_minors); + dbc_tty_driver =NULL ; +return ret; }
drivers/usb/misc/usbtest.c +1 -0
@@ -3053,6 +3053,7 @@ static struct usb_driver usbtest_driver = { .disconnect = usbtest_disconnect, .suspend = usbtest_suspend, .resume = usbtest_resume, + .no_dynamic_id = 1, };/*-------------------------------------------------------------------------*/
drivers/usb/serial/option.c +17 -3
@@ -2691,12 +2691,26 @@ static void option_instat_callback(struct urb *urb)dev_dbg (dev,"%s: NULL req_pkt\n" , __func__);return ; } + +if (urb->actual_length <sizeof (*req_pkt)) { +dev_err (dev,"%s: short packet: %u bytes\n" , __func__, + urb->actual_length); +return ; + } +if ((req_pkt->bRequestType ==0xA1 ) && (req_pkt->bRequest ==0x20 )) { +unsigned char signals;int old_dcd_state; -unsigned char signals = *((unsigned char *) - urb->transfer_buffer + -sizeof (struct usb_ctrlrequest )); + +if (urb->actual_length <sizeof (*req_pkt) +1 ) { +dev_err (dev,"%s: short interrupt transfer: %u bytes\n" , + __func__, urb->actual_length); +return ; + } + + signals = *((unsigned char *)urb->transfer_buffer + +sizeof (*req_pkt));dev_dbg (dev,"%s: signal x%x\n" , __func__, signals);
drivers/usb/serial/spcp8x5.c +0 -13
@@ -247,18 +247,6 @@ static void spcp8x5_set_work_mode(struct usb_serial_port *port, u16 value,dev_err (&port->dev,"failed to set work mode: %d\n" , ret); } -static int spcp8x5_carrier_raised (struct usb_serial_port *port) -{ -u8 msr; -int ret; - - ret =spcp8x5_get_msr (port, &msr); -if (ret || msr &MSR_STATUS_LINE_DCD ) -return 1 ; - -return 0 ; -} -static void spcp8x5_dtr_rts (struct usb_serial_port *port,int on) {struct spcp8x5_private *priv =usb_get_serial_port_data (port);
@@ -470,7 +458,6 @@ static struct usb_serial_driver spcp8x5_device = { .num_bulk_out = 1, .open = spcp8x5_open, .dtr_rts = spcp8x5_dtr_rts, - .carrier_raised = spcp8x5_carrier_raised, .set_termios = spcp8x5_set_termios, .init_termios = spcp8x5_init_termios, .tiocmget = spcp8x5_tiocmget,
fs/cifs/smb2ops.c +2 -2
@@ -3736,7 +3736,7 @@ static int smb3_simple_fallocate_range(unsigned int xid,if (rc) goto out; - buf =kvzalloc (1024 *1024 ,GFP_KERNEL ); + buf =kzalloc (1024 *1024 ,GFP_KERNEL );if (buf ==NULL ) { rc = -ENOMEM ; goto out;
@@ -3803,7 +3803,7 @@ static int smb3_simple_fallocate_range(unsigned int xid, out:kfree (out_data); -kvfree (buf); +kfree (buf);return rc; }
fs/ext4/fast_commit.c +7 -3
@@ -1780,8 +1780,10 @@ static int ext4_fc_replay_add_range(struct super_block *sb,if (ret ==0 ) {/* Range is not mapped */ path =ext4_find_extent (inode, cur,NULL ,0 ); -if (IS_ERR (path)) +if (IS_ERR (path)) { + ret =PTR_ERR (path); goto out; + }memset (&newex,0 ,sizeof (newex)); newex.ee_block =cpu_to_le32 (cur); ext4_ext_store_pblock(
@@ -1843,9 +1845,10 @@ static int ext4_fc_replay_add_range(struct super_block *sb, }ext4_ext_replay_shrink_inode (inode,i_size_read (inode) >> sb->s_blocksize_bits); + ret =0 ; out:iput (inode); -return 0 ; +return ret; }/* Replay DEL_RANGE tag */
@@ -1906,9 +1909,10 @@ ext4_fc_replay_del_range(struct super_block *sb,ext4_ext_replay_shrink_inode (inode,i_size_read (inode) >> sb->s_blocksize_bits);ext4_mark_inode_dirty (NULL , inode); + ret =0 ; out:iput (inode); -return 0 ; +return ret; }static void ext4_fc_set_bitmaps_and_counters (struct super_block *sb)
fs/ext4/ialloc.c +4 -0
@@ -997,6 +997,8 @@ struct inode *__ext4_new_inode(struct user_namespace *mnt_userns, err =fscrypt_prepare_new_inode (dir, inode, &encrypt);if (err) goto out; +if (encrypt) + i_flags |=EXT4_ENCRYPT_FL ; } err =dquot_initialize (inode);
@@ -1312,6 +1314,8 @@ struct inode *__ext4_new_inode(struct user_namespace *mnt_userns, ei->i_extra_isize = sbi->s_want_extra_isize; ei->i_inline_off =0 ;if (ext4_has_feature_inline_data (sb) && +/* Encrypted inodes cannot have inline data */ + !(ei->i_flags &EXT4_ENCRYPT_FL ) && (!(ei->i_flags &EXT4_DAX_FL ) ||S_ISDIR (mode)))ext4_set_inode_state (inode,EXT4_STATE_MAY_INLINE_DATA ); ret = inode;
fs/ext4/super.c +20 -20
@@ -1487,7 +1487,13 @@ static int ext4_set_context(struct inode *inode, const void *ctx, size_t len,if (inode->i_ino ==EXT4_ROOT_INO )return -EPERM ; -if (WARN_ON_ONCE (IS_DAX (inode) &&i_size_read (inode))) +/* +* For new encrypted inodes, S_DAX is never set in the first place. +* +* For existing inodes, this is called only on empty directories. ext4 +* never sets S_DAX on directories. +*/ +if (WARN_ON_ONCE (IS_DAX (inode)))return -EINVAL ;if (ext4_test_inode_flag (inode,EXT4_INODE_DAX ))
@@ -1506,21 +1512,18 @@ static int ext4_set_context(struct inode *inode, const void *ctx, size_t len,*/ if (handle) { - res =ext4_xattr_set_handle (handle, inode, -EXT4_XATTR_INDEX_ENCRYPTION , -EXT4_XATTR_NAME_ENCRYPTION_CONTEXT , - ctx, len,0 ); -if (!res) { -ext4_set_inode_flag (inode,EXT4_INODE_ENCRYPT ); -ext4_clear_inode_state (inode, -EXT4_STATE_MAY_INLINE_DATA ); -/* -* Update inode->i_flags - S_ENCRYPTED will be enabled, -* S_DAX may be disabled -*/ -ext4_set_inode_flags (inode, false); - } -return res; +/* +* __ext4_new_inode() should have already set the encrypt flag +* on the inode and avoided enabling inline data. +*/ +if (WARN_ON_ONCE (!IS_ENCRYPTED (inode))) +return -EINVAL ; +if (WARN_ON_ONCE (ext4_test_inode_state (inode,EXT4_STATE_MAY_INLINE_DATA ))) +return -EINVAL ; +return ext4_xattr_set_handle (handle, inode, +EXT4_XATTR_INDEX_ENCRYPTION , +EXT4_XATTR_NAME_ENCRYPTION_CONTEXT , + ctx, len,0 ); } res =dquot_initialize (inode);
@@ -1541,10 +1544,7 @@ static int ext4_set_context(struct inode *inode, const void *ctx, size_t len, ctx, len, 0);if (!res) {ext4_set_inode_flag (inode,EXT4_INODE_ENCRYPT ); -/* -* Update inode->i_flags - S_ENCRYPTED will be enabled, -* S_DAX may be disabled -*/ +/* Update inode->i_flags to set S_ENCRYPTED. */ ext4_set_inode_flags (inode, false); res =ext4_mark_inode_dirty (handle, inode);if (res)
fs/fuse/dir.c +4 -5
@@ -1601,10 +1601,8 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,filemap_invalidate_lock (mapping); fault_blocked = true; err =fuse_dax_break_layouts (inode,0 ,-1 ); -if (err) { -filemap_invalidate_unlock (mapping); -return err; - } +if (err) + goto unlock; }if (attr->ia_valid &ATTR_OPEN ) {
@@ -1631,7 +1629,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr, ATTR_TIMES_SET)) { err =write_inode_now (inode, true);if (err) -return err; + goto unlock;fuse_set_nowrite (inode);fuse_release_nowrite (inode);
@@ -1728,6 +1726,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,clear_bit (FUSE_I_SIZE_UNSTABLE , &fi->state); +unlock:if (fault_blocked)filemap_invalidate_unlock (mapping);return err;
fs/fuse/file.c +2 -2
@@ -261,7 +261,7 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir)filemap_invalidate_lock (inode->i_mapping); err =fuse_dax_break_layouts (inode,0 ,-1 );if (err) - goto out_inode_unlock; + goto out_unlock; }if (is_wb_truncate || dax_truncate)
@@ -281,9 +281,9 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir)else if (!(ff->open_flags &FOPEN_KEEP_CACHE ))invalidate_inode_pages2 (inode->i_mapping); } +out_unlock:if (dax_truncate)filemap_invalidate_unlock (inode->i_mapping); -out_inode_unlock:if (is_wb_truncate || dax_truncate)inode_unlock (inode);
fs/jfs/inode.c +1 -1
@@ -386,7 +386,7 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length)ASSERT (length >=0 ); -if (test_cflag (COMMIT_Nolink, ip)) { +if (test_cflag (COMMIT_Nolink, ip) ||isReadOnly (ip)) {xtTruncate (0 , ip, length,COMMIT_WMAP );return ; }
fs/jfs/jfs_extent.c +10 -0
@@ -77,6 +77,11 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)int rc;int xflag; +if (isReadOnly (ip)) { +jfs_error (ip->i_sb,"read-only filesystem\n" ); +return -EIO ; + } +/* This blocks if we are low on resources */ txBeginAnon (ip->i_sb);
@@ -412,6 +417,11 @@ int extRecord(struct inode *ip, xad_t * xp) {int rc; +if (isReadOnly (ip)) { +jfs_error (ip->i_sb,"read-only filesystem\n" ); +return -EIO ; + } +txBeginAnon (ip->i_sb);mutex_lock (&JFS_IP (ip)->commit_mutex);
fs/nilfs2/ioctl.c +118 -143
406 lines not on this page · raw message
include/linux/hid.h +1 -0
@@ -620,6 +620,7 @@ struct hid_device { /* device report descriptor */__s32 battery_max;__s32 battery_report_type;__s32 battery_report_id; +__s32 battery_report_offset;/* bit offset of the capacity field within its report */ enum hid_battery_status battery_status;bool battery_avoid_query;ktime_t battery_ratelimit_time;
include/linux/inetdevice.h +5 -0
@@ -277,6 +277,11 @@ static inline void in_dev_put(struct in_device *idev)#define __in_dev_put (idev) refcount_dec(&(idev)->refcnt)#define in_dev_hold (idev) refcount_inc(&(idev)->refcnt) +static inline bool in_dev_hold_safe (struct in_device *idev) +{ +return refcount_inc_not_zero (&idev->refcnt); +} +#endif /* __KERNEL__ */ static __inline____be32 inet_make_mask (int logmask)
include/linux/nvme.h +2 -2
@@ -1622,8 +1622,8 @@ enum {NVME_SC_HOST_PATH_ERROR =0x370 ,NVME_SC_HOST_ABORTED_CMD =0x371 , -NVME_SC_CRD =0x1800 , - NVME_SC_DNR = 0x4000, +NVME_STATUS_CRD =0x1800 , + NVME_STATUS_DNR = 0x4000, }; struct nvme_completion {
include/linux/sched.h +8 -0
@@ -1398,6 +1398,14 @@ struct task_struct {/* Collect coverage from softirq context: */ unsigned int kcov_softirq; + +/* Temporary storage for preempting remote coverage collection: */ +unsigned int kcov_saved_mode; +unsigned int kcov_saved_size; +void *kcov_saved_area; +struct kcov *kcov_saved_kcov; +int kcov_saved_sequence; +#endif #ifdef CONFIG_MEMCG
include/target/target_core_fabric.h +2 -0
@@ -94,6 +94,8 @@ struct target_core_fabric_ops { struct se_lun *);void (*fabric_pre_unlink)(struct se_portal_group *,struct se_lun *); +void (*fabric_post_unlink)(struct se_portal_group *se_tpg, +struct se_lun *lun);struct se_tpg_np *(*fabric_make_np)(struct se_portal_group *,struct config_group *,const char *);void (*fabric_drop_np)(struct se_tpg_np *);
io_uring/io-wq.c +6 -3
@@ -195,9 +195,12 @@ static void io_worker_cancel_cb(struct io_worker *worker)struct io_wq *wq = wqe->wq;atomic_dec (&acct->nr_running); -raw_spin_lock (&worker->wqe->lock); - acct->nr_workers--; -raw_spin_unlock (&worker->wqe->lock); +/* create_worker_cb() has not reserved a worker slot yet. */ +if (worker->create_work.func != create_worker_cb) { +raw_spin_lock (&worker->wqe->lock); + acct->nr_workers--; +raw_spin_unlock (&worker->wqe->lock); + }io_worker_ref_put (wq);clear_bit_unlock (0 , &worker->create_state);io_worker_release (worker);
kernel/bpf/offload.c +4 -6
@@ -274,9 +274,8 @@ static struct ns_common *bpf_prog_offload_info_fill_ns(void *private_data)if (aux->offload) { args->info->ifindex = aux->offload->netdev->ifindex; - net =dev_net (aux->offload->netdev); -get_net (net); - ns = &net->ns; + net =maybe_get_net (dev_net (aux->offload->netdev)); + ns = net ? &net->ns :NULL ; }else { args->info->ifindex =0 ; ns =NULL ;
@@ -501,9 +500,8 @@ static struct ns_common *bpf_map_offload_info_fill_ns(void *private_data)if (args->offmap->netdev) { args->info->ifindex = args->offmap->netdev->ifindex; - net =dev_net (args->offmap->netdev); -get_net (net); - ns = &net->ns; + net =maybe_get_net (dev_net (args->offmap->netdev)); + ns = net ? &net->ns :NULL ; }else { args->info->ifindex =0 ; ns =NULL ;
kernel/kcov.c +65 -57
257 lines not on this page · raw message
lib/Kconfig.debug +3 -2
@@ -2032,10 +2032,11 @@ config KCOV_INSTRUMENT_ALL config KCOV_IRQ_AREA_SIZE hex "Size of interrupt coverage collection area in words" depends on KCOV + range 0x80 0x1000000 default 0x40000 help - KCOV uses preallocated per-cpu areas to collect coverage from - soft interrupts. This specifies the size of those areas in the + KCOV uses preallocated areas to collect coverage from soft + interrupts. This specifies the size of those areas in the number of unsigned long words. menuconfig RUNTIME_TESTING_MENU
mm/swapfile.c +7 -0
@@ -3209,6 +3209,13 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) error = -EBUSY ; goto bad_swap_unlock_inode; } +if (IS_ENCRYPTED (inode)) { +pr_warn_once ( +"Filesystem-level encrypted swapfile '%s' is unsupported. Create a loop device over it, or use dm-crypt\n" , + name->name); + error = -EINVAL ; + goto bad_swap_unlock_inode; + }/* * Read the swap header.
net/bridge/br_multicast.c +2 -2
@@ -4113,8 +4113,8 @@ void br_multicast_toggle_one_vlan(struct net_bridge_vlan *vlan, bool on)if (br_vlan_is_master (vlan)) { br = vlan->br; -if (!br_vlan_is_brentry (vlan) || - (on && +if (on && + (!br_vlan_is_brentry (vlan) ||br_multicast_ctx_vlan_global_disabled (&vlan->br_mcast_ctx)))return ;
net/can/j1939/j1939-priv.h +1 -0
@@ -212,6 +212,7 @@ void j1939_priv_get(struct j1939_priv *priv);/* notify/alert all j1939 sockets bound to ifindex */ void j1939_sk_netdev_event_netdown (struct j1939_priv *priv); +void j1939_sk_netdev_event_unregister (struct j1939_priv *priv);int j1939_cancel_active_session (struct j1939_priv *priv,struct sock *sk);void j1939_tp_init (struct j1939_priv *priv);
net/can/j1939/main.c +5 -0
@@ -373,6 +373,11 @@ static int j1939_netdev_notify(struct notifier_block *nb,j1939_sk_netdev_event_netdown (priv);j1939_ecu_unmap_all (priv);break ; +case NETDEV_UNREGISTER : +j1939_cancel_active_session (priv,NULL ); +j1939_sk_netdev_event_netdown (priv); +j1939_sk_netdev_event_unregister (priv); +break ; }j1939_priv_put (priv);
net/can/j1939/socket.c +55 -0
38 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.