[BUG]
fstrim on some btrfs only trims the unallocated space, not trimming any
space in existing block groups.
[CAUSE]
Before fstrim_range passed to btrfs_trim_fs(), it get truncated to
range [0, super->total_bytes).
So later btrfs_trim_fs() will only be able to trim block groups in range
[0, super->total_bytes).
While for btrfs, any bytenr aligned to sector size is valid, since btrfs use
its logical address space, there is nothing limiting the location where
we put block groups.
For btrfs with routine balance, it's quite easy to relocate all
block groups and bytenr of block groups will start beyond super->total_bytes.
In that case, btrfs will not trim existing block groups.
[FIX]
Just remove the truncation in btrfs_ioctl_fitrim(), so btrfs_trim_fs()
can get the unmodified range, which is normally set to [0, U64_MAX].
Reported-by: Chris Murphy <lists(a)colorremedies.com>
Fixes: f4c697e6406d ("btrfs: return EINVAL if start > total_bytes in fitrim ioctl")
Cc: <stable(a)vger.kernel.org> # v4.0+
Signed-off-by: Qu Wenruo <wqu(a)suse.com>
---
fs/btrfs/extent-tree.c | 10 +---------
fs/btrfs/ioctl.c | 11 +++++++----
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2cc449190578..c6a9cca8ddca 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -10851,21 +10851,13 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
u64 start;
u64 end;
u64 trimmed = 0;
- u64 total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
u64 bg_failed = 0;
u64 dev_failed = 0;
int bg_ret = 0;
int dev_ret = 0;
int ret = 0;
- /*
- * try to trim all FS space, our block group may start from non-zero.
- */
- if (range->len == total_bytes)
- cache = btrfs_lookup_first_block_group(fs_info, range->start);
- else
- cache = btrfs_lookup_block_group(fs_info, range->start);
-
+ cache = btrfs_lookup_first_block_group(fs_info, range->start);
for (; cache; cache = next_block_group(fs_info, cache)) {
if (cache->key.objectid >= (range->start + range->len)) {
btrfs_put_block_group(cache);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 63600dc2ac4c..8165a4bfa579 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -491,7 +491,6 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg)
struct fstrim_range range;
u64 minlen = ULLONG_MAX;
u64 num_devices = 0;
- u64 total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
int ret;
if (!capable(CAP_SYS_ADMIN))
@@ -515,11 +514,15 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg)
return -EOPNOTSUPP;
if (copy_from_user(&range, arg, sizeof(range)))
return -EFAULT;
- if (range.start > total_bytes ||
- range.len < fs_info->sb->s_blocksize)
+
+ /*
+ * NOTE: Don't truncate the range using super->total_bytes.
+ * Bytenr of btrfs block group is in btrfs logical address space,
+ * which can be any sector size aligned bytenr in [0, U64_MAX].
+ */
+ if (range.len < fs_info->sb->s_blocksize)
return -EINVAL;
- range.len = min(range.len, total_bytes - range.start);
range.minlen = max(range.minlen, minlen);
ret = btrfs_trim_fs(fs_info, &range);
if (ret < 0)
--
2.18.0
Hi all,
Three fixes that worth to have in the @stable, as they were hit by
different people, including Arista on v4.9 stable.
And for linux-next - adding lockdep asserts for line discipline changing
code, verifying that write ldisc sem will be held forthwith.
The last patch is an optional and probably, timeout can be dropped for
read_lock(). I'll do it if everyone agrees.
(Or as per discussion with Peter in v3, just convert ldisc to
a regular rwsem).
Thanks,
Dima
Changes since v3:
- Added tested-by Mark Rutland (thanks!)
- Dropped patch with smp_wmb() - wrong idea
- lockdep_assert_held() should be actually lockdep_assert_held_exclusive()
- Described why tty_ldisc_open() can be called without ldisc_sem held
for pty slave end (o_tty).
- Added Peter's patch for dropping self-made lockdep annotations
- Fix for a reader(s) of ldisc semaphore waiting for an active reader(s)
Changes since v2:
- Added reviewed-by tags
- Hopefully, fixed reported by 0-day issue.
- Added optional fix for wait_readers decrement
Changes since v1:
- Added tested-by/reported-by tags
- Dropped 3/4 (locking tty pair for lockdep sake),
Because of that - not adding lockdep_assert_held() in tty_ldisc_open()
- Added 4/4 cleanup to inc tty->count only on success of
tty_ldisc_reinit()
- lock ldisc without (5*HZ) timeout in tty_reopen()
v1 link: lkml.kernel.org/r/<20180829022353.23568-1-dima(a)arista.com>
v2 link: lkml.kernel.org/r/<20180903165257.29227-1-dima(a)arista.com>
v3 link: lkml.kernel.org/r/<20180911014821.26286-1-dima(a)arista.com>
Cc: Daniel Axtens <dja(a)axtens.net>
Cc: Dmitry Vyukov <dvyukov(a)google.com>
Cc: Mark Rutland <mark.rutland(a)arm.com>
Cc: Michael Neuling <mikey(a)neuling.org>
Cc: Mikulas Patocka <mpatocka(a)redhat.com>
Cc: Nathan March <nathan(a)gt.net>
Cc: Pasi Kärkkäinen <pasik(a)iki.fi>
Cc: Peter Hurley <peter(a)hurleysoftware.com>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: "Rong, Chen" <rong.a.chen(a)intel.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work(a)gmail.com>
Cc: Tan Xiaojun <tanxiaojun(a)huawei.com>
Cc: Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
(please, ignore if I Cc'ed you mistakenly)
Dmitry Safonov (6):
tty: Drop tty->count on tty_reopen() failure
tty: Hold tty_ldisc_lock() during tty_reopen()
tty/ldsem: Wake up readers after timed out down_write()
tty: Simplify tty->count math in tty_reopen()
tty/ldsem: Add lockdep asserts for ldisc_sem
tty/ldsem: Decrement wait_readers on timeouted down_read()
Peter Zijlstra (1):
tty/ldsem: Convert to regular lockdep annotations
drivers/tty/tty_io.c | 12 ++++++----
drivers/tty/tty_ldisc.c | 9 +++++++
drivers/tty/tty_ldsem.c | 62 ++++++++++++++++++++-----------------------------
3 files changed, 42 insertions(+), 41 deletions(-)
--
2.13.6
This is the start of the stable review cycle for the 4.9.127 release.
There are 78 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sat Sep 15 13:17:41 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.127-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.127-rc1
Suzuki K Poulose <suzuki.poulose(a)arm.com>
arm64: Handle mismatched cache type
Suzuki K Poulose <suzuki.poulose(a)arm.com>
arm64: Fix mismatched cache line size detection
Ethan Lien <ethanlien(a)synology.com>
btrfs: use correct compare function of dirty_metadata_bytes
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
ASoC: wm8994: Fix missing break in switch
Martin Schwidefsky <schwidefsky(a)de.ibm.com>
s390/lib: use expoline for all bcr instructions
Tomas Winkler <tomas.winkler(a)intel.com>
mei: me: allow runtime pm for platform with D0i3
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_tbf: fix two null pointer dereferences on init failure
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_netem: avoid null pointer deref on init failure
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_hhf: fix null pointer dereference on init failure
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_multiq: fix double free on init failure
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_htb: fix crash on init failure
Chas Williams <chas3(a)att.com>
Fixes: Commit 2aa6d036b716 ("mm: numa: avoid waiting on freed migrated pages")
Govindarajulu Varadarajan <gvaradar(a)cisco.com>
enic: do not call enic_change_mtu in enic_probe
Fabio Estevam <fabio.estevam(a)nxp.com>
Revert "ARM: imx_v6_v7_defconfig: Select ULPI support"
Tyler Hicks <tyhicks(a)canonical.com>
irda: Only insert new objects into the global database via setsockopt
Tyler Hicks <tyhicks(a)canonical.com>
irda: Fix memory leak caused by repeated binds of irda socket
Randy Dunlap <rdunlap(a)infradead.org>
kbuild: make missing $DEPMOD a Warning instead of an Error
Juergen Gross <jgross(a)suse.com>
x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear
Joel Fernandes (Google) <joel(a)joelfernandes.org>
debugobjects: Make stack check warning more informative
Eric Dumazet <edumazet(a)google.com>
tcp: Revert "tcp: tcp_probe: use spin_lock_bh()"
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
drm/edid: Add 6 bpc quirk for SDC panel in Lenovo B50-80
Marc Zyngier <marc.zyngier(a)arm.com>
ARM: rockchip: Force CONFIG_PM on Rockchip systems
Marc Zyngier <marc.zyngier(a)arm.com>
arm64: rockchip: Force CONFIG_PM on Rockchip systems
Qu Wenruo <wqu(a)suse.com>
btrfs: Don't remove block group that still has pinned down bytes
Qu Wenruo <wqu(a)suse.com>
btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized
Misono Tomohiro <misono.tomohiro(a)jp.fujitsu.com>
btrfs: replace: Reset on-disk dev stats value after replace
Levin Du <djw(a)t-chip.com.cn>
clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399
Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
Steve French <stfrench(a)microsoft.com>
SMB3: Number of requests sent should be displayed for SMB3 not just CIFS
Steve French <stfrench(a)microsoft.com>
smb3: fix reset of bytes read and written stats
YueHaibing <yuehaibing(a)huawei.com>
RDS: IB: fix 'passing zero to ERR_PTR()' warning
Breno Leitao <leitao(a)debian.org>
selftests/powerpc: Kill child processes on SIGINT
Ian Abbott <abbotti(a)mev.co.uk>
staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice
John Pittman <jpittman(a)redhat.com>
dm kcopyd: avoid softlockup in run_complete_job
Thomas Petazzoni <thomas.petazzoni(a)bootlin.com>
PCI: mvebu: Fix I/O space end address calculation
Dan Carpenter <dan.carpenter(a)oracle.com>
scsi: aic94xx: fix an error code in aic94xx_init()
Hans de Goede <hdegoede(a)redhat.com>
ACPI / scan: Initialize status to ACPI_STA_DEFAULT
Stefan Haberland <sth(a)linux.ibm.com>
s390/dasd: fix panic for failed online processing
Stefan Haberland <sth(a)linux.ibm.com>
s390/dasd: fix hanging offline processing due to canceled worker
Greg Edwards <gedwards(a)ddn.com>
block: bvec_nr_vecs() returns value for wrong slab
Sandipan Das <sandipan(a)linux.ibm.com>
perf probe powerpc: Fix trace event post-processing
Dan Carpenter <dan.carpenter(a)oracle.com>
powerpc: Fix size calculation using resource_size()
Jean-Philippe Brucker <jean-philippe.brucker(a)arm.com>
net/9p: fix error path of p9_virtio_probe
Tomas Bortoli <tomasbortoli(a)gmail.com>
net/9p/trans_fd.c: fix race by holding the lock
Jonas Gorski <jonas.gorski(a)gmail.com>
irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP
Gal Pressman <pressmangal(a)gmail.com>
RDMA/hns: Fix usage of bitmap allocation functions return values
Aleh Filipovich <aleh(a)vaolix.com>
platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360
Guenter Roeck <linux(a)roeck-us.net>
mfd: sm501: Set coherent_dma_mask when creating subdevices
Tan Hu <tan.hu(a)zte.com.cn>
ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest()
Philipp Rudo <prudo(a)linux.ibm.com>
s390/kdump: Fix memleak in nt_vmcoreinfo
Randy Dunlap <rdunlap(a)infradead.org>
platform/x86: intel_punit_ipc: fix build errors
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot()
Andrey Ryabinin <aryabinin(a)virtuozzo.com>
mm/fadvise.c: fix signed overflow UBSAN complaint
Suzuki K Poulose <suzuki.poulose(a)arm.com>
virtio: pci-legacy: Validate queue pfn
Randy Dunlap <rdunlap(a)infradead.org>
scripts: modpost: check memory allocation results
OGAWA Hirofumi <hirofumi(a)mail.parknet.co.jp>
fat: validate ->i_start before using
Ernesto A. Fernández <ernesto.mnd.fernandez(a)gmail.com>
hfsplus: fix NULL dereference in hfsplus_lookup()
Arnd Bergmann <arnd(a)arndb.de>
reiserfs: change j_timestamp type to time64_t
Jann Horn <jannh(a)google.com>
fork: don't copy inconsistent signal handler state to child
Laura Abbott <labbott(a)redhat.com>
sunrpc: Don't use stack buffer with scatterlist
Ernesto A. Fernández <ernesto.mnd.fernandez(a)gmail.com>
hfs: prevent crash on exit from failed search
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
hfsplus: don't return 0 when fill_super() failed
Ronnie Sahlberg <lsahlber(a)redhat.com>
cifs: check if SMB2 PDU size has been padded and suppress the warning
Vlad Buslov <vladbu(a)mellanox.com>
net: sched: action_ife: take reference to meta module
Cong Wang <xiyou.wangcong(a)gmail.com>
act_ife: fix a potential deadlock
Cong Wang <xiyou.wangcong(a)gmail.com>
act_ife: move tcfa_lock down to where necessary
Stephen Hemminger <stephen(a)networkplumber.org>
hv_netvsc: ignore devices that are not PCI
Jason Wang <jasowang(a)redhat.com>
vhost: correctly check the iova range when waking virtqueue
Xin Long <lucien.xin(a)gmail.com>
sctp: hold transport before accessing its asoc in sctp_transport_get_next
Alexey Kodanev <alexey.kodanev(a)oracle.com>
vti6: remove !skb->ignore_df check from vti6_xmit()
Florian Westphal <fw(a)strlen.de>
tcp: do not restart timewait timer on rst reception
Anthony Wong <anthony.wong(a)ubuntu.com>
r8169: add support for NCube 8168 network card
Manish Chopra <manish.chopra(a)cavium.com>
qlge: Fix netdev features configuration.
Kees Cook <keescook(a)chromium.org>
net: sched: Fix memory exposure from short TCA_U32_SEL
Doug Berger <opendmb(a)gmail.com>
net: bcmgenet: use MAC link status for fixed phy
Eric Dumazet <edumazet(a)google.com>
ipv4: tcp: send zero IPID for RST and ACK sent in SYN-RECV and TIME-WAIT state
Cong Wang <xiyou.wangcong(a)gmail.com>
act_ife: fix a potential use-after-free
Michal Hocko <mhocko(a)suse.cz>
x86/speculation/l1tf: Fix up pte->pfn conversion for PAE
-------------
Diffstat:
Makefile | 4 +-
arch/arm/configs/imx_v6_v7_defconfig | 2 -
arch/arm/mach-rockchip/Kconfig | 1 +
arch/arm64/Kconfig.platforms | 1 +
arch/arm64/include/asm/cachetype.h | 5 ++
arch/arm64/include/asm/cpucaps.h | 3 +-
arch/arm64/kernel/cpu_errata.c | 24 ++++++--
arch/arm64/kernel/cpufeature.c | 4 +-
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/powerpc/sysdev/mpic_msgr.c | 2 +-
arch/s390/kernel/crash_dump.c | 17 ++++--
arch/s390/lib/mem.S | 9 ++-
arch/x86/include/asm/pgtable-3level.h | 7 +--
arch/x86/include/asm/pgtable.h | 2 +-
block/bio.c | 2 +-
drivers/acpi/scan.c | 5 +-
drivers/clk/rockchip/clk-rk3399.c | 1 +
drivers/gpu/drm/drm_edid.c | 3 +
drivers/infiniband/hw/hns/hns_roce_pd.c | 2 +-
drivers/infiniband/hw/hns/hns_roce_qp.c | 5 +-
drivers/irqchip/irq-bcm7038-l1.c | 4 ++
drivers/md/dm-kcopyd.c | 2 +
drivers/mfd/sm501.c | 1 +
drivers/misc/mei/pci-me.c | 5 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 3 +
drivers/net/ethernet/broadcom/genet/bcmmii.c | 10 +++-
drivers/net/ethernet/cisco/enic/enic_main.c | 2 +-
drivers/net/ethernet/qlogic/qlge/qlge_main.c | 23 +++-----
drivers/net/ethernet/realtek/r8169.c | 1 +
drivers/net/hyperv/netvsc_drv.c | 5 ++
drivers/pci/host/pci-mvebu.c | 2 +-
drivers/platform/x86/asus-nb-wmi.c | 1 +
drivers/platform/x86/intel_punit_ipc.c | 1 +
drivers/s390/block/dasd_eckd.c | 10 +++-
drivers/scsi/aic94xx/aic94xx_init.c | 4 +-
drivers/staging/comedi/drivers/ni_mio_common.c | 3 +-
drivers/vhost/vhost.c | 2 +-
drivers/virtio/virtio_pci_legacy.c | 14 ++++-
fs/btrfs/dev-replace.c | 6 ++
fs/btrfs/disk-io.c | 10 ++--
fs/btrfs/extent-tree.c | 2 +-
fs/btrfs/relocation.c | 23 ++++----
fs/cifs/cifs_debug.c | 8 +++
fs/cifs/smb2misc.c | 7 +++
fs/cifs/smb2pdu.c | 2 +-
fs/dcache.c | 3 +-
fs/fat/cache.c | 19 ++++---
fs/fat/fat.h | 5 ++
fs/fat/fatent.c | 6 +-
fs/hfs/brec.c | 7 ++-
fs/hfsplus/dir.c | 4 +-
fs/hfsplus/super.c | 4 +-
fs/reiserfs/reiserfs.h | 2 +-
include/linux/pci_ids.h | 2 +
kernel/fork.c | 2 +
lib/debugobjects.c | 7 ++-
mm/fadvise.c | 8 ++-
mm/huge_memory.c | 2 +-
net/9p/trans_fd.c | 10 ++--
net/9p/trans_virtio.c | 3 +-
net/ipv4/tcp_ipv4.c | 6 ++
net/ipv4/tcp_minisocks.c | 3 +-
net/ipv4/tcp_probe.c | 4 +-
net/ipv6/ip6_vti.c | 2 +-
net/irda/af_irda.c | 13 ++++-
net/netfilter/ipvs/ip_vs_core.c | 15 +++--
net/rds/ib_frmr.c | 1 +
net/sched/act_ife.c | 79 +++++++++++++++-----------
net/sched/cls_u32.c | 8 ++-
net/sched/sch_hhf.c | 3 +
net/sched/sch_htb.c | 5 +-
net/sched/sch_multiq.c | 9 +--
net/sched/sch_netem.c | 4 +-
net/sched/sch_tbf.c | 5 +-
net/sctp/proc.c | 4 --
net/sctp/socket.c | 22 ++++---
net/sunrpc/auth_gss/gss_krb5_crypto.c | 12 +++-
scripts/depmod.sh | 4 +-
scripts/mod/modpost.c | 8 +--
sound/soc/codecs/wm8994.c | 1 +
tools/perf/arch/powerpc/util/sym-handling.c | 4 +-
tools/testing/selftests/powerpc/harness.c | 18 ++++--
82 files changed, 376 insertions(+), 190 deletions(-)
This is the start of the stable review cycle for the 4.4.156 release.
There are 60 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sat Sep 15 13:17:29 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.156-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.4.156-rc1
Ethan Lien <ethanlien(a)synology.com>
btrfs: use correct compare function of dirty_metadata_bytes
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
ASoC: wm8994: Fix missing break in switch
Martin Schwidefsky <schwidefsky(a)de.ibm.com>
s390/lib: use expoline for all bcr instructions
Tomas Winkler <tomas.winkler(a)intel.com>
mei: me: allow runtime pm for platform with D0i3
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_tbf: fix two null pointer dereferences on init failure
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_netem: avoid null pointer deref on init failure
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_hhf: fix null pointer dereference on init failure
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_multiq: fix double free on init failure
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
sch_htb: fix crash on init failure
Miklos Szeredi <mszeredi(a)redhat.com>
ovl: proper cleanup of workdir
Antonio Murdaca <amurdaca(a)redhat.com>
ovl: override creds with the ones from the superblock mounter
Miklos Szeredi <mszeredi(a)redhat.com>
ovl: rename is_merge to is_lowest
Marc Zyngier <marc.zyngier(a)arm.com>
irqchip/gic: Make interrupt ID 1020 invalid
Marc Zyngier <marc.zyngier(a)arm.com>
irqchip/gic-v3: Add missing barrier to 32bit version of gic_read_iar()
Shanker Donthineni <shankerd(a)codeaurora.org>
irqchip/gicv3-its: Avoid cache flush beyond ITS_BASERn memory size
Shanker Donthineni <shankerd(a)codeaurora.org>
irqchip/gicv3-its: Fix memory leak in its_free_tables()
Marc Zyngier <marc.zyngier(a)arm.com>
irqchip/gic-v3-its: Recompute the number of pages on page size change
Sudeep Holla <sudeep.holla(a)arm.com>
genirq: Delay incrementing interrupt count if it's disabled/pending
Chas Williams <chas3(a)att.com>
Fixes: Commit cdbf92675fad ("mm: numa: avoid waiting on freed migrated pages")
Govindarajulu Varadarajan <gvaradar(a)cisco.com>
enic: do not call enic_change_mtu in enic_probe
Fabio Estevam <fabio.estevam(a)nxp.com>
Revert "ARM: imx_v6_v7_defconfig: Select ULPI support"
Tyler Hicks <tyhicks(a)canonical.com>
irda: Only insert new objects into the global database via setsockopt
Tyler Hicks <tyhicks(a)canonical.com>
irda: Fix memory leak caused by repeated binds of irda socket
Randy Dunlap <rdunlap(a)infradead.org>
kbuild: make missing $DEPMOD a Warning instead of an Error
Juergen Gross <jgross(a)suse.com>
x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear
Joel Fernandes (Google) <joel(a)joelfernandes.org>
debugobjects: Make stack check warning more informative
Qu Wenruo <wqu(a)suse.com>
btrfs: Don't remove block group that still has pinned down bytes
Qu Wenruo <wqu(a)suse.com>
btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized
Misono Tomohiro <misono.tomohiro(a)jp.fujitsu.com>
btrfs: replace: Reset on-disk dev stats value after replace
Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
Steve French <stfrench(a)microsoft.com>
SMB3: Number of requests sent should be displayed for SMB3 not just CIFS
Steve French <stfrench(a)microsoft.com>
smb3: fix reset of bytes read and written stats
Breno Leitao <leitao(a)debian.org>
selftests/powerpc: Kill child processes on SIGINT
Ian Abbott <abbotti(a)mev.co.uk>
staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice
John Pittman <jpittman(a)redhat.com>
dm kcopyd: avoid softlockup in run_complete_job
Thomas Petazzoni <thomas.petazzoni(a)bootlin.com>
PCI: mvebu: Fix I/O space end address calculation
Dan Carpenter <dan.carpenter(a)oracle.com>
scsi: aic94xx: fix an error code in aic94xx_init()
Stefan Haberland <sth(a)linux.ibm.com>
s390/dasd: fix hanging offline processing due to canceled worker
Dan Carpenter <dan.carpenter(a)oracle.com>
powerpc: Fix size calculation using resource_size()
Jean-Philippe Brucker <jean-philippe.brucker(a)arm.com>
net/9p: fix error path of p9_virtio_probe
Jonas Gorski <jonas.gorski(a)gmail.com>
irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP
Aleh Filipovich <aleh(a)vaolix.com>
platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360
Guenter Roeck <linux(a)roeck-us.net>
mfd: sm501: Set coherent_dma_mask when creating subdevices
Tan Hu <tan.hu(a)zte.com.cn>
ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest()
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot()
Andrey Ryabinin <aryabinin(a)virtuozzo.com>
mm/fadvise.c: fix signed overflow UBSAN complaint
Randy Dunlap <rdunlap(a)infradead.org>
scripts: modpost: check memory allocation results
OGAWA Hirofumi <hirofumi(a)mail.parknet.co.jp>
fat: validate ->i_start before using
Ernesto A. Fernández <ernesto.mnd.fernandez(a)gmail.com>
hfsplus: fix NULL dereference in hfsplus_lookup()
Arnd Bergmann <arnd(a)arndb.de>
reiserfs: change j_timestamp type to time64_t
Jann Horn <jannh(a)google.com>
fork: don't copy inconsistent signal handler state to child
Ernesto A. Fernández <ernesto.mnd.fernandez(a)gmail.com>
hfs: prevent crash on exit from failed search
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
hfsplus: don't return 0 when fill_super() failed
Ronnie Sahlberg <lsahlber(a)redhat.com>
cifs: check if SMB2 PDU size has been padded and suppress the warning
Alexey Kodanev <alexey.kodanev(a)oracle.com>
vti6: remove !skb->ignore_df check from vti6_xmit()
Florian Westphal <fw(a)strlen.de>
tcp: do not restart timewait timer on rst reception
Manish Chopra <manish.chopra(a)cavium.com>
qlge: Fix netdev features configuration.
Doug Berger <opendmb(a)gmail.com>
net: bcmgenet: use MAC link status for fixed phy
Greg Hackmann <ghackmann(a)android.com>
staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free
Michal Hocko <mhocko(a)suse.cz>
x86/speculation/l1tf: Fix up pte->pfn conversion for PAE
-------------
Diffstat:
Makefile | 4 +-
arch/arm/configs/imx_v6_v7_defconfig | 2 -
arch/arm/include/asm/arch_gicv3.h | 1 +
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/powerpc/sysdev/mpic_msgr.c | 2 +-
arch/s390/lib/mem.S | 9 ++-
arch/x86/include/asm/pgtable-3level.h | 7 +-
arch/x86/include/asm/pgtable.h | 2 +-
drivers/irqchip/irq-bcm7038-l1.c | 4 ++
drivers/irqchip/irq-gic-v3-its.c | 34 ++++++----
drivers/irqchip/irq-gic.c | 2 +-
drivers/md/dm-kcopyd.c | 2 +
drivers/mfd/sm501.c | 1 +
drivers/misc/mei/pci-me.c | 5 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 3 +
drivers/net/ethernet/broadcom/genet/bcmmii.c | 10 ++-
drivers/net/ethernet/cisco/enic/enic_main.c | 2 +-
drivers/net/ethernet/qlogic/qlge/qlge_main.c | 23 +++----
drivers/pci/host/pci-mvebu.c | 2 +-
drivers/platform/x86/asus-nb-wmi.c | 1 +
drivers/s390/block/dasd_eckd.c | 7 +-
drivers/scsi/aic94xx/aic94xx_init.c | 4 +-
drivers/staging/android/ion/ion.c | 60 ++++++++++-------
drivers/staging/comedi/drivers/ni_mio_common.c | 3 +-
fs/btrfs/dev-replace.c | 6 ++
fs/btrfs/disk-io.c | 10 +--
fs/btrfs/extent-tree.c | 2 +-
fs/btrfs/relocation.c | 23 ++++---
fs/cifs/cifs_debug.c | 8 +++
fs/cifs/smb2misc.c | 7 ++
fs/cifs/smb2pdu.c | 2 +-
fs/dcache.c | 3 +-
fs/fat/cache.c | 19 ++++--
fs/fat/fat.h | 5 ++
fs/fat/fatent.c | 6 +-
fs/hfs/brec.c | 7 +-
fs/hfsplus/dir.c | 4 +-
fs/hfsplus/super.c | 4 +-
fs/overlayfs/copy_up.c | 26 +------
fs/overlayfs/dir.c | 67 ++-----------------
fs/overlayfs/overlayfs.h | 3 +
fs/overlayfs/readdir.c | 93 ++++++++++++++++++++------
fs/overlayfs/super.c | 20 +++++-
fs/reiserfs/reiserfs.h | 2 +-
kernel/fork.c | 2 +
kernel/irq/chip.c | 8 +--
lib/debugobjects.c | 7 +-
mm/fadvise.c | 8 ++-
mm/huge_memory.c | 2 +-
net/9p/trans_virtio.c | 3 +-
net/ipv4/tcp_minisocks.c | 3 +-
net/ipv6/ip6_vti.c | 2 +-
net/irda/af_irda.c | 13 +++-
net/netfilter/ipvs/ip_vs_core.c | 15 +++--
net/sched/sch_hhf.c | 3 +
net/sched/sch_htb.c | 5 +-
net/sched/sch_multiq.c | 9 +--
net/sched/sch_netem.c | 4 +-
net/sched/sch_tbf.c | 5 +-
scripts/depmod.sh | 4 +-
scripts/mod/modpost.c | 8 +--
sound/soc/codecs/wm8994.c | 1 +
tools/testing/selftests/powerpc/harness.c | 18 +++--
63 files changed, 369 insertions(+), 260 deletions(-)
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 299c2a904b1e8d5096d4813df6371357d97a6cd1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20Sch=C3=B6n?= <fredrikschon(a)gmail.com>
Date: Fri, 17 Aug 2018 22:07:28 +0200
Subject: [PATCH] drm/i915: Increase LSPCON timeout
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
100 ms is not enough time for the LSPCON adapter on Intel NUC devices to
settle. This causes dropped display modes at boot or screen reconfiguration.
Empirical testing can reproduce the error up to a timeout of 190 ms. Basic
boot and stress testing at 200 ms has not (yet) failed.
Increase timeout to 400 ms to get some margin of error.
Changes from v1:
The initial suggestion of 1000 ms was lowered due to concerns about delaying
valid timeout cases.
Update patch metadata.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107503
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1570392
Fixes: 357c0ae9198a ("drm/i915/lspcon: Wait for expected LSPCON mode to settle")
Cc: Shashank Sharma <shashank.sharma(a)intel.com>
Cc: Imre Deak <imre.deak(a)intel.com>
Cc: Jani Nikula <jani.nikula(a)intel.com>
Cc: <stable(a)vger.kernel.org> # v4.11+
Reviewed-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
Reviewed-by: Shashank Sharma <shashank.sharma(a)intel.com>
Signed-off-by: Fredrik Schön <fredrik.schon(a)gmail.com>
Signed-off-by: Jani Nikula <jani.nikula(a)intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180817200728.8154-1-fredrik…
(cherry picked from commit 59f1c8ab30d6f9042562949f42cbd3f3cf69de94)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi(a)intel.com>
diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
index 5dae16ccd9f1..3e085c5f2b81 100644
--- a/drivers/gpu/drm/i915/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/intel_lspcon.c
@@ -74,7 +74,7 @@ static enum drm_lspcon_mode lspcon_wait_mode(struct intel_lspcon *lspcon,
DRM_DEBUG_KMS("Waiting for LSPCON mode %s to settle\n",
lspcon_mode_name(mode));
- wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode, 100);
+ wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode, 400);
if (current_mode != mode)
DRM_ERROR("LSPCON mode hasn't settled\n");
When the main loop in linehandle_create() encounters an error, it
fails to free one of the previously-requested GPIO descriptors.
This renders the unfreed GPIO unusable until reboot, and leaves
its label pointing to free'd kernel memory.
Cc: stable(a)vger.kernel.org
Fixes: ab3dbcf78f60 ("gpioib: do not free unrequested descriptors")
Signed-off-by: Jim Paris <jim(a)jtan.com>
---
drivers/gpio/gpiolib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index e8f8a1999393..a57300c1d649 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -571,7 +571,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
if (ret)
goto out_free_descs;
lh->descs[i] = desc;
- count = i;
+ count = i + 1;
if (lflags & GPIOHANDLE_REQUEST_ACTIVE_LOW)
set_bit(FLAG_ACTIVE_LOW, &desc->flags);
--
2.18.0
There are five patches to fix CVE-2018-5390 in latest mainline
branch, but only two patches exist in stable 4.4 and 3.18:
dc6ae4d tcp: detect malicious patterns in tcp_collapse_ofo_queue()
5fbec48 tcp: avoid collapses in tcp_prune_queue() if possible
I have tested with stable 4.4 kernel, and found the cpu usage was very high.
So I think only two patches can't fix the CVE-2018-5390.
test results:
with fix patch: 78.2% ksoftirqd
withoutfix patch: 90% ksoftirqd
Then I try to imitate 72cd43ba(tcp: free batches of packets in tcp_prune_ofo_queue())
to drop at least 12.5 % of sk_rcvbuf to avoid malicious attacks with simple queue
instead of RB tree. The result is not very well.
After analysing the codes of stable 4.4, and debuging the
system, shows that search of ofo_queue(tcp ofo using a simple queue) cost more cycles.
So I try to backport "tcp: use an RB tree for ooo receive queue" using RB tree
instead of simple queue, then backport Eric Dumazet 5 fixed patches in mainline,
good news is that ksoftirqd is turn to about 20%, which is the same with mainline now.
Stable 4.4 have already back port two patches,
f4a3313d(tcp: avoid collapses in tcp_prune_queue() if possible)
3d4bf93a(tcp: detect malicious patterns in tcp_collapse_ofo_queue())
If we want to change simple queue to RB tree to finally resolve, we should apply previous
patch 9f5afeae(tcp: use an RB tree for ooo receive queue.) firstly, but 9f5afeae have many
conflicts with 3d4bf93a and f4a3313d, which are part of patch series from Eric in
mainline to fix CVE-2018-5390, so I need revert part of patches in stable 4.4 firstly,
then apply 9f5afeae, and reapply five patches from Eric.
Eric Dumazet (6):
tcp: increment sk_drops for dropped rx packets
tcp: free batches of packets in tcp_prune_ofo_queue()
tcp: avoid collapses in tcp_prune_queue() if possible
tcp: detect malicious patterns in tcp_collapse_ofo_queue()
tcp: call tcp_drop() from tcp_data_queue_ofo()
tcp: add tcp_ooo_try_coalesce() helper
Mao Wenan (2):
Revert "tcp: detect malicious patterns in tcp_collapse_ofo_queue()"
Revert "tcp: avoid collapses in tcp_prune_queue() if possible"
Yaogong Wang (1):
tcp: use an RB tree for ooo receive queue
include/linux/skbuff.h | 8 +
include/linux/tcp.h | 7 +-
include/net/sock.h | 7 +
include/net/tcp.h | 2 +-
net/core/skbuff.c | 19 +++
net/ipv4/tcp.c | 4 +-
net/ipv4/tcp_input.c | 412 +++++++++++++++++++++++++++++------------------
net/ipv4/tcp_ipv4.c | 3 +-
net/ipv4/tcp_minisocks.c | 1 -
net/ipv6/tcp_ipv6.c | 1 +
10 files changed, 294 insertions(+), 170 deletions(-)
--
1.8.3.1