Linux 5.10.63
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.10.63 kernel.
All users of the 5.10 kernel series must upgrade.
The updated 5.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.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
------------
Makefile | 2 - arch/arm/mach-omap1/board-ams-delta.c | 14 -------- arch/x86/events/amd/ibs.c | 8 ++++ arch/x86/events/amd/power.c | 1 arch/x86/events/intel/pt.c | 2 - arch/xtensa/Kconfig | 2 - drivers/block/Kconfig | 4 +- drivers/block/cryptoloop.c | 2 + drivers/gpu/ipu-v3/ipu-cpmem.c | 30 +++++++++--------- drivers/media/usb/stkwebcam/stk-webcam.c | 6 ++- drivers/net/ethernet/cadence/macb_ptp.c | 11 ++++++ drivers/net/ethernet/qlogic/qed/qed_main.c | 7 +++- drivers/net/ethernet/qlogic/qede/qede_main.c | 2 - drivers/reset/reset-zynqmp.c | 3 + drivers/tty/serial/8250/8250_omap.c | 1 fs/9p/vfs_inode.c | 4 +- fs/9p/vfs_inode_dotl.c | 4 +- fs/ceph/mdsmap.c | 8 +++- fs/cifs/inode.c | 5 +-- fs/crypto/hooks.c | 44 +++++++++++++++++++++++++++ fs/exec.c | 4 -- fs/ext4/inline.c | 6 +++ fs/ext4/symlink.c | 11 ++++++ fs/f2fs/namei.c | 11 ++++++ fs/fuse/dir.c | 6 +-- fs/fuse/fuse_i.h | 7 ++++ fs/fuse/inode.c | 4 +- fs/fuse/readdir.c | 7 +++- fs/nfs/inode.c | 6 +-- fs/nfsd/nfsproc.c | 2 - fs/overlayfs/namei.c | 4 +- fs/ubifs/file.c | 12 ++++++- include/linux/cred.h | 2 - include/linux/fs.h | 5 +++ include/linux/fscrypt.h | 7 ++++ include/linux/spi/spi.h | 4 +- include/linux/user_namespace.h | 4 -- kernel/cred.c | 41 ------------------------- kernel/fork.c | 6 --- kernel/static_call.c | 4 +- kernel/sys.c | 12 ------- kernel/ucount.c | 40 +----------------------- kernel/user_namespace.c | 3 - sound/core/pcm_lib.c | 2 - sound/pci/hda/patch_realtek.c | 11 ++++++ 45 files changed, 201 insertions(+), 180 deletions(-)
Al Viro (1):
new helper: inode_wrong_type()
Amir Goldstein (1):
fuse: fix illegal access to inode with reused nodeid
Andy Shevchenko (1):
spi: Switch to signed types for *_native_cs SPI controller fields
Christoph Hellwig (1):
cryptoloop: add a deprecation warning
Eric Biggers (4):
fscrypt: add fscrypt_symlink_getattr() for computing st_size
ext4: report correct st_size for encrypted symlinks
f2fs: report correct st_size for encrypted symlinks
ubifs: report correct st_size for encrypted symlinks
Greg Kroah-Hartman (4):
Revert "ucounts: Increase ucounts reference counter before the security hook" Revert "cred: add missing return error code when set_cred_ucounts() failed" Revert "Add a reference to ucounts for each cred"
Linux 5.10.63
Harini Katakam (1):
net: macb: Add a NULL check on desc_ptp
Johnathon Clark (1):
ALSA: hda/realtek: Quirk for HP Spectre x360 14 amp setup
Kim Phillips (2):
perf/x86/amd/ibs: Work around erratum #1197
perf/x86/amd/power: Assign pmu.module
Krzysztof Hałasa (1):
gpu: ipu-v3: Fix i.MX IPU-v3 offset calculations for (semi)planar U/V formats
Maciej Falkowski (1):
ARM: OMAP1: ams-delta: remove unused function ams_delta_camera_power
Matthieu Baerts (1):
static_call: Fix unused variable warn w/o MODULE
Pavel Skripkin (1):
media: stkwebcam: fix memory leak in stk_camera_probe
Randy Dunlap (1):
xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG
Sai Krishna Potthuri (1):
reset: reset-zynqmp: Fixed the argument data type
Shai Malin (2):
qed: Fix the VF msix vectors flow
qede: Fix memset corruption
Takashi Iwai (1):
ALSA: hda/realtek: Workaround for conflicting SSID on ASUS ROG Strix G17
Theodore Ts'o (1):
ext4: fix race writing to an inline_data file while its xattrs are changing
Tuo Li (1):
ceph: fix possible null-pointer dereference in ceph_mdsmap_decode()
Vignesh Raghavendra (1):
serial: 8250: 8250_omap: Fix possible array out of bounds access
Xiaoyao Li (1):
perf/x86/intel/pt: Fix mask of num_address_ranges
Zubin Mithra (1):
ALSA: pcm: fix divide error in snd_pcm_lib_ioctl
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 10 -SUBLEVEL = 62 +SUBLEVEL = 63 EXTRAVERSION = NAME = Dare mighty things
arch/arm/mach-omap1/board-ams-delta.c +0 -14
@@ -458,20 +458,6 @@ static struct gpiod_lookup_table leds_gpio_table = {#ifdef CONFIG_LEDS_TRIGGERS DEFINE_LED_TRIGGER (ams_delta_camera_led_trigger); - -static int ams_delta_camera_power (struct device *dev,int power) -{ -/* -* turn on camera LED -*/ -if (power) -led_trigger_event (ams_delta_camera_led_trigger,LED_FULL ); -else -led_trigger_event (ams_delta_camera_led_trigger,LED_OFF ); -return 0 ; -} -#else -#define ams_delta_camera_power NULL#endif static struct platform_device ams_delta_audio_device = {
arch/x86/events/amd/ibs.c +8 -0
@@ -90,6 +90,7 @@ struct perf_ibs {unsigned long offset_mask[1 ];int offset_max; unsigned int fetch_count_reset_broken : 1; + unsigned int fetch_ignore_if_zero_rip : 1;struct cpu_perf_ibs __percpu *pcpu;struct attribute **format_attrs;
@@ -672,6 +673,10 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)if (check_rip && (ibs_data.regs[2 ] &IBS_RIP_INVALID )) { regs.flags &= ~PERF_EFLAGS_EXACT ; }else { +/* Workaround for erratum #1197 */ +if (perf_ibs->fetch_ignore_if_zero_rip && !(ibs_data.regs[1 ])) + goto out; +set_linear_ip (®s, ibs_data.regs[1 ]); regs.flags |=PERF_EFLAGS_EXACT ; }
@@ -769,6 +774,9 @@ static __init void perf_event_ibs_init(void)if (boot_cpu_data.x86 >=0x16 && boot_cpu_data.x86 <=0x18 ) perf_ibs_fetch.fetch_count_reset_broken =1 ; +if (boot_cpu_data.x86 ==0x19 && boot_cpu_data.x86_model <0x10 ) + perf_ibs_fetch.fetch_ignore_if_zero_rip =1 ; +perf_ibs_pmu_init (&perf_ibs_fetch,"ibs_fetch" );if (ibs_caps &IBS_CAPS_OPCNT ) {
arch/x86/events/amd/power.c +1 -0
@@ -213,6 +213,7 @@ static struct pmu pmu_class = { .stop = pmu_event_stop, .read = pmu_event_read, .capabilities = PERF_PMU_CAP_NO_EXCLUDE, + .module = THIS_MODULE, };static int power_cpu_exit (unsigned int cpu)
arch/x86/events/intel/pt.c +1 -1
@@ -62,7 +62,7 @@ static struct pt_cap_desc {PT_CAP (single_range_output,0 ,CPUID_ECX ,BIT (2 )),PT_CAP (output_subsys,0 ,CPUID_ECX ,BIT (3 )),PT_CAP (payloads_lip,0 ,CPUID_ECX ,BIT (31 )), -PT_CAP (num_address_ranges,1 ,CPUID_EAX ,0x3 ), +PT_CAP (num_address_ranges,1 ,CPUID_EAX ,0x7 ),PT_CAP (mtc_periods,1 ,CPUID_EAX ,0xffff0000 ),PT_CAP (cycle_thresholds,1 ,CPUID_EBX ,0xffff ), PT_CAP(psb_periods, 1, CPUID_EBX, 0xffff0000),
arch/xtensa/Kconfig +1 -1
@@ -30,7 +30,7 @@ config XTENSA select HAVE_DMA_CONTIGUOUS select HAVE_EXIT_THREAD select HAVE_FUNCTION_TRACER - select HAVE_FUTEX_CMPXCHG if !MMU + select HAVE_FUTEX_CMPXCHG if !MMU && FUTEX select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_IRQ_TIME_ACCOUNTING select HAVE_OPROFILE
drivers/block/Kconfig +2 -2
@@ -230,7 +230,7 @@ config BLK_DEV_LOOP_MIN_COUNT dynamically allocated with the /dev/loop-control interface. config BLK_DEV_CRYPTOLOOP - tristate "Cryptoloop Support" + tristate "Cryptoloop Support (DEPRECATED)" select CRYPTO select CRYPTO_CBC depends on BLK_DEV_LOOP
@@ -242,7 +242,7 @@ config BLK_DEV_CRYPTOLOOP WARNING: This device is not safe for journaled file systems like ext3 or Reiserfs. Please use the Device Mapper crypto module instead, which can be configured to be on-disk compatible with the - cryptoloop device. + cryptoloop device. cryptoloop support will be removed in Linux 5.16. source "drivers/block/drbd/Kconfig"
drivers/block/cryptoloop.c +2 -0
@@ -189,6 +189,8 @@ init_cryptoloop(void)if (rc)printk (KERN_ERR "cryptoloop: loop_register_transfer failed\n" ); +else +pr_warn ("the cryptoloop driver has been deprecated and will be removed in in Linux 5.16\n" );return rc; }
drivers/gpu/ipu-v3/ipu-cpmem.c +15 -15
@@ -585,21 +585,21 @@ static const struct ipu_rgb def_bgra_16 = { .bits_per_pixel = 16, }; -#define Y_OFFSET (pix, x, y) ((x) + pix->width * (y)) -#define U_OFFSET (pix, x, y) ((pix->width * pix->height) + \ - (pix->width * ((y) / 2) / 2) + (x) / 2) -#define V_OFFSET (pix, x, y) ((pix->width * pix->height) + \ - (pix->width * pix->height / 4) + \ - (pix->width * ((y) / 2) / 2) + (x) / 2) -#define U2_OFFSET (pix, x, y) ((pix->width * pix->height) + \ - (pix->width * (y) / 2) + (x) / 2) -#define V2_OFFSET (pix, x, y) ((pix->width * pix->height) + \ - (pix->width * pix->height / 2) + \ - (pix->width * (y) / 2) + (x) / 2) -#define UV_OFFSET (pix, x, y) ((pix->width * pix->height) + \ - (pix->width * ((y) / 2)) + (x)) -#define UV2_OFFSET (pix, x, y) ((pix->width * pix->height) + \ - (pix->width * y) + (x)) +#define Y_OFFSET (pix, x, y) ((x) + pix->bytesperline * (y)) +#define U_OFFSET (pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * ((y) / 2) / 2) + (x) / 2) +#define V_OFFSET (pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * pix->height / 4) + \ + (pix->bytesperline * ((y) / 2) / 2) + (x) / 2) +#define U2_OFFSET (pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * (y) / 2) + (x) / 2) +#define V2_OFFSET (pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * pix->height / 2) + \ + (pix->bytesperline * (y) / 2) + (x) / 2) +#define UV_OFFSET (pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * ((y) / 2)) + (x)) +#define UV2_OFFSET (pix, x, y) ((pix->bytesperline * pix->height) + \ + (pix->bytesperline * y) + (x))#define NUM_ALPHA_CHANNELS 7
drivers/media/usb/stkwebcam/stk-webcam.c +4 -2
@@ -1346,7 +1346,7 @@ static int stk_camera_probe(struct usb_interface *interface,if (!dev->isoc_ep) {pr_err ("Could not find isoc-in endpoint\n" ); err = -ENODEV ; - goto error; + goto error_put; } dev->vsettings.palette =V4L2_PIX_FMT_RGB565 ; dev->vsettings.mode =MODE_VGA ;
@@ -1359,10 +1359,12 @@ static int stk_camera_probe(struct usb_interface *interface, err =stk_register_video_device (dev);if (err) - goto error; + goto error_put;return 0 ; +error_put: +usb_put_intf (interface); error:v4l2_ctrl_handler_free (hdl);v4l2_device_unregister (&dev->v4l2_dev);
drivers/net/ethernet/cadence/macb_ptp.c +10 -1
@@ -275,6 +275,12 @@ void gem_ptp_rxstamp(struct macb *bp, struct sk_buff *skb,if (GEM_BFEXT (DMA_RXVALID , desc->addr)) { desc_ptp =macb_ptp_desc (bp, desc); +/* Unlikely but check */ +if (!desc_ptp) { +dev_warn_ratelimited (&bp->pdev->dev, +"Timestamp not supported in BD\n" ); +return ; + }gem_hw_timestamp (bp, desc_ptp->ts_1, desc_ptp->ts_2, &ts);memset (shhwtstamps,0 ,sizeof (struct skb_shared_hwtstamps )); shhwtstamps->hwtstamp =ktime_set (ts.tv_sec, ts.tv_nsec);
@@ -307,8 +313,11 @@ int gem_ptp_txstamp(struct macb_queue *queue, struct sk_buff *skb,if (CIRC_SPACE (head, tail,PTP_TS_BUFFER_SIZE ) ==0 )return -ENOMEM ; -skb_shinfo (skb)->tx_flags |=SKBTX_IN_PROGRESS ; desc_ptp =macb_ptp_desc (queue->bp, desc); +/* Unlikely but check */ +if (!desc_ptp) +return -EINVAL ; +skb_shinfo (skb)->tx_flags |=SKBTX_IN_PROGRESS ; tx_timestamp = &queue->tx_timestamps[head]; tx_timestamp->skb = skb;/* ensure ts_1/ts_2 is loaded after ctrl (TX_USED check) */
drivers/net/ethernet/qlogic/qed/qed_main.c +6 -1
@@ -616,7 +616,12 @@ static int qed_enable_msix(struct qed_dev *cdev, rc = cnt; } -if (rc >0 ) { +/* For VFs, we should return with an error in case we didn't get the +* exact number of msix vectors as we requested. +* Not doing that will lead to a crash when starting queues for +* this VF. +*/ +if ((IS_PF (cdev) && rc >0 ) || (IS_VF (cdev) && rc == cnt)) {/* MSI-x configuration was achieved */ int_params->out.int_mode =QED_INT_MODE_MSIX ; int_params->out.num_vectors = rc;
drivers/net/ethernet/qlogic/qede/qede_main.c +1 -1
@@ -1869,6 +1869,7 @@ static void qede_sync_free_irqs(struct qede_dev *edev) } edev->int_info.used_cnt =0 ; + edev->int_info.msix_cnt =0 ; }static int qede_req_msix_irqs (struct qede_dev *edev)
@@ -2409,7 +2410,6 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode, goto out; err4:qede_sync_free_irqs (edev); -memset (&edev->int_info.msix_cnt,0 ,sizeof (struct qed_int_info )); err3:qede_napi_disable_remove (edev); err2:
drivers/reset/reset-zynqmp.c +2 -1
@@ -53,7 +53,8 @@ static int zynqmp_reset_status(struct reset_controller_dev *rcdev, unsigned long id) {struct zynqmp_reset_data *priv =to_zynqmp_reset_data (rcdev); -int val, err; +int err; +u32 val; err =zynqmp_pm_reset_get_status (priv->data->reset_id + id, &val);if (err)
drivers/tty/serial/8250/8250_omap.c +1 -0
@@ -1211,6 +1211,7 @@ static int omap8250_no_handle_irq(struct uart_port *port)static const struct soc_device_attribute k3_soc_devices[] = { { .family ="AM65X" , }, { .family ="J721E" , .revision ="SR1.0" }, + {/* sentinel */ } };static struct omap8250_dma_params am654_dma = {
fs/9p/vfs_inode.c +2 -2
@@ -398,7 +398,7 @@ static int v9fs_test_inode(struct inode *inode, void *data) umode =p9mode2unixmode (v9ses, st, &rdev);/* don't match inode of different type */ -if ((inode->i_mode &S_IFMT ) != (umode &S_IFMT )) +if (inode_wrong_type (inode, umode))return 0 ;/* compare qid details */
@@ -1360,7 +1360,7 @@ int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode)* Don't update inode if the file type is different */ umode =p9mode2unixmode (v9ses, st, &rdev); -if ((inode->i_mode &S_IFMT ) != (umode &S_IFMT )) +if (inode_wrong_type (inode, umode)) goto out;/*
fs/9p/vfs_inode_dotl.c +2 -2
@@ -59,7 +59,7 @@ static int v9fs_test_inode_dotl(struct inode *inode, void *data)struct p9_stat_dotl *st = (struct p9_stat_dotl *)data;/* don't match inode of different type */ -if ((inode->i_mode &S_IFMT ) != (st->st_mode &S_IFMT )) +if (inode_wrong_type (inode, st->st_mode))return 0 ;if (inode->i_generation != st->st_gen)
@@ -933,7 +933,7 @@ int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode)/* * Don't update inode if the file type is different */ -if ((inode->i_mode &S_IFMT ) != (st->st_mode &S_IFMT )) +if (inode_wrong_type (inode, st->st_mode)) goto out;/*
fs/ceph/mdsmap.c +5 -3
@@ -393,9 +393,11 @@ void ceph_mdsmap_destroy(struct ceph_mdsmap *m) {int i; -for (i =0 ; i < m->possible_max_rank; i++) -kfree (m->m_info[i].export_targets); -kfree (m->m_info); +if (m->m_info) { +for (i =0 ; i < m->possible_max_rank; i++) +kfree (m->m_info[i].export_targets); +kfree (m->m_info); + }kfree (m->m_data_pg_pools);kfree (m); }
fs/cifs/inode.c +2 -3
@@ -425,8 +425,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, }/* if filetype is different, return error */ -if (unlikely (((*pinode)->i_mode &S_IFMT ) != - (fattr.cf_mode &S_IFMT ))) { +if (unlikely (inode_wrong_type (*pinode, fattr.cf_mode))) {CIFS_I (*pinode)->time =0 ;/* force reval */ rc = -ESTALE ; goto cgiiu_exit;
@@ -1243,7 +1242,7 @@ cifs_find_inode(struct inode *inode, void *opaque)return 0 ;/* don't match inode of different type */ -if ((inode->i_mode &S_IFMT ) != (fattr->cf_mode &S_IFMT )) +if (inode_wrong_type (inode, fattr->cf_mode))return 0 ;/* if it's not a directory or has no dentries, then flag it */
fs/crypto/hooks.c +44 -0
47 lines not on this page · raw message
fs/exec.c +0 -4
@@ -1347,10 +1347,6 @@ int begin_new_exec(struct linux_binprm * bprm)WRITE_ONCE (me->self_exec_id, me->self_exec_id +1 );flush_signal_handlers (me,0 ); - retval =set_cred_ucounts (bprm->cred); -if (retval <0 ) - goto out_unlock; -/* * install the new credentials for this executable */
fs/ext4/inline.c +6 -0
@@ -750,6 +750,12 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,ext4_write_lock_xattr (inode, &no_expand);BUG_ON (!ext4_has_inline_data (inode)); +/* +* ei->i_inline_off may have changed since ext4_write_begin() +* called ext4_try_to_write_inline_data() +*/ + (void )ext4_find_inline_data_nolock (inode); + kaddr =kmap_atomic (page);ext4_write_inline_data (inode, &iloc, kaddr, pos, len);kunmap_atomic (kaddr);
fs/ext4/symlink.c +10 -1
@@ -52,10 +52,19 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry,return paddr; } +static int ext4_encrypted_symlink_getattr (const struct path *path, +struct kstat *stat,u32 request_mask, +unsigned int query_flags) +{ +ext4_getattr (path, stat, request_mask, query_flags); + +return fscrypt_symlink_getattr (path, stat); +} +const struct inode_operations ext4_encrypted_symlink_inode_operations = { .get_link = ext4_encrypted_get_link, .setattr = ext4_setattr, - .getattr = ext4_getattr, + .getattr = ext4_encrypted_symlink_getattr, .listxattr = ext4_listxattr, };
fs/f2fs/namei.c +10 -1
@@ -1307,9 +1307,18 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,return target; } +static int f2fs_encrypted_symlink_getattr (const struct path *path, +struct kstat *stat,u32 request_mask, +unsigned int query_flags) +{ +f2fs_getattr (path, stat, request_mask, query_flags); + +return fscrypt_symlink_getattr (path, stat); +} +const struct inode_operations f2fs_encrypted_symlink_inode_operations = { .get_link = f2fs_encrypted_get_link, - .getattr = f2fs_getattr, + .getattr = f2fs_encrypted_symlink_getattr, .setattr = f2fs_setattr, .listxattr = f2fs_listxattr, };
fs/fuse/dir.c +3 -3
@@ -252,7 +252,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)if (ret == -ENOMEM ) goto out;if (ret ||fuse_invalid_attr (&outarg.attr) || - (outarg.attr.mode ^ inode->i_mode) &S_IFMT ) +fuse_stale_inode (inode, outarg.generation, &outarg.attr)) goto invalid;forget_all_cached_acls (inode);
@@ -1062,7 +1062,7 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat, err =fuse_simple_request (fm, &args);if (!err) {if (fuse_invalid_attr (&outarg.attr) || - (inode->i_mode ^ outarg.attr.mode) &S_IFMT ) { +inode_wrong_type (inode, outarg.attr.mode)) {fuse_make_bad (inode); err = -EIO ; }else {
@@ -1699,7 +1699,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr, }if (fuse_invalid_attr (&outarg.attr) || - (inode->i_mode ^ outarg.attr.mode) &S_IFMT ) { +inode_wrong_type (inode, outarg.attr.mode)) {fuse_make_bad (inode); err = -EIO ; goto error;
fs/fuse/fuse_i.h +7 -0
@@ -860,6 +860,13 @@ static inline u64 fuse_get_attr_version(struct fuse_conn *fc)return atomic64_read (&fc->attr_version); } +static inline bool fuse_stale_inode (const struct inode *inode,int generation, +struct fuse_attr *attr) +{ +return inode->i_generation != generation || +inode_wrong_type (inode, attr->mode); +} +static inline void fuse_make_bad (struct inode *inode) {remove_inode_hash (inode);
fs/fuse/inode.c +2 -2
@@ -340,8 +340,8 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, inode->i_generation = generation;fuse_init_inode (inode, attr);unlock_new_inode (inode); - }else if ((inode->i_mode ^ attr->mode) &S_IFMT ) { -/* Inode has changed type, any I/O on the old should fail */ + }else if (fuse_stale_inode (inode, generation, attr)) { +/* nodeid was reused, any I/O on the old inode should fail */ fuse_make_bad (inode);iput (inode); goto retry;
fs/fuse/readdir.c +5 -2
@@ -200,9 +200,12 @@ static int fuse_direntplus_link(struct file *file,if (!d_in_lookup (dentry)) {struct fuse_inode *fi; inode =d_inode (dentry); +if (inode &&get_node_id (inode) != o->nodeid) + inode =NULL ;if (!inode || -get_node_id (inode) != o->nodeid || - ((o->attr.mode ^ inode->i_mode) &S_IFMT )) { +fuse_stale_inode (inode, o->generation, &o->attr)) { +if (inode) +fuse_make_bad (inode);d_invalidate (dentry);dput (dentry); goto retry;
fs/nfs/inode.c +3 -3
@@ -322,7 +322,7 @@ nfs_find_actor(struct inode *inode, void *opaque)if (NFS_FILEID (inode) != fattr->fileid)return 0 ; -if ((S_IFMT & inode->i_mode) != (S_IFMT & fattr->mode)) +if (inode_wrong_type (inode, fattr->mode))return 0 ;if (nfs_compare_fh (NFS_FH (inode), fh))return 0 ;
@@ -1446,7 +1446,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fatreturn 0 ;return -ESTALE ; } -if ((fattr->valid &NFS_ATTR_FATTR_TYPE ) && (inode->i_mode &S_IFMT ) != (fattr->mode &S_IFMT )) +if ((fattr->valid &NFS_ATTR_FATTR_TYPE ) &&inode_wrong_type (inode, fattr->mode))return -ESTALE ;
@@ -1861,7 +1861,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)/* * Make sure the inode's type hasn't changed. */ -if ((fattr->valid &NFS_ATTR_FATTR_TYPE ) && (inode->i_mode &S_IFMT ) != (fattr->mode &S_IFMT )) { +if ((fattr->valid &NFS_ATTR_FATTR_TYPE ) &&inode_wrong_type (inode, fattr->mode)) {/* * Big trouble! The inode has become a different object. */
fs/nfsd/nfsproc.c +1 -1
@@ -376,7 +376,7 @@ nfsd_proc_create(struct svc_rqst *rqstp)/* Make sure the type and device matches */ resp->status = nfserr_exist; -if (inode && type != (inode->i_mode &S_IFMT )) +if (inode &&inode_wrong_type (inode, type)) goto out_unlock; }
fs/overlayfs/namei.c +2 -2
@@ -366,7 +366,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected,return PTR_ERR (origin);if (upperdentry && !ovl_is_whiteout (upperdentry) && - ((d_inode (origin)->i_mode ^d_inode (upperdentry)->i_mode) &S_IFMT )) +inode_wrong_type (d_inode (upperdentry),d_inode (origin)->i_mode)) goto invalid;if (!*stackp)
@@ -724,7 +724,7 @@ struct dentry *ovl_lookup_index(struct ovl_fs *ofs, struct dentry *upper, index =ERR_PTR (-ESTALE ); goto out; }else if (ovl_dentry_weird (index) ||ovl_is_whiteout (index) || - ((inode->i_mode ^d_inode (origin)->i_mode) &S_IFMT )) { +inode_wrong_type (inode,d_inode (origin)->i_mode)) {/* * Index should always be of the same file type as origin * except for the case of a whiteout index. A whiteout
fs/ubifs/file.c +11 -1
@@ -1629,6 +1629,16 @@ static const char *ubifs_get_link(struct dentry *dentry,return fscrypt_get_symlink (inode, ui->data, ui->data_len, done); } +static int ubifs_symlink_getattr (const struct path *path,struct kstat *stat, +u32 request_mask,unsigned int query_flags) +{ +ubifs_getattr (path, stat, request_mask, query_flags); + +if (IS_ENCRYPTED (d_inode (path->dentry))) +return fscrypt_symlink_getattr (path, stat); +return 0 ; +} +const struct address_space_operations ubifs_file_address_operations = { .readpage = ubifs_readpage, .writepage = ubifs_writepage,
@@ -1654,7 +1664,7 @@ const struct inode_operations ubifs_file_inode_operations = {const struct inode_operations ubifs_symlink_inode_operations = { .get_link = ubifs_get_link, .setattr = ubifs_setattr, - .getattr = ubifs_getattr, + .getattr = ubifs_symlink_getattr, #ifdef CONFIG_UBIFS_FS_XATTR .listxattr = ubifs_listxattr, #endif
include/linux/cred.h +0 -2
@@ -144,7 +144,6 @@ struct cred {#endif struct user_struct *user;/* real user ID subscription */ struct user_namespace *user_ns;/* user_ns the caps and keyrings are relative to. */ -struct ucounts *ucounts;struct group_info *group_info;/* supplementary groups for euid/fsgid */ /* RCU deletion */ union {
@@ -171,7 +170,6 @@ extern int set_security_override_from_ctx(struct cred *, const char *);extern int set_create_files_as (struct cred *,struct inode *);extern int cred_fscmp (const struct cred *,const struct cred *);extern void __init cred_init (void ); -extern int set_cred_ucounts (struct cred *);/* * check for validity of credentials
include/linux/fs.h +5 -0
@@ -2768,6 +2768,11 @@ static inline bool execute_ok(struct inode *inode)return (inode->i_mode &S_IXUGO ) ||S_ISDIR (inode->i_mode); } +static inline bool inode_wrong_type (const struct inode *inode,umode_t mode) +{ +return (inode->i_mode ^ mode) &S_IFMT ; +} +static inline void file_start_write (struct file *file) {if (!S_ISREG (file_inode (file)->i_mode))
include/linux/fscrypt.h +7 -0
@@ -252,6 +252,7 @@ int __fscrypt_encrypt_symlink(struct inode *inode, const char *target,const char *fscrypt_get_symlink (struct inode *inode,const void *caddr,unsigned int max_size,struct delayed_call *done); +int fscrypt_symlink_getattr (const struct path *path,struct kstat *stat);static inline void fscrypt_set_ops (struct super_block *sb,const struct fscrypt_operations *s_cop) {
@@ -575,6 +576,12 @@ static inline const char *fscrypt_get_symlink(struct inode *inode,return ERR_PTR (-EOPNOTSUPP ); } +static inline int fscrypt_symlink_getattr (const struct path *path, +struct kstat *stat) +{ +return -EOPNOTSUPP ; +} +static inline void fscrypt_set_ops (struct super_block *sb,const struct fscrypt_operations *s_cop) {
include/linux/spi/spi.h +2 -2
@@ -646,8 +646,8 @@ struct spi_controller {int *cs_gpios;struct gpio_desc **cs_gpiods;bool use_gpio_descriptors; -u8 unused_native_cs; -u8 max_native_cs; +s8 unused_native_cs; +s8 max_native_cs;/* statistics */ struct spi_statistics statistics;
include/linux/user_namespace.h +0 -4
@@ -101,15 +101,11 @@ struct ucounts { };extern struct user_namespace init_user_ns; -extern struct ucounts init_ucounts;bool setup_userns_sysctls (struct user_namespace *ns);void retire_userns_sysctls (struct user_namespace *ns);struct ucounts *inc_ucount (struct user_namespace *ns,kuid_t uid,enum ucount_type type);void dec_ucount (struct ucounts *ucounts,enum ucount_type type); -struct ucounts *alloc_ucounts (struct user_namespace *ns,kuid_t uid); -struct ucounts *get_ucounts (struct ucounts *ucounts); -void put_ucounts (struct ucounts *ucounts);#ifdef CONFIG_USER_NS
kernel/cred.c +0 -41
85 lines not on this page · raw message
kernel/fork.c +0 -6
@@ -2960,12 +2960,6 @@ int ksys_unshare(unsigned long unshare_flags)if (err) goto bad_unshare_cleanup_cred; -if (new_cred) { - err =set_cred_ucounts (new_cred); -if (err) - goto bad_unshare_cleanup_cred; - } -if (new_fs || new_fd || do_sysvsem || new_cred || new_nsproxy) {if (do_sysvsem) {/*
kernel/static_call.c +2 -2
@@ -165,13 +165,13 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) stop = __stop_static_call_sites; -#ifdef CONFIG_MODULES if (mod) { +#ifdef CONFIG_MODULES stop = mod->static_call_sites + mod->num_static_call_sites; init = mod->state ==MODULE_STATE_COMING ; - }#endif + }for (site = site_mod->sites; site < stop &&static_call_key (site) == key; site++) {
kernel/sys.c +0 -12
@@ -552,10 +552,6 @@ long __sys_setreuid(uid_t ruid, uid_t euid)if (retval <0 ) goto error; - retval =set_cred_ucounts (new); -if (retval <0 ) - goto error; -return commit_creds (new); error:
@@ -614,10 +610,6 @@ long __sys_setuid(uid_t uid)if (retval <0 ) goto error; - retval =set_cred_ucounts (new); -if (retval <0 ) - goto error; -return commit_creds (new); error:
@@ -693,10 +685,6 @@ long __sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)if (retval <0 ) goto error; - retval =set_cred_ucounts (new); -if (retval <0 ) - goto error; -return commit_creds (new); error:
kernel/ucount.c +3 -37
@@ -8,12 +8,6 @@#include <linux/kmemleak.h> #include <linux/user_namespace.h> -struct ucounts init_ucounts = { - .ns = &init_user_ns, - .uid =GLOBAL_ROOT_UID , - .count =1 , -}; -#define UCOUNTS_HASHTABLE_BITS 10static struct hlist_head ucounts_hashtable[(1 <<UCOUNTS_HASHTABLE_BITS )];static DEFINE_SPINLOCK (ucounts_lock);
@@ -131,15 +125,7 @@ static struct ucounts *find_ucounts(struct user_namespace *ns, kuid_t uid, strucreturn NULL ; } -static void hlist_add_ucounts (struct ucounts *ucounts) -{ -struct hlist_head *hashent =ucounts_hashentry (ucounts->ns, ucounts->uid); -spin_lock_irq (&ucounts_lock); -hlist_add_head (&ucounts->node, hashent); -spin_unlock_irq (&ucounts_lock); -} - -struct ucounts *alloc_ucounts (struct user_namespace *ns,kuid_t uid) +static struct ucounts *get_ucounts (struct user_namespace *ns,kuid_t uid) {struct hlist_head *hashent =ucounts_hashentry (ns, uid);struct ucounts *ucounts, *new;
@@ -174,26 +160,7 @@ struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid)return ucounts; } -struct ucounts *get_ucounts (struct ucounts *ucounts) -{ -unsigned long flags; - -if (!ucounts) -return NULL ; - -spin_lock_irqsave (&ucounts_lock, flags); -if (ucounts->count ==INT_MAX ) { -WARN_ONCE (1 ,"ucounts: counter has reached its maximum value" ); - ucounts =NULL ; - }else { - ucounts->count +=1 ; - } -spin_unlock_irqrestore (&ucounts_lock, flags); - -return ucounts; -} - -void put_ucounts (struct ucounts *ucounts) +static void put_ucounts (struct ucounts *ucounts) {unsigned long flags;
@@ -227,7 +194,7 @@ struct ucounts *inc_ucount(struct user_namespace *ns, kuid_t uid, {struct ucounts *ucounts, *iter, *bad;struct user_namespace *tns; - ucounts =alloc_ucounts (ns, uid); + ucounts =get_ucounts (ns, uid);for (iter = ucounts; iter; iter = tns->ucounts) {int max; tns = iter->ns;
@@ -270,7 +237,6 @@ static __init int user_namespace_sysctl_init(void)BUG_ON (!user_header);BUG_ON (!setup_userns_sysctls (&init_user_ns));#endif -hlist_add_ucounts (&init_ucounts);return 0 ; }subsys_initcall (user_namespace_sysctl_init);
kernel/user_namespace.c +0 -3
@@ -1340,9 +1340,6 @@ static int userns_install(struct nsset *nsset, struct ns_common *ns)put_user_ns (cred->user_ns);set_cred_user_ns (cred,get_user_ns (user_ns)); -if (set_cred_ucounts (cred) <0 ) -return -EINVAL ; -return 0 ; }
sound/core/pcm_lib.c +1 -1
@@ -1746,7 +1746,7 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream, channels =params_channels (params); frame_size =snd_pcm_format_size (format, channels);if (frame_size >0 ) - params->fifo_size /= (unsigned )frame_size; + params->fifo_size /= frame_size; }return 0 ; }
sound/pci/hda/patch_realtek.c +11 -0
@@ -8364,6 +8364,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x87f2 ,"HP ProBook 640 G8 Notebook PC" ,ALC236_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x87f4 ,"HP" ,ALC287_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x87f5 ,"HP" ,ALC287_FIXUP_HP_GPIO_LED ), +SND_PCI_QUIRK (0x103c ,0x87f6 ,"HP Spectre x360 14" ,ALC245_FIXUP_HP_X360_AMP ),SND_PCI_QUIRK (0x103c ,0x87f7 ,"HP Spectre x360 14" ,ALC245_FIXUP_HP_X360_AMP ),SND_PCI_QUIRK (0x103c ,0x8805 ,"HP ProBook 650 G8 Notebook PC" ,ALC236_FIXUP_HP_GPIO_LED ), SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
@@ -9440,6 +9441,16 @@ static int patch_alc269(struct hda_codec *codec)snd_hda_pick_fixup (codec, alc269_fixup_models, alc269_fixup_tbl, alc269_fixups); +/* FIXME: both TX300 and ROG Strix G17 have the same SSID, and +* the quirk breaks the latter (bko#214101). +* Clear the wrong entry. +*/ +if (codec->fixup_id ==ALC282_FIXUP_ASUS_TX300 && + codec->core.vendor_id ==0x10ec0294 ) { +codec_dbg (codec,"Clear wrong fixup for ASUS ROG Strix G17\n" ); + codec->fixup_id =HDA_FIXUP_ID_NOT_SET ; + } +snd_hda_pick_pin_fixup (codec, alc269_pin_fixup_tbl, alc269_fixups, true);snd_hda_pick_pin_fixup (codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,