This is a note to let you know that I've just added the patch titled
bonding: fix the err path for dev hwaddr sync in bond_enslave
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
bonding-fix-the-err-path-for-dev-hwaddr-sync-in-bond_enslave.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Wed Apr 11 10:26:56 CEST 2018
From: Xin Long <lucien.xin(a)gmail.com>
Date: Mon, 26 Mar 2018 01:16:45 +0800
Subject: bonding: fix the err path for dev hwaddr sync in bond_enslave
From: Xin Long <lucien.xin(a)gmail.com>
[ Upstream commit 5c78f6bfae2b10ff70e21d343e64584ea6280c26 ]
vlan_vids_add_by_dev is called right after dev hwaddr sync, so on
the err path it should unsync dev hwaddr. Otherwise, the slave
dev's hwaddr will never be unsync when this err happens.
Fixes: 1ff412ad7714 ("bonding: change the bond's vlan syncing functions with the standard ones")
Signed-off-by: Xin Long <lucien.xin(a)gmail.com>
Reviewed-by: Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
Acked-by: Andy Gospodarek <andy(a)greyhouse.net>
Signed-off-by: David S. Miller <davem(a)davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/net/bonding/bond_main.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1561,7 +1561,7 @@ int bond_enslave(struct net_device *bond
if (res) {
netdev_err(bond_dev, "Couldn't add bond vlan ids to %s\n",
slave_dev->name);
- goto err_close;
+ goto err_hwaddr_unsync;
}
prev_slave = bond_last_slave(bond);
@@ -1749,9 +1749,6 @@ err_unregister:
netdev_rx_handler_unregister(slave_dev);
err_detach:
- if (!bond_uses_primary(bond))
- bond_hw_addr_flush(bond_dev, slave_dev);
-
vlan_vids_del_by_dev(slave_dev, bond_dev);
if (rcu_access_pointer(bond->primary_slave) == new_slave)
RCU_INIT_POINTER(bond->primary_slave, NULL);
@@ -1765,6 +1762,10 @@ err_detach:
synchronize_rcu();
slave_disable_netpoll(new_slave);
+err_hwaddr_unsync:
+ if (!bond_uses_primary(bond))
+ bond_hw_addr_flush(bond_dev, slave_dev);
+
err_close:
slave_dev->priv_flags &= ~IFF_BONDING;
dev_close(slave_dev);
Patches currently in stable-queue which might be from lucien.xin(a)gmail.com are
queue-4.9/team-move-dev_mc_sync-after-master_upper_dev_link-in-team_port_add.patch
queue-4.9/bonding-process-the-err-returned-by-dev_set_allmulti-properly-in-bond_enslave.patch
queue-4.9/bonding-fix-the-err-path-for-dev-hwaddr-sync-in-bond_enslave.patch
queue-4.9/bonding-move-dev_mc_sync-after-master_upper_dev_link-in-bond_enslave.patch
queue-4.9/route-check-sysctl_fib_multipath_use_neigh-earlier-than-hash.patch
queue-4.9/sctp-fix-recursive-locking-warning-in-sctp_do_peeloff.patch
This is a note to let you know that I've just added the patch titled
arp: fix arp_filter on l3slave devices
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
arp-fix-arp_filter-on-l3slave-devices.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Wed Apr 11 10:26:56 CEST 2018
From: Miguel Fadon Perlines <mfadon(a)teldat.com>
Date: Thu, 5 Apr 2018 10:25:38 +0200
Subject: arp: fix arp_filter on l3slave devices
From: Miguel Fadon Perlines <mfadon(a)teldat.com>
[ Upstream commit 58b35f27689b5eb514fc293c332966c226b1b6e4 ]
arp_filter performs an ip_route_output search for arp source address and
checks if output device is the same where the arp request was received,
if it is not, the arp request is not answered.
This route lookup is always done on main route table so l3slave devices
never find the proper route and arp is not answered.
Passing l3mdev_master_ifindex_rcu(dev) return value as oif fixes the
lookup for l3slave devices while maintaining same behavior for non
l3slave devices as this function returns 0 in that case.
Fixes: 613d09b30f8b ("net: Use VRF device index for lookups on TX")
Signed-off-by: Miguel Fadon Perlines <mfadon(a)teldat.com>
Acked-by: David Ahern <dsa(a)cumulusnetworks.com>
Signed-off-by: David S. Miller <davem(a)davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
net/ipv4/arp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -437,7 +437,7 @@ static int arp_filter(__be32 sip, __be32
/*unsigned long now; */
struct net *net = dev_net(dev);
- rt = ip_route_output(net, sip, tip, 0, 0);
+ rt = ip_route_output(net, sip, tip, 0, l3mdev_master_ifindex_rcu(dev));
if (IS_ERR(rt))
return 1;
if (rt->dst.dev != dev) {
Patches currently in stable-queue which might be from mfadon(a)teldat.com are
queue-4.9/arp-fix-arp_filter-on-l3slave-devices.patch
On Tue, Apr 10, 2018 at 7:44 PM Wang Long <wanglong19(a)meituan.com> wrote:
> > Hi,
> >
> > [This is an automated email]
> >
> > This commit has been processed by the -stable helper bot and determined
> > to be a high probability candidate for -stable trees. (score: 44.5575)
> >
> > The bot has tested the following trees: v4.16.1, v4.15.16, v4.14.33,
v4.9.93, v4.4.127.
> >
> > v4.16.1: Build OK!
> > v4.15.16: Build OK!
> > v4.14.33: Build OK!
> > v4.9.93: Build OK!
> > v4.4.127: Failed to apply! Possible dependencies:
> > 62cccb8c8e7a ("mm: simplify lock_page_memcg()")
> Hi Sasha,
> I test the memory cgroup in lts v4.4, for this issue, 62cccb8c8e7a ("mm:
> simplify lock_page_memcg()")
> need to adjust and there are several other places that need to be fixed.
> I will make the patch for lts v4.4 if no one did.
I'm testing a 4.4-stable patch right now. ETA is a few hours.
lock_page_memcg()/unlock_page_memcg() use spin_lock_irqsave/restore() if
the page's memcg is undergoing move accounting, which occurs when a
process leaves its memcg for a new one that has
memory.move_charge_at_immigrate set.
unlocked_inode_to_wb_begin,end() use spin_lock_irq/spin_unlock_irq() if the
given inode is switching writeback domains. Switches occur when enough
writes are issued from a new domain.
This existing pattern is thus suspicious:
lock_page_memcg(page);
unlocked_inode_to_wb_begin(inode, &locked);
...
unlocked_inode_to_wb_end(inode, locked);
unlock_page_memcg(page);
If both inode switch and process memcg migration are both in-flight then
unlocked_inode_to_wb_end() will unconditionally enable interrupts while
still holding the lock_page_memcg() irq spinlock. This suggests the
possibility of deadlock if an interrupt occurs before
unlock_page_memcg().
truncate
__cancel_dirty_page
lock_page_memcg
unlocked_inode_to_wb_begin
unlocked_inode_to_wb_end
<interrupts mistakenly enabled>
<interrupt>
end_page_writeback
test_clear_page_writeback
lock_page_memcg
<deadlock>
unlock_page_memcg
Due to configuration limitations this deadlock is not currently possible
because we don't mix cgroup writeback (a cgroupv2 feature) and
memory.move_charge_at_immigrate (a cgroupv1 feature).
If the kernel is hacked to always claim inode switching and memcg
moving_account, then this script triggers lockup in less than a minute:
cd /mnt/cgroup/memory
mkdir a b
echo 1 > a/memory.move_charge_at_immigrate
echo 1 > b/memory.move_charge_at_immigrate
(
echo $BASHPID > a/cgroup.procs
while true; do
dd if=/dev/zero of=/mnt/big bs=1M count=256
done
) &
while true; do
sync
done &
sleep 1h &
SLEEP=$!
while true; do
echo $SLEEP > a/cgroup.procs
echo $SLEEP > b/cgroup.procs
done
The deadlock does not seem possible, so it's debatable if there's
any reason to modify the kernel. I suggest we should to prevent future
surprises. And Wang Long said "this deadlock occurs three times in our
environment", so there's more reason to apply this, even to stable.
Stable 4.4 has minor conflicts applying this patch.
For a clean 4.4 patch see "[PATCH for-4.4] writeback: safer lock nesting"
https://lkml.org/lkml/2018/4/11/146
Fixes: 682aa8e1a6a1 ("writeback: implement unlocked_inode_to_wb transaction and use it for stat updates")
Cc: stable(a)vger.kernel.org # v4.2+
Reported-by: Wang Long <wanglong19(a)meituan.com>
Signed-off-by: Greg Thelen <gthelen(a)google.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Acked-by: Wang Long <wanglong19(a)meituan.com>
---
Changelog since v3:
- initialize wb_lock_cookie wiht {} rather than {0}.
- comment grammar fix
- commit log footer cleanup (-Change-Id, +Fixes, +Acks, +stable), though patch
does not cleanly apply to 4.4. I'll post a 4.4-stable specific patch.
Changelog since v2:
- explicitly initialize wb_lock_cookie to silence compiler warnings.
Changelog since v1:
- add wb_lock_cookie to record lock context.
fs/fs-writeback.c | 7 ++++---
include/linux/backing-dev-defs.h | 5 +++++
include/linux/backing-dev.h | 31 +++++++++++++++++--------------
mm/page-writeback.c | 18 +++++++++---------
4 files changed, 35 insertions(+), 26 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 1280f915079b..b1178acfcb08 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -745,11 +745,12 @@ int inode_congested(struct inode *inode, int cong_bits)
*/
if (inode && inode_to_wb_is_valid(inode)) {
struct bdi_writeback *wb;
- bool locked, congested;
+ struct wb_lock_cookie lock_cookie = {};
+ bool congested;
- wb = unlocked_inode_to_wb_begin(inode, &locked);
+ wb = unlocked_inode_to_wb_begin(inode, &lock_cookie);
congested = wb_congested(wb, cong_bits);
- unlocked_inode_to_wb_end(inode, locked);
+ unlocked_inode_to_wb_end(inode, &lock_cookie);
return congested;
}
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index bfe86b54f6c1..0bd432a4d7bd 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -223,6 +223,11 @@ static inline void set_bdi_congested(struct backing_dev_info *bdi, int sync)
set_wb_congested(bdi->wb.congested, sync);
}
+struct wb_lock_cookie {
+ bool locked;
+ unsigned long flags;
+};
+
#ifdef CONFIG_CGROUP_WRITEBACK
/**
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 3e4ce54d84ab..96f4a3ddfb81 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -346,7 +346,7 @@ static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
/**
* unlocked_inode_to_wb_begin - begin unlocked inode wb access transaction
* @inode: target inode
- * @lockedp: temp bool output param, to be passed to the end function
+ * @cookie: output param, to be passed to the end function
*
* The caller wants to access the wb associated with @inode but isn't
* holding inode->i_lock, mapping->tree_lock or wb->list_lock. This
@@ -354,12 +354,12 @@ static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
* association doesn't change until the transaction is finished with
* unlocked_inode_to_wb_end().
*
- * The caller must call unlocked_inode_to_wb_end() with *@lockdep
- * afterwards and can't sleep during transaction. IRQ may or may not be
- * disabled on return.
+ * The caller must call unlocked_inode_to_wb_end() with *@cookie afterwards and
+ * can't sleep during the transaction. IRQs may or may not be disabled on
+ * return.
*/
static inline struct bdi_writeback *
-unlocked_inode_to_wb_begin(struct inode *inode, bool *lockedp)
+unlocked_inode_to_wb_begin(struct inode *inode, struct wb_lock_cookie *cookie)
{
rcu_read_lock();
@@ -367,10 +367,10 @@ unlocked_inode_to_wb_begin(struct inode *inode, bool *lockedp)
* Paired with store_release in inode_switch_wb_work_fn() and
* ensures that we see the new wb if we see cleared I_WB_SWITCH.
*/
- *lockedp = smp_load_acquire(&inode->i_state) & I_WB_SWITCH;
+ cookie->locked = smp_load_acquire(&inode->i_state) & I_WB_SWITCH;
- if (unlikely(*lockedp))
- spin_lock_irq(&inode->i_mapping->tree_lock);
+ if (unlikely(cookie->locked))
+ spin_lock_irqsave(&inode->i_mapping->tree_lock, cookie->flags);
/*
* Protected by either !I_WB_SWITCH + rcu_read_lock() or tree_lock.
@@ -382,12 +382,14 @@ unlocked_inode_to_wb_begin(struct inode *inode, bool *lockedp)
/**
* unlocked_inode_to_wb_end - end inode wb access transaction
* @inode: target inode
- * @locked: *@lockedp from unlocked_inode_to_wb_begin()
+ * @cookie: @cookie from unlocked_inode_to_wb_begin()
*/
-static inline void unlocked_inode_to_wb_end(struct inode *inode, bool locked)
+static inline void unlocked_inode_to_wb_end(struct inode *inode,
+ struct wb_lock_cookie *cookie)
{
- if (unlikely(locked))
- spin_unlock_irq(&inode->i_mapping->tree_lock);
+ if (unlikely(cookie->locked))
+ spin_unlock_irqrestore(&inode->i_mapping->tree_lock,
+ cookie->flags);
rcu_read_unlock();
}
@@ -434,12 +436,13 @@ static inline struct bdi_writeback *inode_to_wb(struct inode *inode)
}
static inline struct bdi_writeback *
-unlocked_inode_to_wb_begin(struct inode *inode, bool *lockedp)
+unlocked_inode_to_wb_begin(struct inode *inode, struct wb_lock_cookie *cookie)
{
return inode_to_wb(inode);
}
-static inline void unlocked_inode_to_wb_end(struct inode *inode, bool locked)
+static inline void unlocked_inode_to_wb_end(struct inode *inode,
+ struct wb_lock_cookie *cookie)
{
}
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 586f31261c83..8369572e1f7d 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2501,13 +2501,13 @@ void account_page_redirty(struct page *page)
if (mapping && mapping_cap_account_dirty(mapping)) {
struct inode *inode = mapping->host;
struct bdi_writeback *wb;
- bool locked;
+ struct wb_lock_cookie cookie = {};
- wb = unlocked_inode_to_wb_begin(inode, &locked);
+ wb = unlocked_inode_to_wb_begin(inode, &cookie);
current->nr_dirtied--;
dec_node_page_state(page, NR_DIRTIED);
dec_wb_stat(wb, WB_DIRTIED);
- unlocked_inode_to_wb_end(inode, locked);
+ unlocked_inode_to_wb_end(inode, &cookie);
}
}
EXPORT_SYMBOL(account_page_redirty);
@@ -2613,15 +2613,15 @@ void __cancel_dirty_page(struct page *page)
if (mapping_cap_account_dirty(mapping)) {
struct inode *inode = mapping->host;
struct bdi_writeback *wb;
- bool locked;
+ struct wb_lock_cookie cookie = {};
lock_page_memcg(page);
- wb = unlocked_inode_to_wb_begin(inode, &locked);
+ wb = unlocked_inode_to_wb_begin(inode, &cookie);
if (TestClearPageDirty(page))
account_page_cleaned(page, mapping, wb);
- unlocked_inode_to_wb_end(inode, locked);
+ unlocked_inode_to_wb_end(inode, &cookie);
unlock_page_memcg(page);
} else {
ClearPageDirty(page);
@@ -2653,7 +2653,7 @@ int clear_page_dirty_for_io(struct page *page)
if (mapping && mapping_cap_account_dirty(mapping)) {
struct inode *inode = mapping->host;
struct bdi_writeback *wb;
- bool locked;
+ struct wb_lock_cookie cookie = {};
/*
* Yes, Virginia, this is indeed insane.
@@ -2690,14 +2690,14 @@ int clear_page_dirty_for_io(struct page *page)
* always locked coming in here, so we get the desired
* exclusion.
*/
- wb = unlocked_inode_to_wb_begin(inode, &locked);
+ wb = unlocked_inode_to_wb_begin(inode, &cookie);
if (TestClearPageDirty(page)) {
dec_lruvec_page_state(page, NR_FILE_DIRTY);
dec_zone_page_state(page, NR_ZONE_WRITE_PENDING);
dec_wb_stat(wb, WB_RECLAIMABLE);
ret = 1;
}
- unlocked_inode_to_wb_end(inode, locked);
+ unlocked_inode_to_wb_end(inode, &cookie);
return ret;
}
return TestClearPageDirty(page);
--
2.17.0.484.g0c8726318c-goog
The patch below does not apply to the 4.4-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 82dd0d2a9a76fc8fa2b18d80b987d455728bf83a Mon Sep 17 00:00:00 2001
From: David Ahern <dsahern(a)gmail.com>
Date: Thu, 29 Mar 2018 12:49:52 -0700
Subject: [PATCH] vrf: Fix use after free and double free in vrf_finish_output
Miguel reported an skb use after free / double free in vrf_finish_output
when neigh_output returns an error. The vrf driver should return after
the call to neigh_output as it takes over the skb on error path as well.
Patch is a simplified version of Miguel's patch which was written for 4.9,
and updated to top of tree.
Fixes: 8f58336d3f78a ("net: Add ethernet header for pass through VRF device")
Signed-off-by: Miguel Fadon Perlines <mfadon(a)teldat.com>
Signed-off-by: David Ahern <dsahern(a)gmail.com>
Signed-off-by: David S. Miller <davem(a)davemloft.net>
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 139c61c8244a..ac40924fe437 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -578,12 +578,13 @@ static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *s
if (!IS_ERR(neigh)) {
sock_confirm_neigh(skb, neigh);
ret = neigh_output(neigh, skb);
+ rcu_read_unlock_bh();
+ return ret;
}
rcu_read_unlock_bh();
err:
- if (unlikely(ret < 0))
- vrf_tx_error(skb->dev, skb);
+ vrf_tx_error(skb->dev, skb);
return ret;
}
This patch set is based on v4.16. (I should have realized these issues in
v4.16-rc cycle though...)
Yoshihiro Shimoda (4):
usb: gadget: udc: renesas_usb3: fix double phy_put()
usb: gadget: udc: renesas_usb3: should remove debugfs
usb: gadget: udc: renesas_usb3: should call pm_runtime_enable() before
add udc
usb: gadget: udc: renesas_usb3: should call devm_phy_get() before add
udc
drivers/usb/gadget/udc/renesas_usb3.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
--
1.9.1
Tree/Branch: v4.4.127
Git describe: v4.4.127
Commit: 2cad7a1d13 Linux 4.4.127
Build Time: 60 min 20 sec
Passed: 7 / 10 ( 70.00 %)
Failed: 3 / 10 ( 30.00 %)
Errors: 37
Warnings: 0
Section Mismatches: 0
Failed defconfigs:
arm-allmodconfig
arm-multi_v7_defconfig
arm-multi_v5_defconfig
Errors:
arm-allmodconfig
../net/core/sock.c:724:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:922:7: error: 'SO_ATTACH_BPF' undeclared (first use in this function)
../net/core/sock.c:939:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:978:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:983:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:996:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1002:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/core/sock.c:1075:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:1233:7: error: 'SO_GET_FILTER' undeclared (first use in this function)
../net/core/sock.c:1240:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:1244:7: error: 'SO_BPF_EXTENSIONS' undeclared (first use in this function)
../net/core/sock.c:1248:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:1253:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:1258:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1262:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
Error: ../arch/arm/boot/dts/uniphier-ph1-pro4-sanji.dts:0.55-1.1 syntax error
Error: ../arch/arm/boot/dts/tegra30.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/omap4-panda.dts:10.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/emev2.dtsi:11.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
../arch/arm/boot/dts/omap3-gta04.dts:132:57: error: unterminated comment
../arch/arm/boot/dts/ccu8540.dts:13:23: fatal error: dbx5x0.dtsi: No such file or directory
Error: ../arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts:203.16-17 syntax error
Error: ../arch/arm/boot/dts/uniphier-ph1-pro4-ace.dts:0.53-1.1 syntax error
Error: ../arch/arm/boot/dts/arm-realview-eb-11mp-revb.dts:0.57-1.1 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra30.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/r8a7790.dtsi:13.1-9 syntax error
Error: ../arch/arm/boot/dts/omap4.dtsi:9.1-9 syntax error
Error: ../arch/arm/boot/dts/vf610-colibri.dts:91.5-6 syntax error
../net/sunrpc/xprtsock.c:1738:38: error: 'SO_REUSEPORT' undeclared (first use in this function)
../arch/arm/include/asm/parport.h:12:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'parport_pc_find_isa_ports'
../arch/arm/include/asm/parport.h:13:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'parport_pc_find_nonpci_ports'
../drivers/parport/parport_pc.c:3070:2: error: implicit declaration of function 'parport_pc_find_nonpci_ports' [-Werror=implicit-function-declaration]
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR: Input tree has errors, aborting (use -f to force output)
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR: Input tree has errors, aborting (use -f to force output)
ERROR (phandle_references): Reference to non-existent node or label "mainpllclk"
ERROR (phandle_references): Reference to non-existent node or label "refclksys"
ERROR (phandle_references): Reference to non-existent node or label "papllclk"
ERROR: Input tree has errors, aborting (use -f to force output)
arm-multi_v7_defconfig
../net/core/sock.c:724:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:922:7: error: 'SO_ATTACH_BPF' undeclared (first use in this function)
../net/core/sock.c:939:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:978:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:983:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:996:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1002:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/core/sock.c:1075:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:1233:7: error: 'SO_GET_FILTER' undeclared (first use in this function)
../net/core/sock.c:1240:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:1244:7: error: 'SO_BPF_EXTENSIONS' undeclared (first use in this function)
../net/core/sock.c:1248:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:1253:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:1258:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1262:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/sunrpc/xprtsock.c:1738:38: error: 'SO_REUSEPORT' undeclared (first use in this function)
arm-multi_v5_defconfig
../net/core/sock.c:724:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:922:7: error: 'SO_ATTACH_BPF' undeclared (first use in this function)
../net/core/sock.c:939:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:978:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:983:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:996:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1002:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/core/sock.c:1075:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:1233:7: error: 'SO_GET_FILTER' undeclared (first use in this function)
../net/core/sock.c:1240:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:1244:7: error: 'SO_BPF_EXTENSIONS' undeclared (first use in this function)
../net/core/sock.c:1248:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:1253:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:1258:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1262:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/sunrpc/xprtsock.c:1738:38: error: 'SO_REUSEPORT' undeclared (first use in this function)
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
-------------------------------------------------------------------------------
Errors summary: 37
5 Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
5 ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
3 ERROR: Input tree has errors, aborting (use -f to force output)
3 ../net/sunrpc/xprtsock.c:1738:38: error: 'SO_REUSEPORT' undeclared (first use in this function)
3 ../net/core/sock.c:996:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
3 ../net/core/sock.c:983:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
3 ../net/core/sock.c:978:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
3 ../net/core/sock.c:939:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
3 ../net/core/sock.c:922:7: error: 'SO_ATTACH_BPF' undeclared (first use in this function)
3 ../net/core/sock.c:724:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
3 ../net/core/sock.c:1262:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
3 ../net/core/sock.c:1258:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
3 ../net/core/sock.c:1253:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
3 ../net/core/sock.c:1248:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
3 ../net/core/sock.c:1244:7: error: 'SO_BPF_EXTENSIONS' undeclared (first use in this function)
3 ../net/core/sock.c:1240:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
3 ../net/core/sock.c:1233:7: error: 'SO_GET_FILTER' undeclared (first use in this function)
3 ../net/core/sock.c:1075:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
3 ../net/core/sock.c:1002:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
2 Error: ../arch/arm/boot/dts/tegra30.dtsi:1.1-9 syntax error
1 Error: ../arch/arm/boot/dts/vf610-colibri.dts:91.5-6 syntax error
1 Error: ../arch/arm/boot/dts/uniphier-ph1-pro4-sanji.dts:0.55-1.1 syntax error
1 Error: ../arch/arm/boot/dts/uniphier-ph1-pro4-ace.dts:0.53-1.1 syntax error
1 Error: ../arch/arm/boot/dts/r8a7790.dtsi:13.1-9 syntax error
1 Error: ../arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts:203.16-17 syntax error
1 Error: ../arch/arm/boot/dts/omap4.dtsi:9.1-9 syntax error
1 Error: ../arch/arm/boot/dts/omap4-panda.dts:10.1-9 syntax error
1 Error: ../arch/arm/boot/dts/emev2.dtsi:11.1-9 syntax error
1 Error: ../arch/arm/boot/dts/arm-realview-eb-11mp-revb.dts:0.57-1.1 syntax error
1 ERROR (phandle_references): Reference to non-existent node or label "refclksys"
1 ERROR (phandle_references): Reference to non-existent node or label "papllclk"
1 ERROR (phandle_references): Reference to non-existent node or label "mainpllclk"
1 ../drivers/parport/parport_pc.c:3070:2: error: implicit declaration of function 'parport_pc_find_nonpci_ports' [-Werror=implicit-function-declaration]
1 ../arch/arm/include/asm/parport.h:13:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'parport_pc_find_nonpci_ports'
1 ../arch/arm/include/asm/parport.h:12:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'parport_pc_find_isa_ports'
1 ../arch/arm/boot/dts/omap3-gta04.dts:132:57: error: unterminated comment
1 ../arch/arm/boot/dts/ccu8540.dts:13:23: fatal error: dbx5x0.dtsi: No such file or directory
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm-allmodconfig : FAIL, 48 errors, 0 warnings, 0 section mismatches
Errors:
../net/core/sock.c:724:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:922:7: error: 'SO_ATTACH_BPF' undeclared (first use in this function)
../net/core/sock.c:939:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:978:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:983:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:996:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1002:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/core/sock.c:1075:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:1233:7: error: 'SO_GET_FILTER' undeclared (first use in this function)
../net/core/sock.c:1240:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:1244:7: error: 'SO_BPF_EXTENSIONS' undeclared (first use in this function)
../net/core/sock.c:1248:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:1253:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:1258:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1262:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
Error: ../arch/arm/boot/dts/uniphier-ph1-pro4-sanji.dts:0.55-1.1 syntax error
Error: ../arch/arm/boot/dts/tegra30.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/omap4-panda.dts:10.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/emev2.dtsi:11.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
../arch/arm/boot/dts/omap3-gta04.dts:132:57: error: unterminated comment
../arch/arm/boot/dts/ccu8540.dts:13:23: fatal error: dbx5x0.dtsi: No such file or directory
Error: ../arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts:203.16-17 syntax error
Error: ../arch/arm/boot/dts/uniphier-ph1-pro4-ace.dts:0.53-1.1 syntax error
Error: ../arch/arm/boot/dts/arm-realview-eb-11mp-revb.dts:0.57-1.1 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra30.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/tegra20.dtsi:1.1-9 syntax error
Error: ../arch/arm/boot/dts/r8a7790.dtsi:13.1-9 syntax error
Error: ../arch/arm/boot/dts/omap4.dtsi:9.1-9 syntax error
Error: ../arch/arm/boot/dts/vf610-colibri.dts:91.5-6 syntax error
../net/sunrpc/xprtsock.c:1738:38: error: 'SO_REUSEPORT' undeclared (first use in this function)
../arch/arm/include/asm/parport.h:12:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'parport_pc_find_isa_ports'
../arch/arm/include/asm/parport.h:13:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'parport_pc_find_nonpci_ports'
../drivers/parport/parport_pc.c:3070:2: error: implicit declaration of function 'parport_pc_find_nonpci_ports' [-Werror=implicit-function-declaration]
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR: Input tree has errors, aborting (use -f to force output)
ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
ERROR: Input tree has errors, aborting (use -f to force output)
ERROR (phandle_references): Reference to non-existent node or label "mainpllclk"
ERROR (phandle_references): Reference to non-existent node or label "refclksys"
ERROR (phandle_references): Reference to non-existent node or label "papllclk"
ERROR: Input tree has errors, aborting (use -f to force output)
-------------------------------------------------------------------------------
arm-multi_v7_defconfig : FAIL, 16 errors, 0 warnings, 0 section mismatches
Errors:
../net/core/sock.c:724:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:922:7: error: 'SO_ATTACH_BPF' undeclared (first use in this function)
../net/core/sock.c:939:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:978:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:983:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:996:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1002:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/core/sock.c:1075:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:1233:7: error: 'SO_GET_FILTER' undeclared (first use in this function)
../net/core/sock.c:1240:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:1244:7: error: 'SO_BPF_EXTENSIONS' undeclared (first use in this function)
../net/core/sock.c:1248:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:1253:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:1258:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1262:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/sunrpc/xprtsock.c:1738:38: error: 'SO_REUSEPORT' undeclared (first use in this function)
-------------------------------------------------------------------------------
arm-multi_v5_defconfig : FAIL, 16 errors, 0 warnings, 0 section mismatches
Errors:
../net/core/sock.c:724:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:922:7: error: 'SO_ATTACH_BPF' undeclared (first use in this function)
../net/core/sock.c:939:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:978:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:983:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:996:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1002:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/core/sock.c:1075:7: error: 'SO_REUSEPORT' undeclared (first use in this function)
../net/core/sock.c:1233:7: error: 'SO_GET_FILTER' undeclared (first use in this function)
../net/core/sock.c:1240:7: error: 'SO_LOCK_FILTER' undeclared (first use in this function)
../net/core/sock.c:1244:7: error: 'SO_BPF_EXTENSIONS' undeclared (first use in this function)
../net/core/sock.c:1248:7: error: 'SO_SELECT_ERR_QUEUE' undeclared (first use in this function)
../net/core/sock.c:1253:7: error: 'SO_BUSY_POLL' undeclared (first use in this function)
../net/core/sock.c:1258:7: error: 'SO_MAX_PACING_RATE' undeclared (first use in this function)
../net/core/sock.c:1262:7: error: 'SO_INCOMING_CPU' undeclared (first use in this function)
../net/sunrpc/xprtsock.c:1738:38: error: 'SO_REUSEPORT' undeclared (first use in this function)
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
arm64-allnoconfig
arm64-allmodconfig
x86_64-defconfig
arm-allnoconfig
x86_64-allnoconfig
x86_64-allmodconfig
arm64-defconfig
From: Matthew Wilcox <mawilcox(a)microsoft.com>
f2fs specifies the __GFP_ZERO flag for allocating some of its pages.
Unfortunately, the page cache also uses the mapping's GFP flags for
allocating radix tree nodes. It always masked off the __GFP_HIGHMEM
flag, and masks off __GFP_ZERO in some paths, but not all. That causes
radix tree nodes to be allocated with a NULL list_head, which causes
backtraces like:
[<ffffff80086f4de0>] __list_del_entry+0x30/0xd0
[<ffffff8008362018>] list_lru_del+0xac/0x1ac
[<ffffff800830f04c>] page_cache_tree_insert+0xd8/0x110
The __GFP_DMA and __GFP_DMA32 flags would also be able to sneak through
if they are ever used. Fix them all by using GFP_RECLAIM_MASK at the
innermost location, and remove it from earlier in the callchain.
Fixes: 449dd6984d0e ("mm: keep page cache radix tree nodes in check")
Reported-by: Chris Fries <cfries(a)google.com>
Debugged-by: Minchan Kim <minchan(a)kernel.org>
Signed-off-by: Matthew Wilcox <mawilcox(a)microsoft.com>
Acked-by: Johannes Weiner <hannes(a)cmpxchg.org>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Reviewed-by: Jan Kara <jack(a)suse.cz>
Cc: stable(a)vger.kernel.org
---
mm/filemap.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index c2147682f4c3..1a4bfc5ed3dc 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -785,7 +785,7 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
VM_BUG_ON_PAGE(!PageLocked(new), new);
VM_BUG_ON_PAGE(new->mapping, new);
- error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
+ error = radix_tree_preload(gfp_mask & GFP_RECLAIM_MASK);
if (!error) {
struct address_space *mapping = old->mapping;
void (*freepage)(struct page *);
@@ -841,7 +841,7 @@ static int __add_to_page_cache_locked(struct page *page,
return error;
}
- error = radix_tree_maybe_preload(gfp_mask & ~__GFP_HIGHMEM);
+ error = radix_tree_maybe_preload(gfp_mask & GFP_RECLAIM_MASK);
if (error) {
if (!huge)
mem_cgroup_cancel_charge(page, memcg, false);
@@ -1574,8 +1574,7 @@ struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset,
if (fgp_flags & FGP_ACCESSED)
__SetPageReferenced(page);
- err = add_to_page_cache_lru(page, mapping, offset,
- gfp_mask & GFP_RECLAIM_MASK);
+ err = add_to_page_cache_lru(page, mapping, offset, gfp_mask);
if (unlikely(err)) {
put_page(page);
page = NULL;
@@ -2378,7 +2377,7 @@ static int page_cache_read(struct file *file, pgoff_t offset, gfp_t gfp_mask)
if (!page)
return -ENOMEM;
- ret = add_to_page_cache_lru(page, mapping, offset, gfp_mask & GFP_KERNEL);
+ ret = add_to_page_cache_lru(page, mapping, offset, gfp_mask);
if (ret == 0)
ret = mapping->a_ops->readpage(file, page);
else if (ret == -EEXIST)
--
2.16.3
From: Andrew Morton <akpm(a)linux-foundation.org>
Subject: fs/reiserfs/journal.c: add missing resierfs_warning() arg
One use of the reiserfs_warning() macro in journal_init_dev() is missing a
parameter, causing the following warning:
REISERFS warning (device loop0): journal_init_dev: Cannot open '%s': %i journal_init_dev:
This also causes a WARN_ONCE() warning in the vsprintf code, and then a
panic if panic_on_warn is set.
Please remove unsupported %/ in format string
WARNING: CPU: 1 PID: 4480 at lib/vsprintf.c:2138 format_decode+0x77f/0x830 lib/vsprintf.c:2138
Kernel panic - not syncing: panic_on_warn set ...
Just add another string argument to the macro invocation.
Addresses https://syzkaller.appspot.com/bug?id=0627d4551fdc39bf1ef5d82cd9eef587047f77…
Link: http://lkml.kernel.org/r/d678ebe1-6f54-8090-df4c-b9affad62293@infradead.org
Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
Reported-by: <syzbot+6bd77b88c1977c03f584(a)syzkaller.appspotmail.com>
Tested-by: Randy Dunlap <rdunlap(a)infradead.org>
Acked-by: Jeff Mahoney <jeffm(a)suse.com>
Cc: Alexander Viro <viro(a)zeniv.linux.org.uk>
Cc: Jan Kara <jack(a)suse.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
fs/reiserfs/journal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN fs/reiserfs/journal.c~fs-reiserfs-journalc-add-missing-resierfs_warning-arg fs/reiserfs/journal.c
--- a/fs/reiserfs/journal.c~fs-reiserfs-journalc-add-missing-resierfs_warning-arg
+++ a/fs/reiserfs/journal.c
@@ -2643,7 +2643,7 @@ static int journal_init_dev(struct super
if (IS_ERR(journal->j_dev_bd)) {
result = PTR_ERR(journal->j_dev_bd);
journal->j_dev_bd = NULL;
- reiserfs_warning(super,
+ reiserfs_warning(super, "sh-457",
"journal_init_dev: Cannot open '%s': %i",
jdev_name, result);
return result;
_
From: Kees Cook <keescook(a)chromium.org>
Subject: task_struct: only use anon struct under randstruct plugin
The original intent for always adding the anonymous struct in task_struct
was to make sure we had compiler coverage. However, this caused
pathological padding of 40 bytes at the start of task_struct. Instead,
move the anonymous struct to being only used when struct layout
randomization is enabled.
Link: http://lkml.kernel.org/r/20180327213609.GA2964@beast
Fixes: 29e48ce87f1e ("task_struct: Allow randomized")
Signed-off-by: Kees Cook <keescook(a)chromium.org>
Reported-by: Peter Zijlstra <peterz(a)infradead.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Ingo Molnar <mingo(a)kernel.org>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
include/linux/compiler-clang.h | 3 ---
include/linux/compiler-gcc.h | 12 +++---------
2 files changed, 3 insertions(+), 12 deletions(-)
diff -puN include/linux/compiler-clang.h~task_struct-only-use-anon-struct-under-randstruct-plugin include/linux/compiler-clang.h
--- a/include/linux/compiler-clang.h~task_struct-only-use-anon-struct-under-randstruct-plugin
+++ a/include/linux/compiler-clang.h
@@ -17,9 +17,6 @@
*/
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
-#define randomized_struct_fields_start struct {
-#define randomized_struct_fields_end };
-
/* all clang versions usable with the kernel support KASAN ABI version 5 */
#define KASAN_ABI_VERSION 5
diff -puN include/linux/compiler-gcc.h~task_struct-only-use-anon-struct-under-randstruct-plugin include/linux/compiler-gcc.h
--- a/include/linux/compiler-gcc.h~task_struct-only-use-anon-struct-under-randstruct-plugin
+++ a/include/linux/compiler-gcc.h
@@ -242,6 +242,9 @@
#if defined(RANDSTRUCT_PLUGIN) && !defined(__CHECKER__)
#define __randomize_layout __attribute__((randomize_layout))
#define __no_randomize_layout __attribute__((no_randomize_layout))
+/* This anon struct can add padding, so only enable it under randstruct. */
+#define randomized_struct_fields_start struct {
+#define randomized_struct_fields_end } __randomize_layout;
#endif
#endif /* GCC_VERSION >= 40500 */
@@ -256,15 +259,6 @@
*/
#define __visible __attribute__((externally_visible))
-/*
- * RANDSTRUCT_PLUGIN wants to use an anonymous struct, but it is only
- * possible since GCC 4.6. To provide as much build testing coverage
- * as possible, this is used for all GCC 4.6+ builds, and not just on
- * RANDSTRUCT_PLUGIN builds.
- */
-#define randomized_struct_fields_start struct {
-#define randomized_struct_fields_end } __randomize_layout;
-
#endif /* GCC_VERSION >= 40600 */
_