Update to 4.1-rc3

Drop and refresh patches as appropriate.

In the x86 memtest patch, add #ifdef CONFIG_X86 as memtest is now
cross-architecture and memtest86+ is not.

svn path=/dists/trunk/linux/; revision=22616
This commit is contained in:
Ben Hutchings 2015-05-11 16:39:41 +00:00
parent 8ed388e21b
commit 56c70a5fd2
14 changed files with 82 additions and 309 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
linux (4.1~rc3-1~exp1) UNRELEASED; urgency=medium
* New upstream release candidate
-- Ben Hutchings <ben@decadent.org.uk> Mon, 11 May 2015 16:19:42 +0100
linux (4.0.2-1) unstable; urgency=medium
* New upstream stable update:

View File

@ -1,72 +0,0 @@
From: Lukas Czerner <lczerner@redhat.com>
Date: Fri, 3 Apr 2015 00:09:13 -0400
Subject: ext4: allocate entire range in zero range
Origin: https://git.kernel.org/cgit/linux/kernel/git/tytso/ext4.git/commit/?id=0f2af21aae11972fa924374ddcf52e88347cf5a8
Currently there is a bug in zero range code which causes zero range
calls to only allocate block aligned portion of the range, while
ignoring the rest in some cases.
In some cases, namely if the end of the range is past i_size, we do
attempt to preallocate the last nonaligned block. However this might
cause kernel to BUG() in some carefully designed zero range requests
on setups where page size > block size.
Fix this problem by first preallocating the entire range, including
the nonaligned edges and converting the written extents to unwritten
in the next step. This approach will also give us the advantage of
having the range to be as linearly contiguous as possible.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4795,12 +4795,6 @@ static long ext4_zero_range(struct file
else
max_blocks -= lblk;
- flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT |
- EXT4_GET_BLOCKS_CONVERT_UNWRITTEN |
- EXT4_EX_NOCACHE;
- if (mode & FALLOC_FL_KEEP_SIZE)
- flags |= EXT4_GET_BLOCKS_KEEP_SIZE;
-
mutex_lock(&inode->i_mutex);
/*
@@ -4817,15 +4811,28 @@ static long ext4_zero_range(struct file
ret = inode_newsize_ok(inode, new_size);
if (ret)
goto out_mutex;
- /*
- * If we have a partial block after EOF we have to allocate
- * the entire block.
- */
- if (partial_end)
- max_blocks += 1;
}
+ flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT;
+ if (mode & FALLOC_FL_KEEP_SIZE)
+ flags |= EXT4_GET_BLOCKS_KEEP_SIZE;
+
+ /* Preallocate the range including the unaligned edges */
+ if (partial_begin || partial_end) {
+ ret = ext4_alloc_file_blocks(file,
+ round_down(offset, 1 << blkbits) >> blkbits,
+ (round_up((offset + len), 1 << blkbits) -
+ round_down(offset, 1 << blkbits)) >> blkbits,
+ new_size, flags, mode);
+ if (ret)
+ goto out_mutex;
+
+ }
+
+ /* Zero range excluding the unaligned edges */
if (max_blocks > 0) {
+ flags |= (EXT4_GET_BLOCKS_CONVERT_UNWRITTEN |
+ EXT4_EX_NOCACHE);
/* Now release the pages and zero block aligned part of pages*/
truncate_pagecache_range(inode, start, end - 1);

View File

@ -53,7 +53,7 @@ upstream submission.
/* disable MPU */
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -433,10 +433,8 @@ static enum ucode_state request_microcod
@@ -432,10 +432,8 @@ static enum ucode_state request_microcod
if (c->x86 >= 0x15)
snprintf(fw_name, sizeof(fw_name), "amd-ucode/microcode_amd_fam%.2xh.bin", c->x86);
@ -96,7 +96,7 @@ upstream submission.
fw_size = firmware->size / sizeof(u32);
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -393,10 +393,8 @@ static int ath3k_load_patch(struct usb_d
@@ -394,10 +394,8 @@ static int ath3k_load_patch(struct usb_d
le32_to_cpu(fw_version.rom_version));
ret = request_firmware(&firmware, filename, &udev->dev);
@ -108,7 +108,7 @@ upstream submission.
pt_rom_version = get_unaligned_le32(firmware->data +
firmware->size - 8);
@@ -456,10 +454,8 @@ static int ath3k_load_syscfg(struct usb_
@@ -457,10 +455,8 @@ static int ath3k_load_syscfg(struct usb_
le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
ret = request_firmware(&firmware, filename, &udev->dev);
@ -203,7 +203,7 @@ upstream submission.
fw->size, fw_name);
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1284,11 +1284,8 @@ static void sdma_load_firmware(const str
@@ -1285,11 +1285,8 @@ static void sdma_load_firmware(const str
const struct sdma_script_start_addrs *addr;
unsigned short *ram_code;
@ -233,7 +233,7 @@ upstream submission.
where = 0;
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
@@ -1507,10 +1507,8 @@ gf100_gr_ctor_fw(struct gf100_gr_priv *p
@@ -1521,10 +1521,8 @@ gf100_gr_ctor_fw(struct gf100_gr_priv *p
if (ret) {
snprintf(f, sizeof(f), "nouveau/%s", fwname);
ret = request_firmware(&fw, f, nv_device_base(device));
@ -289,7 +289,7 @@ upstream submission.
rdev->me_fw->size, fw_name);
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -2519,10 +2519,6 @@ int r600_init_microcode(struct radeon_de
@@ -2545,10 +2545,6 @@ int r600_init_microcode(struct radeon_de
out:
if (err) {
@ -343,7 +343,7 @@ upstream submission.
ret = qib_ibsd_ucode_loaded(dd->pport, fw);
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1892,10 +1892,8 @@ static int mxt_load_fw(struct device *de
@@ -2195,10 +2195,8 @@ static int mxt_load_fw(struct device *de
int ret;
ret = request_firmware(&fw, fn, dev);
@ -382,7 +382,7 @@ upstream submission.
}
--- a/drivers/media/usb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
@@ -2394,12 +2394,9 @@ static int stk9090m_frontend_attach(stru
@@ -2391,12 +2391,9 @@ static int stk9090m_frontend_attach(stru
dib9000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, 0x80);
@ -397,7 +397,7 @@ upstream submission.
stk9090m_config.microcode_B_fe_size = state->frontend_firmware->size;
stk9090m_config.microcode_B_fe_buffer = state->frontend_firmware->data;
@@ -2460,12 +2457,9 @@ static int nim9090md_frontend_attach(str
@@ -2457,12 +2454,9 @@ static int nim9090md_frontend_attach(str
msleep(20);
dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
@ -728,16 +728,16 @@ upstream submission.
}
--- a/drivers/media/common/siano/smscoreapi.c
+++ b/drivers/media/common/siano/smscoreapi.c
@@ -1164,10 +1164,8 @@ static int smscore_load_firmware_from_fi
@@ -1162,10 +1162,8 @@ static int smscore_load_firmware_from_fi
return -EINVAL;
rc = request_firmware(&fw, fw_filename, coredev->device);
- if (rc < 0) {
- sms_err("failed to open firmware file \"%s\"", fw_filename);
- pr_err("failed to open firmware file '%s'\n", fw_filename);
+ if (rc)
return rc;
- }
sms_info("read fw %s, buffer size=0x%zx", fw_filename, fw->size);
pr_debug("read fw %s, buffer size=0x%zx\n", fw_filename, fw->size);
fw_buf = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT),
GFP_KERNEL | GFP_DMA);
--- a/drivers/media/pci/ttpci/av7110.c
@ -807,7 +807,7 @@ upstream submission.
firmware_size = fw_entry->size;
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -512,11 +512,8 @@ static int wl1273_fm_upload_firmware_pat
@@ -514,11 +514,8 @@ static int wl1273_fm_upload_firmware_pat
* Uploading the firmware patch is not always necessary,
* so we only print an info message.
*/
@ -1216,7 +1216,7 @@ upstream submission.
if (bp->mips_firmware->size < sizeof(*mips_fw) ||
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12976,11 +12976,8 @@ static int bnx2x_init_firmware(struct bn
@@ -12981,11 +12981,8 @@ static int bnx2x_init_firmware(struct bn
BNX2X_DEV_INFO("Loading %s\n", fw_file_name);
rc = request_firmware(&bp->firmware, fw_file_name, &bp->pdev->dev);
@ -1231,7 +1231,7 @@ upstream submission.
if (rc) {
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -11337,11 +11337,8 @@ static int tg3_request_firmware(struct t
@@ -11335,11 +11335,8 @@ static int tg3_request_firmware(struct t
{
const struct tg3_firmware_hdr *fw_hdr;
@ -1246,7 +1246,7 @@ upstream submission.
--- a/drivers/net/ethernet/brocade/bna/cna_fwimg.c
+++ b/drivers/net/ethernet/brocade/bna/cna_fwimg.c
@@ -30,10 +30,8 @@ cna_read_firmware(struct pci_dev *pdev,
@@ -31,10 +31,8 @@ cna_read_firmware(struct pci_dev *pdev,
{
const struct firmware *fw;
@ -1314,7 +1314,7 @@ upstream submission.
netif_info(nic, probe, nic->netdev,
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -601,8 +601,6 @@ static int myri10ge_load_hotplug_firmwar
@@ -596,8 +596,6 @@ static int myri10ge_load_hotplug_firmwar
unsigned i;
if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) {
@ -1424,7 +1424,7 @@ upstream submission.
fwh = (struct at76_fw_header *)(fwe->fw->data);
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1084,12 +1084,8 @@ static void ath9k_hif_usb_firmware_cb(co
@@ -1085,12 +1085,8 @@ static void ath9k_hif_usb_firmware_cb(co
struct hif_device_usb *hif_dev = context;
int ret;
@ -1568,7 +1568,7 @@ upstream submission.
else
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -1078,13 +1078,8 @@ static void iwl_req_fw_callback(const st
@@ -1119,13 +1119,8 @@ static void iwl_req_fw_callback(const st
if (!pieces)
return;
@ -1585,7 +1585,7 @@ upstream submission.
drv->firmware_name, ucode_raw->size);
--- a/drivers/net/wireless/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/libertas_tf/if_usb.c
@@ -825,8 +825,6 @@ static int if_usb_prog_firmware(struct i
@@ -824,8 +824,6 @@ static int if_usb_prog_firmware(struct i
kparam_block_sysfs_write(fw_name);
ret = request_firmware(&cardp->fw, lbtf_fw_name, &cardp->udev->dev);
if (ret < 0) {
@ -1596,7 +1596,7 @@ upstream submission.
}
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -401,11 +401,8 @@ static void mwifiex_fw_dpc(const struct
@@ -454,11 +454,8 @@ static void mwifiex_fw_dpc(const struct
bool init_failed = false;
struct wireless_dev *wdev;
@ -1920,7 +1920,7 @@ upstream submission.
if (err) {
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1766,7 +1766,6 @@ bfad_read_firmware(struct pci_dev *pdev,
@@ -1762,7 +1762,6 @@ bfad_read_firmware(struct pci_dev *pdev,
const struct firmware *fw;
if (request_firmware(&fw, fw_name, &pdev->dev)) {
@ -1930,7 +1930,7 @@ upstream submission.
}
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3995,10 +3995,8 @@ static ssize_t ipr_store_update_fw(struc
@@ -4004,10 +4004,8 @@ static ssize_t ipr_store_update_fw(struc
len = snprintf(fname, 99, "%s", buf);
fname[len-1] = '\0';
@ -1968,21 +1968,21 @@ upstream submission.
}
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -5363,8 +5363,6 @@ qla2x00_load_risc(scsi_qla_host_t *vha,
@@ -5414,8 +5414,6 @@ qla2x00_load_risc(scsi_qla_host_t *vha,
/* Load firmware blob. */
blob = qla2x00_request_firmware(vha);
if (!blob) {
- ql_log(ql_log_info, vha, 0x0083,
- "Fimware image unavailable.\n");
- "Firmware image unavailable.\n");
ql_log(ql_log_info, vha, 0x0084,
"Firmware images can be retrieved from: "QLA_FW_URL ".\n");
return QLA_FUNCTION_FAILED;
@@ -5466,8 +5464,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *
@@ -5517,8 +5515,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *
/* Load firmware blob. */
blob = qla2x00_request_firmware(vha);
if (!blob) {
- ql_log(ql_log_warn, vha, 0x0090,
- "Fimware image unavailable.\n");
- "Firmware image unavailable.\n");
ql_log(ql_log_warn, vha, 0x0091,
"Firmware images can be retrieved from: "
QLA_FW_URL ".\n");
@ -2029,18 +2029,20 @@ upstream submission.
fw->size, fwname);
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -2131,16 +2131,12 @@ struct net_device *init_ft1000_card(stru
@@ -2034,18 +2034,12 @@ struct net_device *init_ft1000_card(stru
info->AsicID = ft1000_read_reg(dev, FT1000_REG_ASIC_ID);
if (info->AsicID == ELECTRABUZZ_ID) {
pr_debug("ELECTRABUZZ ASIC\n");
- if (request_firmware(&fw_entry, "ft1000.img", &link->dev) != 0) {
- if (request_firmware(&fw_entry, "ft1000.img",
- &link->dev) != 0) {
- pr_info("Could not open ft1000.img\n");
+ if (request_firmware(&fw_entry, "ft1000.img", &link->dev) != 0)
goto err_unreg;
- }
} else {
pr_debug("MAGNEMITE ASIC\n");
- if (request_firmware(&fw_entry, "ft2000.img", &link->dev) != 0) {
- if (request_firmware(&fw_entry, "ft2000.img",
- &link->dev) != 0) {
- pr_info("Could not open ft2000.img\n");
+ if (request_firmware(&fw_entry, "ft2000.img", &link->dev) != 0)
goto err_unreg;
@ -2055,7 +2057,7 @@ upstream submission.
ret = request_firmware(&dsp_fw, "ft3000.img", &dev->dev);
- if (ret < 0) {
- pr_err("Error request_firmware()\n");
- dev_err(interface->usb_dev, "Error request_firmware()\n");
+ if (ret)
goto err_fw;
- }
@ -2159,7 +2161,7 @@ upstream submission.
MODULE_FIRMWARE("rtlwifi/rtl8712u.bin");
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -393,11 +393,8 @@ static int slic_card_download_gbrcv(stru
@@ -391,11 +391,8 @@ static int slic_card_download_gbrcv(stru
}
ret = request_firmware(&fw, file, &adapter->pcidev->dev);
@ -2172,7 +2174,7 @@ upstream submission.
rcvucodelen = *(u32 *)(fw->data + index);
index += 4;
@@ -471,11 +468,8 @@ static int slic_card_download(struct ada
@@ -469,11 +466,8 @@ static int slic_card_download(struct ada
return -ENOENT;
}
ret = request_firmware(&fw, file, &adapter->pcidev->dev);
@ -2592,7 +2594,7 @@ upstream submission.
return err;
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -887,12 +887,8 @@ static int snd_emu10k1_emu1010_init(stru
@@ -901,12 +901,8 @@ static int snd_emu10k1_emu1010_init(stru
}
err = request_firmware(&emu->firmware, filename, &emu->pci->dev);
@ -2608,7 +2610,7 @@ upstream submission.
filename, emu->firmware->size);
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1636,10 +1636,8 @@ static void azx_firmware_cb(const struct
@@ -1614,10 +1614,8 @@ static void azx_firmware_cb(const struct
struct azx *chip = card->private_data;
struct pci_dev *pci = chip->pci;

View File

@ -1,51 +0,0 @@
From: "Eric W. Biederman" <ebiederm@xmission.com>
Date: Thu, 2 Apr 2015 16:35:48 -0500
Subject: fs_pin: Allow for the possibility that m_list or s_list go unused.
Origin: https://git.kernel.org/linus/820f9f147dcce2602eefd9b575bbbd9ea14f0953
This is needed to support lazily umounting locked mounts. Because the
entire unmounted subtree needs to stay together until there are no
users with references to any part of the subtree.
To support this guarantee that the fs_pin m_list and s_list nodes
are initialized by initializing them in init_fs_pin allowing
for the possibility that pin_insert_group does not touch them.
Further use hlist_del_init in pin_remove so that there is
a hlist_unhashed test before the list we attempt to update
the previous list item.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
fs/fs_pin.c | 4 ++--
include/linux/fs_pin.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/fs_pin.c b/fs/fs_pin.c
index b06c987..611b540 100644
--- a/fs/fs_pin.c
+++ b/fs/fs_pin.c
@@ -9,8 +9,8 @@ static DEFINE_SPINLOCK(pin_lock);
void pin_remove(struct fs_pin *pin)
{
spin_lock(&pin_lock);
- hlist_del(&pin->m_list);
- hlist_del(&pin->s_list);
+ hlist_del_init(&pin->m_list);
+ hlist_del_init(&pin->s_list);
spin_unlock(&pin_lock);
spin_lock_irq(&pin->wait.lock);
pin->done = 1;
diff --git a/include/linux/fs_pin.h b/include/linux/fs_pin.h
index 9dc4e03..3886b3b 100644
--- a/include/linux/fs_pin.h
+++ b/include/linux/fs_pin.h
@@ -13,6 +13,8 @@ struct vfsmount;
static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *))
{
init_waitqueue_head(&p->wait);
+ INIT_HLIST_NODE(&p->s_list);
+ INIT_HLIST_NODE(&p->m_list);
p->kill = kill;
}

View File

@ -1,29 +0,0 @@
From: "David S. Miller" <davem@davemloft.net>
Date: Fri, 1 May 2015 22:02:47 -0400
Subject: ipv4: Missing sk_nulls_node_init() in ping_unhash().
Origin: https://git.kernel.org/linus/a134f083e79fb4c3d0a925691e732c56911b4326
If we don't do that, then the poison value is left in the ->pprev
backlink.
This can cause crashes if we do a disconnect, followed by a connect().
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Wen Xu <hotdog3645@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/ping.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index a93f260..05ff44b 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -158,6 +158,7 @@ void ping_unhash(struct sock *sk)
if (sk_hashed(sk)) {
write_lock_bh(&ping_table.lock);
hlist_nulls_del(&sk->sk_nulls_node);
+ sk_nulls_node_init(&sk->sk_nulls_node);
sock_put(sk);
isk->inet_num = 0;
isk->inet_sport = 0;

View File

@ -1,44 +0,0 @@
From: "Eric W. Biederman" <ebiederm@xmission.com>
Date: Wed, 7 Jan 2015 14:28:26 -0600
Subject: mnt: Fail collect_mounts when applied to unmounted mounts
Origin: https://git.kernel.org/linus/cd4a40174b71acd021877341684d8bb1dc8ea4ae
The only users of collect_mounts are in audit_tree.c
In audit_trim_trees and audit_add_tree_rule the path passed into
collect_mounts is generated from kern_path passed an audit_tree
pathname which is guaranteed to be an absolute path. In those cases
collect_mounts is obviously intended to work on mounted paths and
if a race results in paths that are unmounted when collect_mounts
it is reasonable to fail early.
The paths passed into audit_tag_tree don't have the absolute path
check. But are used to play with fsnotify and otherwise interact with
the audit_trees, so again operating only on mounted paths appears
reasonable.
Avoid having to worry about what happens when we try and audit
unmounted filesystems by restricting collect_mounts to mounts
that appear in the mount tree.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
fs/namespace.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1709,8 +1709,11 @@ struct vfsmount *collect_mounts(struct p
{
struct mount *tree;
namespace_lock();
- tree = copy_tree(real_mount(path->mnt), path->dentry,
- CL_COPY_ALL | CL_PRIVATE);
+ if (!check_mnt(real_mount(path->mnt)))
+ tree = ERR_PTR(-EINVAL);
+ else
+ tree = copy_tree(real_mount(path->mnt), path->dentry,
+ CL_COPY_ALL | CL_PRIVATE);
namespace_unlock();
if (IS_ERR(tree))
return ERR_CAST(tree);

View File

@ -1,34 +0,0 @@
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Fri, 8 May 2015 22:53:15 -0400
Subject: path_openat(): fix double fput()
Origin: https://git.kernel.org/linus/f15133df088ecadd141ea1907f2c96df67c729f0
path_openat() jumps to the wrong place after do_tmpfile() - it has
already done path_cleanup() (as part of path_lookupat() called by
do_tmpfile()), so doing that again can lead to double fput().
Cc: stable@vger.kernel.org # v3.11+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/namei.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3228,7 +3228,7 @@ static struct file *path_openat(int dfd,
if (unlikely(file->f_flags & __O_TMPFILE)) {
error = do_tmpfile(dfd, pathname, nd, flags, op, file, &opened);
- goto out;
+ goto out2;
}
error = path_init(dfd, pathname->name, flags, nd);
@@ -3258,6 +3258,7 @@ static struct file *path_openat(int dfd,
}
out:
path_cleanup(nd);
+out2:
if (!(opened & FILE_OPENED)) {
BUG_ON(!error);
put_filp(file);

View File

@ -15,7 +15,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
---
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -86,6 +86,11 @@
@@ -87,6 +87,11 @@
#define CREATE_TRACE_POINTS
#include <trace/events/task.h>
@ -26,8 +26,8 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
+#endif
/*
* Protected counters by write_lock_irq(&tasklist_lock)
@@ -1195,6 +1200,10 @@ static struct task_struct *copy_process(
* Minimum number of threads to boot the kernel
@@ -1252,6 +1257,10 @@ static struct task_struct *copy_process(
if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS))
return ERR_PTR(-EINVAL);
@ -38,7 +38,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
/*
* Thread groups must share signals as well, and detached threads
* can only be started up within the thread group.
@@ -1890,6 +1899,12 @@ SYSCALL_DEFINE1(unshare, unsigned long,
@@ -1944,6 +1953,12 @@ SYSCALL_DEFINE1(unshare, unsigned long,
if (unshare_flags & CLONE_NEWNS)
unshare_flags |= CLONE_FS;
@ -53,7 +53,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
goto bad_unshare_out;
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -103,6 +103,9 @@ extern int core_uses_pid;
@@ -102,6 +102,9 @@ extern int core_uses_pid;
extern char core_pattern[];
extern unsigned int core_pipe_limit;
#endif
@ -63,7 +63,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
extern int pid_max;
extern int pid_max_min, pid_max_max;
extern int percpu_pagelist_fraction;
@@ -490,6 +493,15 @@ static struct ctl_table kern_table[] = {
@@ -489,6 +492,15 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec,
},

View File

@ -27,8 +27,8 @@ index 6bf8e87..2f6db83 100644
-include $(objtree)/.config
include scripts/Kbuild.include
-include $(srctree)/$(obj)/Makefile
+-include $(srctree)/$(obj)/Makefile
-include $(src)/Makefile
+-include $(src)/Makefile
include scripts/Makefile.host

View File

@ -9,7 +9,7 @@ are set.
--- a/Makefile
+++ b/Makefile
@@ -973,7 +973,7 @@ endif
@@ -980,7 +980,7 @@ endif
prepare2: prepare3 outputmakefile asm-generic
prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
@ -18,7 +18,7 @@ are set.
$(cmd_crmodverdir)
archprepare: archheaders archscripts prepare1 scripts_basic
@@ -1005,13 +1005,26 @@ define filechk_version.h
@@ -1012,6 +1012,16 @@ define filechk_version.h
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef
@ -35,7 +35,7 @@ are set.
$(version_h): $(srctree)/Makefile FORCE
$(call filechk,version.h)
$(Q)rm -f $(old_version_h)
@@ -1019,6 +1029,9 @@ $(version_h): $(srctree)/Makefile FORCE
include/generated/utsrelease.h: include/config/kernel.release FORCE
$(call filechk,utsrelease.h)
@ -114,14 +114,14 @@ are set.
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -46,6 +46,7 @@
#include <linux/irq_work.h>
#include <linux/utsname.h>
#include <linux/ctype.h>
#include <linux/uio.h>
+#include <generated/package.h>
#include <asm/uaccess.h>
@@ -3034,11 +3035,12 @@ void __init dump_stack_set_arch_desc(con
@@ -3036,11 +3037,12 @@ void __init dump_stack_set_arch_desc(con
*/
void dump_stack_print_info(const char *log_lvl)
{

View File

@ -80,7 +80,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
struct stat tmpstat;
setlocale(LC_ALL, "");
@@ -668,16 +688,18 @@ int main(int ac, char **av)
@@ -672,16 +692,18 @@ int main(int ac, char **av)
input_mode = silentoldconfig;
/* fall through */
case oldconfig:
@ -105,7 +105,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -732,6 +732,14 @@ next_menu:
@@ -738,6 +738,14 @@ next_menu:
return 0;
}
@ -120,7 +120,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
int conf_write(const char *name)
{
FILE *out;
@@ -1164,7 +1172,10 @@ bool conf_set_all_new_symbols(enum conf_
@@ -1170,7 +1178,10 @@ bool conf_set_all_new_symbols(enum conf_
bool has_changed = false;
for_all_symbols(i, sym) {
@ -145,11 +145,11 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -7,6 +7,7 @@ P(conf_read_simple,int,(const char *name
P(conf_write_defconfig,int,(const char *name));
P(conf_write,int,(const char *name));
P(conf_write_autoconf,int,(void));
+P(conf_write_new_symbol, void,(FILE*, struct symbol*, bool));
P(conf_get_changed,bool,(void));
P(conf_set_changed_callback, void,(void (*fn)(void)));
P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap)));
@@ -7,6 +7,7 @@ int conf_read_simple(const char *name, i
int conf_write_defconfig(const char *name);
int conf_write(const char *name);
int conf_write_autoconf(void);
+void conf_write_new_symbol(FILE*, struct symbol*, bool);
bool conf_get_changed(void);
void conf_set_changed_callback(void (*fn)(void));
void conf_set_message_callback(void (*fn)(const char *fmt, va_list ap));

View File

@ -28,7 +28,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -3397,6 +3397,10 @@ bytes respectively. Such letter suffixes
@@ -3516,6 +3516,10 @@ bytes respectively. Such letter suffixes
switches= [HW,M68k]
@ -41,7 +41,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
on older distributions. When this option is enabled
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2455,6 +2455,14 @@ config X86_X32
@@ -2540,6 +2540,14 @@ config X86_X32
elf32_x86_64 support enabled to compile a kernel with this
option set.
@ -82,7 +82,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
# error "The following code assumes __USER32_DS == __USER_DS"
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -414,8 +414,12 @@ system_call_fastpath:
@@ -252,8 +252,12 @@ system_call_fastpath:
#if __SYSCALL_MASK == ~0
cmpq $__NR_syscall_max,%rax
#else
@ -95,9 +95,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+ .byte P6_NOP4
+system_call_fast_compare_end:
#endif
ja ret_from_sys_call /* and return regs->ax */
ja 1f /* return -ENOSYS (already in pt_regs->ax) */
movq %r10,%rcx
@@ -520,8 +524,12 @@ tracesys_phase2:
@@ -337,8 +341,12 @@ tracesys_phase2:
#if __SYSCALL_MASK == ~0
cmpq $__NR_syscall_max,%rax
#else
@ -110,12 +110,12 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+ .byte P6_NOP4
+system_call_trace_compare_end:
#endif
ja int_ret_from_sys_call /* RAX(%rsp) is already set */
ja 1f /* return -ENOSYS (already in pt_regs->ax) */
movq %r10,%rcx /* fixup for C */
@@ -593,6 +601,16 @@ int_restore_rest:
CFI_ENDPROC
@@ -488,6 +496,16 @@ opportunistic_sysret_failed:
END(system_call)
+#if __SYSCALL_MASK != ~0
+ /* This replaces the usual comparisons if syscall.x32 is set */
+ .globl system_call_mask_compare

View File

@ -10,19 +10,19 @@ we fail to detect.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
arch/x86/mm/memtest.c | 2 ++
mm/memtest.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
index 92faf3a..ac6bdaa 100644
--- a/arch/x86/mm/memtest.c
+++ b/arch/x86/mm/memtest.c
@@ -30,6 +30,8 @@ static u64 patterns[] __initdata = {
--- a/mm/memtest.c
+++ b/mm/memtest.c
@@ -31,6 +31,10 @@ static u64 patterns[] __initdata = {
static void __init reserve_bad_mem(u64 pattern, u64 start_bad, u64 end_bad)
static void __init reserve_bad_mem(u64 pattern, phys_addr_t start_bad, phys_addr_t end_bad)
{
+#ifdef CONFIG_X86
+ WARN_ONCE(1, "Bad RAM detected. Use memtest86+ to perform a thorough test\n"
+ "and the memmap= parameter to reserve the bad areas.");
+#endif
printk(KERN_INFO " %016llx bad mem addr %010llx - %010llx reserved\n",
(unsigned long long) pattern,
(unsigned long long) start_bad,

View File

@ -59,12 +59,7 @@ bugfix/all/aic94xx-remove-broken-fallback-for-missing-ctrl-a.patch
bugfix/all/rtsx_usb_ms-use-msleep_interruptible-in-polling-loop.patch
bugfix/all/net-mv643xx-disable-tso-by-default.patch
bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch
bugfix/all/ext4-allocate-entire-range-in-zero-range.patch
debian/emmc-don-t-initialize-partitions-on-rpmb-flagged-areas.patch
# Miscellaneous features
features/all/efi-autoload-efi-pstore.patch
bugfix/all/ipv4-missing-sk_nulls_node_init-in-ping_unhash.patch
bugfix/all/path_openat-fix-double-fput.patch
bugfix/all/mnt-fail-collect_mounts-when-applied-to-unmounted-mo.patch
bugfix/all/fs_pin-allow-for-the-possibility-that-m_list-or-s_li.patch