3.2.57-rc1 review
cover 3.2.57-rc1 review
This is the start of the stable review cycle for the 3.2.57 release. There are 18 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 09 00:00:00 UTC 2014. Anything received after that time might be too late.
A combined patch relative to 3.2.56 will be posted as an additional response to this. A shortlog and diffstat can be found below.
Ben.
-------------
Anisse Astier (1):
deb-pkg: use KCONFIG_CONFIG instead of .config file directly
[d20917670ee1fd4b090555e551faea04b014ca97]
Ben Hutchings (3):
deb-pkg: Fix building for MIPS big-endian or ARM OABI
[c5e318f67eebbad491615a752c51dbfde7dc3d78]
deb-pkg: Fix cross-building linux-headers package
[f8ce239dfc7ba9add41d9ecdc5e7810738f839fa]
staging: speakup: Prefix set_mask_bits() symbol
[ca2beaf84d9678c12b17d92623f0e90829d6ca13]
Benjamin Tissoires (1):
Input: synaptics - add manual min/max quirk
[421e08c41fda1f0c2ff6af81a67b491389b653a5]
Daniel Borkmann (1):
netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages
[b22f5126a24b3b2f15448c3f2a254fc10cbc2b92]
Emil Goode (2):
net: asix: add missing flag to struct driver_info
[d43ff4cd798911736fb39025ec8004284b1b0bc2]
net: asix: handle packets crossing URB boundaries
[8b5b6f5413e97c3e8bafcdd67553d508f4f698cd]
Eric Dumazet (1):
asix: asix_rx_fixup surgery to reduce skb truesizes
[a9e0aca4b37885b5599e52211f098bd7f565e749]
Florian Westphal (2):
net: add and use skb_gso_transport_seglen()
[de960aa9ab4decc3304959f69533eef64d05d8e8]
net: ip, ipv6: handle gso skbs in forwarding path
[fe6cc55f3a9a053482a76f5a6b2257cee51b4663]
Hans de Goede (1):
Input: synaptics - add manual min/max quirk for ThinkPad X240
[8a0435d958fb36d93b8df610124a0e91e5675c82]
Jeff Layton (1):
cifs: ensure that uncached writes handle unmapped areas correctly
[5d81de8e8667da7135d3a32a964087c0faf5483f]
Konstantin Khlebnikov (1):
ipc/msg: fix race around refcount
[6062a8dc0517bce23e3c2f7d2fea5e22411269a3]
Marcelo Tosatti (2):
KVM: MMU: handle invalid root_hpa at __direct_map
[989c6b34f6a9480e397b170cc62237e89bf4fdb9]
KVM: VMX: fix use after free of vmx->loaded_vmcs
[26a865f4aa8e66a6d94958de7656f7f1b03c6c56]Martin Schwidefsky (1):
s390: fix kernel crash due to linkage stack instructions
[8d7f6690cedb83456edd41c9bd583783f0703bf0]
Theodore Ts'o (1):
ext4: atomically set inode->i_flags in ext4_set_inode_flags()
[00a1a053ebe5febcfc2ec498bd894f035ad2aa06]Makefile | 4 +- arch/s390/kernel/head64.S | 7 +- arch/x86/kvm/mmu.c | 3 + arch/x86/kvm/vmx.c | 2 +- drivers/input/mouse/synaptics.c | 55 ++++++++++ drivers/net/usb/asix.c | 174 ++++++++++++++++++-------------- drivers/staging/speakup/kobjects.c | 4 +- drivers/staging/speakup/main.c | 2 +- drivers/staging/speakup/speakup.h | 2 +- drivers/staging/speakup/varhandlers.c | 4 +- fs/cifs/file.c | 33 +++++- fs/ext4/inode.c | 15 +-- include/linux/bitops.h | 15 +++ include/linux/skbuff.h | 19 ++++ ipc/msg.c | 2 + net/core/skbuff.c | 25 +++++ net/ipv4/ip_forward.c | 68 ++++++++++++- net/ipv6/ip6_output.c | 13 ++- net/netfilter/nf_conntrack_proto_dccp.c | 6 +- scripts/package/builddeb | 22 ++-- 20 files changed, 361 insertions(+), 114 deletions(-)
Signature · 2 lines
Ben Hutchings Sturgeon's Law: Ninety percent of everything is crap.
PATCH 1/18 Input: synaptics - add manual min/max quirk
3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Tissoires <[email protected]>
commit 421e08c41fda1f0c2ff6af81a67b491389b653a5 upstream.
The new Lenovo Haswell series (-40's) contains a new Synaptics touchpad. However, these new Synaptics devices report bad axis ranges. Under Windows, it is not a problem because the Windows driver uses RMI4 over SMBus to talk to the device. Under Linux, we are using the PS/2 fallback interface and it occurs the reported ranges are wrong.
Of course, it would be too easy to have only one range for the whole series, each touchpad seems to be calibrated in a different way.
We can not use SMBus to get the actual range because I suspect the firmware will switch into the SMBus mode and stop talking through PS/2 (this is the case for hybrid HID over I2C / PS/2 Synaptics touchpads).
So as a temporary solution (until RMI4 land into upstream), start a new list of quirks with the min/max manually set.
--- drivers/input/mouse/synaptics.c | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
drivers/input/mouse/synaptics.c +47 -0
@@ -237,11 +237,22 @@ static int synaptics_identify(struct psm* Read touchpad resolution and maximum reported coordinates * Resolution is left zero if touchpad does not support the query */ + +static const int *quirk_min_max; +static int synaptics_resolution (struct psmouse *psmouse) {struct synaptics_data *priv = psmouse->private;unsigned char resp[3 ]; +if (quirk_min_max) { + priv->x_min = quirk_min_max[0 ]; + priv->x_max = quirk_min_max[1 ]; + priv->y_min = quirk_min_max[2 ]; + priv->y_max = quirk_min_max[3 ]; +return 0 ; + } +if (SYN_ID_MAJOR (priv->identity) <4 )return 0 ;
@@ -1364,10 +1375,46 @@ static const struct dmi_system_id __init { } }; +static const struct dmi_system_id min_max_dmi_table[]__initconst = { +#if defined(CONFIG_DMI) + { +/* Lenovo ThinkPad Helix */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), +DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad Helix" ), + }, + .driver_data = (int []){1024 ,5052 ,2258 ,4832 }, + }, + { +/* Lenovo ThinkPad T440s */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), +DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T440" ), + }, + .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, + }, + { +/* Lenovo ThinkPad T540p */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), +DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T540" ), + }, + .driver_data = (int []){1024 ,5056 ,2058 ,4832 }, + }, +#endif + { } +}; +void __init synaptics_module_init (void ) { +const struct dmi_system_id *min_max_dmi; + impaired_toshiba_kbc =dmi_check_system (toshiba_dmi_table); broken_olpc_ec =dmi_check_system (olpc_dmi_table); + + min_max_dmi =dmi_first_match (min_max_dmi_table); +if (min_max_dmi) + quirk_min_max = min_max_dmi->driver_data; }int synaptics_init (struct psmouse *psmouse)
PATCH 2/18 Input: synaptics - add manual min/max quirk for ThinkPad X240
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 8a0435d958fb36d93b8df610124a0e91e5675c82 upstream.
This extends Benjamin Tissoires manual min/max quirk table with support for the ThinkPad X240.
--- drivers/input/mouse/synaptics.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/input/mouse/synaptics.c +8 -0
@@ -1386,6 +1386,14 @@ static const struct dmi_system_id min_ma .driver_data = (int []){1024, 5052, 2258, 4832}, }, { +/* Lenovo ThinkPad X240 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X240"), + }, + .driver_data = (int []){1232, 5710, 1156, 4696}, + }, + {/* Lenovo ThinkPad T440s */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
PATCH 3/18 staging: speakup: Prefix set_mask_bits() symbol
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
This is part of commit ca2beaf84d96 ('staging: speakup: Prefix externally-visible symbols') upstream. It is required as preparation for commit 00a1a053ebe5 ('ext4: atomically set inode->i_flags in ext4_set_inode_flags()').
---
drivers/staging/speakup/kobjects.c +2 -2
@@ -521,9 +521,9 @@ static ssize_t punc_store(struct kobjectspk_lock (flags);if (*punc_buf =='d' || *punc_buf =='r' ) - x =set_mask_bits (0 , var->value,3 ); + x =spk_set_mask_bits (0 , var->value,3 );else - x =set_mask_bits (punc_buf, var->value,3 ); + x =spk_set_mask_bits (punc_buf, var->value,3 );spk_unlock (flags);return count;
drivers/staging/speakup/main.c +1 -1
@@ -2265,7 +2265,7 @@ static int __init speakup_init(void) (var->var_id >= 0) && (var->var_id < MAXVARS); var++)speakup_register_var (var);for (i =1 ; punc_info[i].mask !=0 ; i++) -set_mask_bits (0 , i,2 ); +spk_set_mask_bits (0 , i,2 );set_key_info (key_defaults, key_buf);if (quiet_boot)
drivers/staging/speakup/speakup.h +1 -1
@@ -71,7 +71,7 @@ extern struct st_var_header *var_header_extern struct punc_var_t *get_punc_var (enum var_id_t var_id);extern int set_num_var (int val,struct st_var_header *var,int how);extern int set_string_var (const char *page,struct st_var_header *var,int len); -extern int set_mask_bits (const char *input,const int which,const int how); +extern int spk_set_mask_bits (const char *input,const int which,const int how);extern special_func special_handler;extern int handle_help (struct vc_data *vc,u_char type,u_char ch,u_short key);extern int synth_init (char *name);
drivers/staging/speakup/varhandlers.c +2 -2
@@ -267,11 +267,11 @@ int set_string_var(const char *page, strreturn ret; } -/* set_mask_bits sets or clears the punc/delim/repeat bits, +/* spk_set_mask_bits sets or clears the punc/delim/repeat bits, * if input is null uses the defaults. * values for how: 0 clears bits of chars supplied, * 1 clears allk, 2 sets bits for chars */ -int set_mask_bits (const char *input,const int which,const int how) +int spk_set_mask_bits (const char *input,const int which,const int how) {u_char *cp;short mask = punc_info[which].mask;
PATCH 4/18 ext4: atomically set inode->i_flags in ext4_set_inode_flags()
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit 00a1a053ebe5febcfc2ec498bd894f035ad2aa06 upstream.
Use cmpxchg() to atomically set i_flags instead of clearing out the S_IMMUTABLE, S_APPEND, etc. flags and then setting them from the EXT4_IMMUTABLE_FL, EXT4_APPEND_FL flags, since this opens up a race where an immutable file has the immutable flag cleared for a brief window of time.
--- fs/ext4/inode.c | 15 +++++++++------ include/linux/bitops.h | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-)
fs/ext4/inode.c +9 -6
@@ -38,6 +38,7 @@#include <linux/printk.h> #include <linux/slab.h> #include <linux/ratelimit.h> +#include <linux/bitops.h> #include "ext4_jbd2.h" #include "xattr.h"
@@ -3694,18 +3695,20 @@ int ext4_get_inode_loc(struct inode *inovoid ext4_set_inode_flags (struct inode *inode) {unsigned int flags =EXT4_I (inode)->i_flags; +unsigned int new_fl =0 ; - inode->i_flags &= ~(S_SYNC |S_APPEND |S_IMMUTABLE |S_NOATIME |S_DIRSYNC );if (flags &EXT4_SYNC_FL ) - inode->i_flags |=S_SYNC ; + new_fl |=S_SYNC ;if (flags &EXT4_APPEND_FL ) - inode->i_flags |=S_APPEND ; + new_fl |=S_APPEND ;if (flags &EXT4_IMMUTABLE_FL ) - inode->i_flags |=S_IMMUTABLE ; + new_fl |=S_IMMUTABLE ;if (flags &EXT4_NOATIME_FL ) - inode->i_flags |=S_NOATIME ; + new_fl |=S_NOATIME ;if (flags &EXT4_DIRSYNC_FL ) - inode->i_flags |=S_DIRSYNC ; + new_fl |=S_DIRSYNC ; +set_mask_bits (&inode->i_flags, +S_SYNC |S_APPEND |S_IMMUTABLE |S_NOATIME |S_DIRSYNC , new_fl); }/* Propagate flags from i_flags to EXT4_I(inode)->i_flags */
include/linux/bitops.h +15 -0
@@ -168,6 +168,21 @@ static inline unsigned long __ffs64(u64#ifdef __KERNEL__ +#ifndef set_mask_bits +#define set_mask_bits (ptr, _mask, _bits) \ +({ \ + const typeof(*ptr) mask = (_mask), bits = (_bits); \ + typeof(*ptr) old, new; \ + \ + do { \ + old = ACCESS_ONCE(*ptr); \ + new = (old & ~mask) | bits; \ + } while (cmpxchg(ptr, old, new) != old); \ + \ + new; \ +}) +#endif +#ifndef find_last_bit/** * find_last_bit - find the last set bit in a memory region
PATCH 5/18 netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
commit b22f5126a24b3b2f15448c3f2a254fc10cbc2b92 upstream.
Some occurences in the netfilter tree use skb_header_pointer() in the following way ...
struct dccp_hdr _dh, *dh; ... skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
... where dh itself is a pointer that is being passed as the copy buffer. Instead, we need to use &_dh as the forth argument so that we're copying the data into an actual buffer that sits on the stack.
Currently, we probably could overwrite memory on the stack (e.g. with a possibly mal-formed DCCP packet), but unintentionally, as we only want the buffer to be placed into _dh variable.
--- net/netfilter/nf_conntrack_proto_dccp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/netfilter/nf_conntrack_proto_dccp.c +3 -3
@@ -431,7 +431,7 @@ static bool dccp_new(struct nf_conn *ct,const char *msg;u_int8_t state; - dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &dh); + dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &_dh);BUG_ON (dh ==NULL ); state = dccp_state_table[CT_DCCP_ROLE_CLIENT ][dh->dccph_type][CT_DCCP_NONE ];
@@ -483,7 +483,7 @@ static int dccp_packet(struct nf_conn *cu_int8_t type, old_state, new_state;enum ct_dccp_roles role; - dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &dh); + dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &_dh);BUG_ON (dh ==NULL ); type = dh->dccph_type;
@@ -575,7 +575,7 @@ static int dccp_error(struct net *net, sunsigned int cscov;const char *msg; - dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &dh); + dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &_dh);if (dh ==NULL ) { msg ="nf_ct_dccp: short packet " ; goto out_invalid;
PATCH 6/18 ipc/msg: fix race around refcount
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Khlebnikov <[email protected]>
In older kernels (before v3.10) ipc_rcu_hdr->refcount was non-atomic int. There was possuble double-free bug: do_msgsnd() calls ipc_rcu_putref() under msq->q_perm->lock and RCU, while freequeue() calls it while it holds only 'rw_mutex', so there is no sinchronization between them. Two function decrements '2' non-atomically, they both can get '0' as result.
do_msgsnd() freequeue()
msq = msg_lock_check(ns, msqid);
...ipc_rcu_getref(msq);msg_unlock(msq);
schedule(); (caller locks spinlock) expunge_all(msq, -EIDRM); ss_wakeup(&msq->q_senders, 1); msg_rmid(ns, msq); msg_unlock(msq);
ipc_lock_by_ptr(&msq->q_perm);ipc_rcu_putref(msq); ipc_rcu_putref(msq);
< both may get get --(...)->refcount == 0 >
This patch locks ipc_lock and RCU around ipc_rcu_putref in freequeue. ( RCU protects memory for spin_unlock() )
Similar bugs might be in other users of ipc_rcu_putref().
In the mainline this has been fixed in v3.10 indirectly in commmit 6062a8dc0517bce23e3c2f7d2fea5e22411269a3
("ipc,sem: fine grained locking for semtimedop") by Rik van Riel. That commit optimized locking and converted refcount into atomic.
I'm not sure that anybody should care about this bug: it's very-very unlikely and no longer exists in actual mainline. I've found this just by looking into the code, probably this never happens in real life.
--- ipc/msg.c | 2 ++ 1 file changed, 2 insertions(+)
ipc/msg.c +2 -0
@@ -296,7 +296,9 @@ static void freeque(struct ipc_namespace }atomic_sub (msq->q_cbytes, &ns->msg_bytes);security_msg_queue_free (msq); +ipc_lock_by_ptr (&msq->q_perm);ipc_rcu_putref (msq); +ipc_unlock (&msq->q_perm); }/*
PATCH 7/18 net: add and use skb_gso_transport_seglen()
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit de960aa9ab4decc3304959f69533eef64d05d8e8 upstream.
[ no skb_gso_seglen helper in 3.4, leave tbf alone ]
This moves part of Eric Dumazets skb_gso_seglen helper from tbf sched to skbuff core so it may be reused by upcoming ip forwarding path patch.
--- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+)
include/linux/skbuff.h +2 -0
@@ -2143,6 +2143,8 @@ extern int skb_shift(struct sk_buextern struct sk_buff *skb_segment (struct sk_buff *skb,u32 features); +unsigned int skb_gso_transport_seglen (const struct sk_buff *skb); +static inline void *skb_header_pointer (const struct sk_buff *skb,int offset,int len,void *buffer) {
net/core/skbuff.c +25 -0
@@ -45,6 +45,8 @@#include <linux/in.h> #include <linux/inet.h> #include <linux/slab.h> +#include <linux/tcp.h> +#include <linux/udp.h> #include <linux/netdevice.h> #ifdef CONFIG_NET_CLS_ACT #include <net/pkt_sched.h>
@@ -3181,3 +3183,26 @@ void __skb_warn_lro_forwarding(const str " while LRO is enabled\n", skb->dev->name); }EXPORT_SYMBOL (__skb_warn_lro_forwarding); + +/** +* skb_gso_transport_seglen - Return length of individual segments of a gso packet +* +* @skb: GSO skb +* +* skb_gso_transport_seglen is used to determine the real size of the +* individual segments, including Layer4 headers (TCP/UDP). +* +* The MAC/L2 or network (IP, IPv6) headers are not accounted for. +*/ +unsigned int skb_gso_transport_seglen (const struct sk_buff *skb) +{ +const struct skb_shared_info *shinfo =skb_shinfo (skb); +unsigned int hdr_len; + +if (likely (shinfo->gso_type & (SKB_GSO_TCPV4 |SKB_GSO_TCPV6 ))) + hdr_len =tcp_hdrlen (skb); +else + hdr_len =sizeof (struct udphdr ); +return hdr_len + shinfo->gso_size; +} +EXPORT_SYMBOL_GPL (skb_gso_transport_seglen);
PATCH 8/18 net: ip, ipv6: handle gso skbs in forwarding path
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit fe6cc55f3a9a053482a76f5a6b2257cee51b4663 upstream.
[ use zero netdev_feature mask to avoid backport of
netif_skb_dev_features function ]
Marcelo Ricardo Leitner reported problems when the forwarding link path has a lower mtu than the incoming one if the inbound interface supports GRO.
Given:
Host <mtu1500> R1 <mtu1200> R2
Host sends tcp stream which is routed via R1 and R2. R1 performs GRO.
In this case, the kernel will fail to send ICMP fragmentation needed messages (or pkt too big for ipv6), as GSO packets currently bypass dstmtu checks in forward path. Instead, Linux tries to send out packets exceeding the mtu.
When locking route MTU on Host (i.e., no ipv4 DF bit set), R1 does not fragment the packets when forwarding, and again tries to send out packets exceeding R1-R2 link mtu.
This alters the forwarding dstmtu checks to take the individual gso segment lengths into account.
For ipv6, we send out pkt too big error for gso if the individual segments are too big.
For ipv4, we either send icmp fragmentation needed, or, if the DF bit is not set, perform software segmentation and let the output path create fragments when the packet is leaving the machine.
It is not 100% correct as the error message will contain the headers of the GRO skb instead of the original/segmented one, but it seems to work fine in my (limited) tests.
Eric Dumazet suggested to simply shrink mss via ->gso_size to avoid sofware segmentation.
However it turns out that skb_segment() assumes skb nr_frags is related to mss size so we would BUG there. I don't want to mess with it considering Herbert and Eric disagree on what the correct behavior should be.
Hannes Frederic Sowa notes that when we would shrink gso_size skb_segment would then also need to deal with the case where SKB_MAX_FRAGS would be exceeded.
This uses sofware segmentation in the forward path when we hit ipv4 non-DF packets and the outgoing link mtu is too small. Its not perfect, but given the lack of bug reports wrt. GRO fwd being broken this is a rare case anyway. Also its not like this could not be improved later once the dust settles.
--- include/linux/skbuff.h | 17 +++++++++++++ net/ipv4/ip_forward.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++-- net/ipv6/ip6_output.c | 13 +++++++++- 3 files changed, 95 insertions(+), 3 deletions(-)
include/linux/skbuff.h +17 -0
@@ -2557,5 +2557,22 @@ static inline bool skb_is_recycleable(coreturn true; } + +/** +* skb_gso_network_seglen - Return length of individual segments of a gso packet +* +* @skb: GSO skb +* +* skb_gso_network_seglen is used to determine the real size of the +* individual segments, including Layer3 (IP, IPv6) and L4 headers (TCP/UDP). +* +* The MAC/L2 header is not accounted for. +*/ +static inline unsigned int skb_gso_network_seglen (const struct sk_buff *skb) +{ +unsigned int hdr_len =skb_transport_header (skb) - +skb_network_header (skb); +return hdr_len +skb_gso_transport_seglen (skb); +}#endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */
net/ipv4/ip_forward.c +66 -2
86 lines not on this page · raw message
net/ipv6/ip6_output.c +12 -1
@@ -381,6 +381,17 @@ static inline int ip6_forward_finish(strreturn dst_output (skb); } +static bool ip6_pkt_too_big (const struct sk_buff *skb,unsigned int mtu) +{ +if (skb->len <= mtu || skb->local_df) +return false; + +if (skb_is_gso (skb) &&skb_gso_network_seglen (skb) <= mtu) +return false; + +return true; +} +int ip6_forward (struct sk_buff *skb) {struct dst_entry *dst =skb_dst (skb);
@@ -504,7 +515,7 @@ int ip6_forward(struct sk_buff *skb)if (mtu <IPV6_MIN_MTU ) mtu =IPV6_MIN_MTU ; -if (skb->len > mtu && !skb_is_gso (skb)) { +if (ip6_pkt_too_big (skb, mtu)) {/* Again, force OUTPUT device used as source address */ skb->dev = dst->dev;icmpv6_send (skb,ICMPV6_PKT_TOOBIG ,0 , mtu);
PATCH 9/18 deb-pkg: use KCONFIG_CONFIG instead of .config file directly
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Anisse Astier <[email protected]>
commit d20917670ee1fd4b090555e551faea04b014ca97 upstream.
--- scripts/package/builddeb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
scripts/package/builddeb +7 -6
@@ -41,9 +41,9 @@ create_package() { parisc*) debarch=hppa ;; mips*) - debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;; + debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el) ;; arm*) - debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;; + debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el) ;; *) echo "" >&2 echo "** ** ** WARNING ** ** **" >&2
@@ -105,12 +105,12 @@ fi if [ "$ARCH" = "um" ] ; then $MAKE linux cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" - cp .config "$tmpdir/usr/share/doc/$packagename/config" + cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config" gzip "$tmpdir/usr/share/doc/$packagename/config" cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version" else cp System.map "$tmpdir/boot/System.map-$version" - cp .config "$tmpdir/boot/config-$version" + cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version" # Not all arches include the boot path in KBUILD_IMAGE if [ -e $KBUILD_IMAGE ]; then cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
@@ -119,7 +119,7 @@ else fi fi -if grep -q '^CONFIG_MODULES=y' .config ; then +if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install if [ "$ARCH" = "um" ] ; then mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"
@@ -240,11 +240,12 @@ fi # Build header package (cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles") (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles") -(cd $objtree; find .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles") +(cd $objtree; find Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles") destdir=$kernel_headers_dir/usr/src/linux-headers-$version mkdir -p "$destdir" (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -) (cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -) +(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" arch=$(dpkg --print-architecture)
PATCH 10/18 deb-pkg: Fix building for MIPS big-endian or ARM OABI
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit c5e318f67eebbad491615a752c51dbfde7dc3d78 upstream.
These commands will mysteriously fail:
$ make ARCH=arm versatile_defconfig [...] $ make ARCH=arm deb-pkg [...] make[1]: *** [deb-pkg] Error 1 make: *** [deb-pkg] Error 2
The Debian architecture selection for these kernel architectures does 'grep FOO=y $KCONFIG_CONFIG && echo bar', and after 'set -e' this aborts the script if grep does not find the given config symbol.
--- scripts/package/builddeb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/package/builddeb +2 -2
@@ -41,9 +41,9 @@ create_package() { parisc*) debarch=hppa ;; mips*) - debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el) ;; + debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;; arm*) - debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el) ;; + debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;; *) echo "" >&2 echo "** ** ** WARNING ** ** **" >&2
PATCH 11/18 deb-pkg: Fix cross-building linux-headers package
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit f8ce239dfc7ba9add41d9ecdc5e7810738f839fa upstream.
builddeb generates a control file that says the linux-headers package can only be built for the build system primary architecture. This breaks cross-building configurations. We should use $debarch for this instead.
Since $debarch is not yet set when generating the control file, set
Architecture: any and use control file variables to fill in the description.
--- scripts/package/builddeb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
scripts/package/builddeb +4 -5
@@ -62,7 +62,7 @@ create_package() { fi # Create the package - dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir" + dpkg-gencontrol -isp $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir" dpkg --build "$pdir" .. }
@@ -298,15 +298,14 @@ mkdir -p "$destdir" (cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build" rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" -arch=$(dpkg --print-architecture) cat <<EOF >> debian/control Package: $kernel_headers_packagename Provides: linux-headers, linux-headers-2.6 -Architecture: $arch -Description: Linux kernel headers for $KERNELRELEASE on $arch - This package provides kernel header files for $KERNELRELEASE on $arch +Architecture: any +Description: Linux kernel headers for $KERNELRELEASE on \${kernel:debarch} + This package provides kernel header files for $KERNELRELEASE on \${kernel:debarch} . This is useful for people who need to build external modules EOF
PATCH 12/18 asix: asix_rx_fixup surgery to reduce skb truesizes
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit a9e0aca4b37885b5599e52211f098bd7f565e749 upstream.
asix_rx_fixup() is complex, and does some unnecessary memory copies (at least on x86 where NET_IP_ALIGN is 0)
Also, it tends to provide skbs with a big truesize (4096+256 with MTU=1500) to upper stack, so incoming trafic consume a lot of memory and I noticed early packet drops because we hit socket rcvbuf too fast.
Switch to a different strategy, using copybreak so that we provide nice skbs to upper stack (including the NET_SKB_PAD to avoid future head reallocations in some paths)
With this patch, I no longer see packets drops or tcp collapses on various tcp workload with a AX88772 adapter.
--- drivers/net/usb/asix.c | 88 +++++++++++------------------------------------- 1 file changed, 20 insertions(+), 68 deletions(-)
drivers/net/usb/asix.c +20 -68
@@ -306,88 +306,40 @@ asix_write_cmd_async(struct usbnet *dev,static int asix_rx_fixup (struct usbnet *dev,struct sk_buff *skb) { -u8 *head; -u32 header; -char *packet; -struct sk_buff *ax_skb; -u16 size; - - head = (u8 *) skb->data; -memcpy (&header, head,sizeof (header)); -le32_to_cpus (&header); - packet = head +sizeof (header); +int offset =0 ; -skb_pull (skb,4 ); +while (offset +sizeof (u32) < skb->len) { +struct sk_buff *ax_skb; +u16 size; +u32 header =get_unaligned_le32 (skb->data + offset); -while (skb->len >0 ) { -if ((header &0x07ff ) != ((~header >>16 ) &0x07ff )) -netdev_err (dev->net,"asix_rx_fixup() Bad Header Length\n" ); + offset +=sizeof (u32);/* get the packet length */ - size = (u16) (header &0x000007ff ); - -if ((skb->len) - ((size +1 ) &0xfffe ) ==0 ) { -u8 alignment = (unsigned long )skb->data &0x3 ; -if (alignment !=0x2 ) { -/* -* not 16bit aligned so use the room provided by -* the 32 bit header to align the data -* -* note we want 16bit alignment as MAC header is -* 14bytes thus ip header will be aligned on -* 32bit boundary so accessing ipheader elements -* using a cast to struct ip header wont cause -* an unaligned accesses. -*/ -u8 realignment = (alignment +2 ) &0x3 ; -memmove (skb->data - realignment, - skb->data, - size); - skb->data -= realignment; -skb_set_tail_pointer (skb, size); - } -return 2 ; + size = (u16) (header &0x7ff ); +if (size != ((~header >>16 ) &0x07ff )) { +netdev_err (dev->net,"asix_rx_fixup() Bad Header Length\n" ); +return 0 ; } -if (size > dev->net->mtu +ETH_HLEN +VLAN_HLEN ) { +if ((size > dev->net->mtu +ETH_HLEN +VLAN_HLEN ) || + (size + offset > skb->len)) {netdev_err (dev->net,"asix_rx_fixup() Bad RX Length %d\n" , size);return 0 ; } - ax_skb =skb_clone (skb,GFP_ATOMIC ); -if (ax_skb) { -u8 alignment = (unsigned long )packet &0x3 ; - ax_skb->len = size; - -if (alignment !=0x2 ) { -/* -* not 16bit aligned use the room provided by -* the 32 bit header to align the data -*/ -u8 realignment = (alignment +2 ) &0x3 ; -memmove (packet - realignment, packet, size); - packet -= realignment; - } - ax_skb->data = packet; -skb_set_tail_pointer (ax_skb, size); -usbnet_skb_return (dev, ax_skb); - }else { + ax_skb =netdev_alloc_skb_ip_align (dev->net, size); +if (!ax_skb)return 0 ; - } - -skb_pull (skb, (size +1 ) &0xfffe ); -if (skb->len <sizeof (header)) -break ; +skb_put (ax_skb, size); +memcpy (ax_skb->data, skb->data + offset, size); +usbnet_skb_return (dev, ax_skb); - head = (u8 *) skb->data; -memcpy (&header, head,sizeof (header)); -le32_to_cpus (&header); - packet = head +sizeof (header); -skb_pull (skb,4 ); + offset += (size +1 ) &0xfffe ; } -if (skb->len <0 ) { +if (skb->len != offset) {netdev_err (dev->net,"asix_rx_fixup() Bad SKB Length %d\n" , skb->len);return 0 ;
@@ -1538,7 +1490,7 @@ static const struct driver_info ax88772_ .status = asix_status, .link_reset = ax88772_link_reset, .reset = ax88772_reset, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR, + .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | FLAG_MULTI_PACKET, .rx_fixup = asix_rx_fixup, .tx_fixup = asix_tx_fixup, };
PATCH 13/18 net: asix: handle packets crossing URB boundaries
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Emil Goode <[email protected]>
commit 8b5b6f5413e97c3e8bafcdd67553d508f4f698cd upstream.
ASIX AX88772B started to pack data even more tightly. Packets and the ASIX packet header may now cross URB boundaries. To handle this we have to introduce some state between individual calls to asix_rx_fixup().
[ Emil: backported to 3.2:
- dropped changes to drivers/net/usb/ax88172a.c
- Introduced some static function declarations as the functions are not used outside of asix.c (sparse is complaining about it) ]
--- drivers/net/usb/asix.c | 125 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 97 insertions(+), 28 deletions(-)
drivers/net/usb/asix.c +94 -27
@@ -183,6 +183,17 @@ struct ax88172_int_data {__le16 res3; } __packed; +struct asix_rx_fixup_info { +struct sk_buff *ax_skb; +u32 header; +u16 size; +bool split_head; +}; + +struct asix_common_private { +struct asix_rx_fixup_info rx_fixup_info; +}; +static int asix_read_cmd (struct usbnet *dev,u8 cmd,u16 value,u16 index,u16 size,void *data) {
@@ -304,49 +315,89 @@ asix_write_cmd_async(struct usbnet *dev, } } -static int asix_rx_fixup (struct usbnet *dev,struct sk_buff *skb) +static int asix_rx_fixup_internal (struct usbnet *dev,struct sk_buff *skb, +struct asix_rx_fixup_info *rx) {int offset =0 ; -while (offset +sizeof (u32) < skb->len) { -struct sk_buff *ax_skb; -u16 size; -u32 header =get_unaligned_le32 (skb->data + offset); - - offset +=sizeof (u32); - -/* get the packet length */ - size = (u16) (header &0x7ff ); -if (size != ((~header >>16 ) &0x07ff )) { -netdev_err (dev->net,"asix_rx_fixup() Bad Header Length\n" ); -return 0 ; +while (offset +sizeof (u16) <= skb->len) { +u16 remaining =0 ; +unsigned char *data; + +if (!rx->size) { +if ((skb->len - offset ==sizeof (u16)) || + rx->split_head) { +if (!rx->split_head) { + rx->header =get_unaligned_le16 ( + skb->data + offset); + rx->split_head = true; + offset +=sizeof (u16); +break ; + }else { + rx->header |= (get_unaligned_le16 ( + skb->data + offset) + <<16 ); + rx->split_head = false; + offset +=sizeof (u16); + } + }else { + rx->header =get_unaligned_le32 (skb->data + + offset); + offset +=sizeof (u32); + } + +/* get the packet length */ + rx->size = (u16) (rx->header &0x7ff ); +if (rx->size != ((~rx->header >>16 ) &0x7ff )) { +netdev_err (dev->net,"asix_rx_fixup() Bad Header Length 0x%x, offset %d\n" , + rx->header, offset); + rx->size =0 ; +return 0 ; + } + rx->ax_skb =netdev_alloc_skb_ip_align (dev->net, + rx->size); +if (!rx->ax_skb) +return 0 ; } -if ((size > dev->net->mtu +ETH_HLEN +VLAN_HLEN ) || - (size + offset > skb->len)) { +if (rx->size > dev->net->mtu +ETH_HLEN +VLAN_HLEN ) {netdev_err (dev->net,"asix_rx_fixup() Bad RX Length %d\n" , - size); + rx->size); +kfree_skb (rx->ax_skb);return 0 ; } - ax_skb =netdev_alloc_skb_ip_align (dev->net, size); -if (!ax_skb) -return 0 ; -skb_put (ax_skb, size); -memcpy (ax_skb->data, skb->data + offset, size); -usbnet_skb_return (dev, ax_skb); +if (rx->size > skb->len - offset) { + remaining = rx->size - (skb->len - offset); + rx->size = skb->len - offset; + } + + data =skb_put (rx->ax_skb, rx->size); +memcpy (data, skb->data + offset, rx->size); +if (!remaining) +usbnet_skb_return (dev, rx->ax_skb); - offset += (size +1 ) &0xfffe ; + offset += (rx->size +1 ) &0xfffe ; + rx->size = remaining; }if (skb->len != offset) { -netdev_err (dev->net,"asix_rx_fixup() Bad SKB Length %d\n" , - skb->len); +netdev_err (dev->net,"asix_rx_fixup() Bad SKB Length %d, %d\n" , + skb->len, offset);return 0 ; } +return 1 ; } +static int asix_rx_fixup_common (struct usbnet *dev,struct sk_buff *skb) +{ +struct asix_common_private *dp = dev->driver_priv; +struct asix_rx_fixup_info *rx = &dp->rx_fixup_info; + +return asix_rx_fixup_internal (dev, skb, rx); +} +static struct sk_buff *asix_tx_fixup (struct usbnet *dev,struct sk_buff *skb,gfp_t flags) {
@@ -1106,9 +1157,19 @@ static int ax88772_bind(struct usbnet *d dev->rx_urb_size =2048 ; } + dev->driver_priv =kzalloc (sizeof (struct asix_common_private ),GFP_KERNEL ); +if (!dev->driver_priv) +return -ENOMEM ; +return 0 ; } +static void ax88772_unbind (struct usbnet *dev,struct usb_interface *intf) +{ +if (dev->driver_priv) +kfree (dev->driver_priv); +} +static struct ethtool_ops ax88178_ethtool_ops = { .get_drvinfo = asix_get_drvinfo, .get_link = asix_get_link,
@@ -1441,6 +1502,10 @@ static int ax88178_bind(struct usbnet *d dev->rx_urb_size =2048 ; } + dev->driver_priv =kzalloc (sizeof (struct asix_common_private ),GFP_KERNEL ); +if (!dev->driver_priv) +return -ENOMEM ; +return 0 ; }
@@ -1487,22 +1552,24 @@ static const struct driver_info hawking_static const struct driver_info ax88772_info = { .description ="ASIX AX88772 USB 2.0 Ethernet" , .bind = ax88772_bind, + .unbind = ax88772_unbind, .status = asix_status, .link_reset = ax88772_link_reset, .reset = ax88772_reset, .flags =FLAG_ETHER |FLAG_FRAMING_AX |FLAG_LINK_INTR |FLAG_MULTI_PACKET , - .rx_fixup = asix_rx_fixup, + .rx_fixup = asix_rx_fixup_common, .tx_fixup = asix_tx_fixup, };static const struct driver_info ax88178_info = { .description ="ASIX AX88178 USB 2.0 Ethernet" , .bind = ax88178_bind, + .unbind = ax88772_unbind, .status = asix_status, .link_reset = ax88178_link_reset, .reset = ax88178_reset, .flags =FLAG_ETHER |FLAG_FRAMING_AX |FLAG_LINK_INTR , - .rx_fixup = asix_rx_fixup, + .rx_fixup = asix_rx_fixup_common, .tx_fixup = asix_tx_fixup, };
PATCH 14/18 net: asix: add missing flag to struct driver_info
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Emil Goode <[email protected]>
commit d43ff4cd798911736fb39025ec8004284b1b0bc2 upstream.
The struct driver_info ax88178_info is assigned the function asix_rx_fixup_common as it's rx_fixup callback. This means that FLAG_MULTI_PACKET must be set as this function is cloning the data and calling usbnet_skb_return. Not setting this flag leads to usbnet_skb_return beeing called a second time from within the rx_process function in the usbnet module.
--- drivers/net/usb/asix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/usb/asix.c +2 -1
@@ -1568,7 +1568,8 @@ static const struct driver_info ax88178_ .status = asix_status, .link_reset = ax88178_link_reset, .reset = ax88178_reset, - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR, + .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | + FLAG_MULTI_PACKET, .rx_fixup = asix_rx_fixup_common, .tx_fixup = asix_tx_fixup, };
PATCH 15/18 KVM: MMU: handle invalid root_hpa at __direct_map
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Tosatti <[email protected]>
commit 989c6b34f6a9480e397b170cc62237e89bf4fdb9 upstream.
It is possible for __direct_map to be called on invalid root_hpa (-1), two examples:
1) try_async_pf -> can_do_async_pf
-> vmx_interrupt_allowed -> nested_vmx_vmexit
2) vmx_handle_exit -> vmx_interrupt_allowed -> nested_vmx_vmexit
Then to load_vmcs12_host_state and kvm_mmu_reset_context.
Check for this possibility, let fault exception be regenerated.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=924916
--- arch/x86/kvm/mmu.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kvm/mmu.c +3 -0
@@ -2451,6 +2451,9 @@ static int __direct_map(struct kvm_vcpuint emulate =0 ;gfn_t pseudo_gfn; +if (!VALID_PAGE (vcpu->arch.mmu.root_hpa)) +return 0 ; +for_each_shadow_entry (vcpu, (u64 )gfn <<PAGE_SHIFT , iterator) {if (iterator.level == level) {unsigned pte_access =ACC_ALL ;
PATCH 16/18 KVM: VMX: fix use after free of vmx->loaded_vmcs
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Tosatti <[email protected]>
commit 26a865f4aa8e66a6d94958de7656f7f1b03c6c56 upstream.
After free_loaded_vmcs executes, the "loaded_vmcs" structure is kfreed, and now vmx->loaded_vmcs points to a kfreed area. Subsequent free_loaded_vmcs then attempts to manipulate vmx->loaded_vmcs.
Switch the order to avoid the problem.
https://bugzilla.redhat.com/show_bug.cgi?id=1047892
--- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/vmx.c +1 -1
@@ -6273,8 +6273,8 @@ static void vmx_free_vcpu(struct kvm_vcpstruct vcpu_vmx *vmx =to_vmx (vcpu);free_vpid (vmx); -free_nested (vmx);free_loaded_vmcs (vmx->loaded_vmcs); +free_nested (vmx);kfree (vmx->guest_msrs);kvm_vcpu_uninit (vcpu);kmem_cache_free (kvm_vcpu_cache, vmx);
PATCH 17/18 cifs: ensure that uncached writes handle unmapped areas correctly
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit 5d81de8e8667da7135d3a32a964087c0faf5483f upstream.
It's possible for userland to pass down an iovec via writev() that has a bogus user pointer in it. If that happens and we're doing an uncached write, then we can end up getting less bytes than we expect from the call to iov_iter_copy_from_user. This is CVE-2014-0069
cifs_iovec_write isn't set up to handle that situation however. It'll blindly keep chugging through the page array and not filling those pages with anything useful. Worse yet, we'll later end up with a negative number in wdata->tailsz, which will confuse the sending routines and cause an oops at the very least.
Fix this by having the copy phase of cifs_iovec_write stop copying data in this situation and send the last write as a short one. At the same time, we want to avoid sending a zero-length write to the server, so break out of the loop and set rc to -EFAULT if that happens. This also allows us to handle the case where no address in the iovec is valid.
[Note: Marking this for stable on v3.4+ kernels, but kernels as old as
v2.6.38 may have a similar problem and may need similar fix]
[bwh: Backported to 3.2:
- Adjust context
- s/nr_pages/npages/
- s/wdata->pages/pages/
- In case of an error with no data copied, we must kunmap() page 0, but in neither case should we free anything else]
--- fs/cifs/file.c | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-)
fs/cifs/file.c +30 -3
@@ -2107,7 +2107,7 @@ cifs_iovec_write(struct file *file, cons {unsigned int written;unsigned long num_pages, npages, i; -size_t copied, len, cur_len; +size_t bytes, copied, len, cur_len;ssize_t total_written =0 ;struct kvec *to_send;struct page **pages;
@@ -2165,17 +2165,44 @@ cifs_iovec_write(struct file *file, cons do { size_t save_len = cur_len; for (i = 0; i < npages; i++) { - copied = min_t(const size_t, cur_len, PAGE_CACHE_SIZE); + bytes = min_t(const size_t, cur_len, PAGE_CACHE_SIZE); copied = iov_iter_copy_from_user(pages[i], &it, 0, - copied); + bytes); cur_len -= copied; iov_iter_advance(&it, copied); to_send[i+1].iov_base = kmap(pages[i]); to_send[i+1].iov_len = copied; + /* + * If we didn't copy as much as we expected, then that + * may mean we trod into an unmapped area. Stop copying + * at that point. On the next pass through the big + * loop, we'll likely end up getting a zero-length + * write and bailing out of it. + */ + if (copied < bytes) + break; } cur_len = save_len - cur_len; + /* + * If we have no data to send, then that probably means that + * the copy above failed altogether. That's most likely because + * the address in the iovec was bogus. Set the rc to -EFAULT, + * free anything we allocated and bail out. + */ + if (!cur_len) { + kunmap(pages[0]); + rc = -EFAULT; + break; + } + + /* + * i + 1 now represents the number of pages we actually used in + * the copy phase above. + */ + npages = i + 1; + do { if (open_file->invalidHandle) { rc = cifs_reopen_file(open_file, false);
Re: [PATCH 3.2 17/18] cifs: ensure that uncached writes handle unmapped areas correctly
Quoted 1 line · Ben Hutchings
3.2.57-rc1 review patch. If anyone has any objections, please let me know.
[...]
Raphael Geissert previously prepared a backport of this for Debian, which I overlooked while trying to handle it for 3.2-stable. When comparing the two, I found bugs in mine, so here's my v2.
Ben.
---
From: Jeff Layton <[email protected]>
Date: Fri, 14 Feb 2014 07:20:35 -0500
Subject: cifs: ensure that uncached writes handle unmapped areas correctly
commit 5d81de8e8667da7135d3a32a964087c0faf5483f upstream.
It's possible for userland to pass down an iovec via writev() that has a bogus user pointer in it. If that happens and we're doing an uncached write, then we can end up getting less bytes than we expect from the call to iov_iter_copy_from_user. This is CVE-2014-0069
cifs_iovec_write isn't set up to handle that situation however. It'll blindly keep chugging through the page array and not filling those pages with anything useful. Worse yet, we'll later end up with a negative number in wdata->tailsz, which will confuse the sending routines and cause an oops at the very least.
Fix this by having the copy phase of cifs_iovec_write stop copying data in this situation and send the last write as a short one. At the same time, we want to avoid sending a zero-length write to the server, so break out of the loop and set rc to -EFAULT if that happens. This also allows us to handle the case where no address in the iovec is valid.
[Note: Marking this for stable on v3.4+ kernels, but kernels as old as
v2.6.38 may have a similar problem and may need similar fix]
[bwh: Backported to 3.2:
- Adjust context
- s/nr_pages/npages/
- s/wdata->pages/pages/
- In case of an error with no data copied, we must kunmap() page 0, but in neither case should we free anything else]
Thanks to Raphael Geissert for an independent backport that showed some bugs in my first version.]
--- fs/cifs/file.c | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-)
fs/cifs/file.c +31 -3
@@ -2107,7 +2107,7 @@ cifs_iovec_write(struct file *file, cons {unsigned int written;unsigned long num_pages, npages, i; -size_t copied, len, cur_len; +size_t bytes, copied, len, cur_len;ssize_t total_written =0 ;struct kvec *to_send;struct page **pages;
@@ -2165,17 +2165,45 @@ cifs_iovec_write(struct file *file, cons do { size_t save_len = cur_len; for (i = 0; i < npages; i++) { - copied = min_t(const size_t, cur_len, PAGE_CACHE_SIZE); + bytes = min_t(const size_t, cur_len, PAGE_CACHE_SIZE); copied = iov_iter_copy_from_user(pages[i], &it, 0, - copied); + bytes); cur_len -= copied; iov_iter_advance(&it, copied); to_send[i+1].iov_base = kmap(pages[i]); to_send[i+1].iov_len = copied; + /* + * If we didn't copy as much as we expected, then that + * may mean we trod into an unmapped area. Stop copying + * at that point. On the next pass through the big + * loop, we'll likely end up getting a zero-length + * write and bailing out of it. + */ + if (copied < bytes) + break; } cur_len = save_len - cur_len; + /* + * If we have no data to send, then that probably means that + * the copy above failed altogether. That's most likely because + * the address in the iovec was bogus. Set the rc to -EFAULT, + * free anything we allocated and bail out. + */ + if (!cur_len) { + kunmap(pages[0]); + if (!total_written) + total_written = -EFAULT; + break; + } + + /* + * i + 1 now represents the number of pages we actually used in + * the copy phase above. + */ + npages = min(npages, i + 1); + do { if (open_file->invalidHandle) { rc = cifs_reopen_file(open_file, false);
Signature · 2 lines
Ben Hutchings Sturgeon's Law: Ninety percent of everything is crap.
Re: [PATCH 3.2 17/18] cifs: ensure that uncached writes handle unmapped areas correctly
Hi,
Quoted 5 lines · Ben Hutchings
Quoted 1 line · Ben Hutchings
3.2.57-rc1 review patch. If anyone has any objections, please let me know.
[...]
fs/cifs/file.c +0
-0
[...]
fs/cifs/file.c cifs_iovec_write(struct file *file, cons · line 2205
Quoted 5 lines
fs/cifs/file.c +5
-0+/* +* i + 1 now represents the number of pages we actually used in +* the copy phase above. +*/ + npages =min (npages, i +1 );
I'm having trouble understanding why min() is needed here. It shouldn't harm either, but I find it confusing.
Cheers,
Signature · 2 lines
Raphael Geissert - Debian Developer www.debian.org - get.debian.net
Re: [PATCH 3.2 17/18] cifs: ensure that uncached writes handle unmapped areas correctly
Quoted 9 lines · Raphael Geissert
Hi,
Quoted 5 lines · Ben Hutchings
Quoted 1 line · Ben Hutchings
3.2.57-rc1 review patch. If anyone has any objections, please let me know.
[...]
fs/cifs/file.c +0
-0[...]
Quoted 8 lines
fs/cifs/file.c cifs_iovec_write(struct file *file, cons · line 2205
Quoted 5 lines
fs/cifs/file.c +5
-0+/* +* i + 1 now represents the number of pages we actually used in +* the copy phase above. +*/ + npages =min (npages, i +1 );I'm having trouble understanding why
min()is needed here. It shouldn't harm either, but I find it confusing.
Because in the case where no error occurred, the comment is not true:
i == npages and npages have been used. The loop used upstream works, but it seemed a bit silly to use a loop here.
Ben.
Signature · 2 lines
Ben Hutchings Sturgeon's Law: Ninety percent of everything is crap.
PATCH 18/18 s390: fix kernel crash due to linkage stack instructions
In reply to Ben Hutchings3.2.57-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Martin Schwidefsky <[email protected]>
commit 8d7f6690cedb83456edd41c9bd583783f0703bf0 upstream.
The kernel currently crashes with a low-address-protection exception if a user space process executes an instruction that tries to use the linkage stack. Set the base-ASTE origin and the subspace-ASTE origin of the dispatchable-unit-control-table to point to a dummy ASTE. Set up control register 15 to point to an empty linkage stack with no room left.
A user space process with a linkage stack instruction will still crash but with a different exception which is correctly translated to a segmentation fault instead of a kernel oops.
--- arch/s390/kernel/head64.S | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
arch/s390/kernel/head64.S +5 -2
@@ -61,7 +61,7 @@ ENTRY(startup_continue) .quad 0 # cr12: tracing off .quad 0 # cr13: home space segment table .quad 0xc0000000 # cr14: machine check handling off - .quad 0 # cr15: linkage stack operations + .quad .Llinkage_stack # cr15: linkage stack operations .Lpcmsk:.quad 0x0000000180000000 .L4malign:.quad 0xffffffffffc00000 .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
@@ -69,12 +69,15 @@ ENTRY(startup_continue) .Lparmaddr: .quad PARMAREA .align 64 -.Lduct: .long 0,0,0,0,.Lduald,0,0,0 +.Lduct: .long 0,.Laste,.Laste,0,.Lduald,0,0,0 .long 0,0,0,0,0,0,0,0 +.Laste: .quad 0,0xffffffffffffffff,0,0,0,0,0,0 .align 128 .Lduald:.rept 8 .long 0x80000000,0,0,0 # invalid access-list entries .endr +.Llinkage_stack: + .long 0,0,0x89000000,0,0,0,0x8a000000,0 ENTRY(_ehead)
This is the combined patch for 3.2.57-rc1 relative to 3.2.56.
Ben.
Signature · 2 lines
Ben Hutchings Sturgeon's Law: Ninety percent of everything is crap.
Makefile +2 -2
@@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 2 -SUBLEVEL = 56 -EXTRAVERSION = +SUBLEVEL = 57 +EXTRAVERSION = -rc1 NAME = Saber-toothed Squirrel # *DOCUMENTATION*
arch/s390/kernel/head64.S +5 -2
@@ -61,7 +61,7 @@ ENTRY(startup_continue) .quad 0 # cr12: tracing off .quad 0 # cr13: home space segment table .quad 0xc0000000 # cr14: machine check handling off - .quad 0 # cr15: linkage stack operations + .quad .Llinkage_stack # cr15: linkage stack operations .Lpcmsk:.quad 0x0000000180000000 .L4malign:.quad 0xffffffffffc00000 .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
@@ -69,12 +69,15 @@ ENTRY(startup_continue) .Lparmaddr: .quad PARMAREA .align 64 -.Lduct: .long 0,0,0,0,.Lduald,0,0,0 +.Lduct: .long 0,.Laste,.Laste,0,.Lduald,0,0,0 .long 0,0,0,0,0,0,0,0 +.Laste: .quad 0,0xffffffffffffffff,0,0,0,0,0,0 .align 128 .Lduald:.rept 8 .long 0x80000000,0,0,0 # invalid access-list entries .endr +.Llinkage_stack: + .long 0,0,0x89000000,0,0,0,0x8a000000,0 ENTRY(_ehead)
arch/x86/kvm/mmu.c +3 -0
@@ -2451,6 +2451,9 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,int emulate =0 ;gfn_t pseudo_gfn; +if (!VALID_PAGE (vcpu->arch.mmu.root_hpa)) +return 0 ; +for_each_shadow_entry (vcpu, (u64 )gfn <<PAGE_SHIFT , iterator) {if (iterator.level == level) {unsigned pte_access =ACC_ALL ;
arch/x86/kvm/vmx.c +1 -1
@@ -6273,8 +6273,8 @@ static void vmx_free_vcpu(struct kvm_vcpu *vcpu)struct vcpu_vmx *vmx =to_vmx (vcpu);free_vpid (vmx); -free_nested (vmx);free_loaded_vmcs (vmx->loaded_vmcs); +free_nested (vmx);kfree (vmx->guest_msrs);kvm_vcpu_uninit (vcpu);kmem_cache_free (kvm_vcpu_cache, vmx);
drivers/input/mouse/synaptics.c +55 -0
76 lines not on this page · raw message
drivers/net/usb/asix.c +97 -77
237 lines not on this page · raw message
drivers/staging/speakup/kobjects.c +2 -2
@@ -521,9 +521,9 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr,spk_lock (flags);if (*punc_buf =='d' || *punc_buf =='r' ) - x =set_mask_bits (0 , var->value,3 ); + x =spk_set_mask_bits (0 , var->value,3 );else - x =set_mask_bits (punc_buf, var->value,3 ); + x =spk_set_mask_bits (punc_buf, var->value,3 );spk_unlock (flags);return count;
drivers/staging/speakup/main.c +1 -1
@@ -2265,7 +2265,7 @@ static int __init speakup_init(void) (var->var_id >= 0) && (var->var_id < MAXVARS); var++)speakup_register_var (var);for (i =1 ; punc_info[i].mask !=0 ; i++) -set_mask_bits (0 , i,2 ); +spk_set_mask_bits (0 , i,2 );set_key_info (key_defaults, key_buf);if (quiet_boot)
drivers/staging/speakup/speakup.h +1 -1
@@ -71,7 +71,7 @@ extern struct st_var_header *var_header_by_name(const char *name);extern struct punc_var_t *get_punc_var (enum var_id_t var_id);extern int set_num_var (int val,struct st_var_header *var,int how);extern int set_string_var (const char *page,struct st_var_header *var,int len); -extern int set_mask_bits (const char *input,const int which,const int how); +extern int spk_set_mask_bits (const char *input,const int which,const int how);extern special_func special_handler;extern int handle_help (struct vc_data *vc,u_char type,u_char ch,u_short key);extern int synth_init (char *name);
drivers/staging/speakup/varhandlers.c +2 -2
@@ -267,11 +267,11 @@ int set_string_var(const char *page, struct st_var_header *var, int len)return ret; } -/* set_mask_bits sets or clears the punc/delim/repeat bits, +/* spk_set_mask_bits sets or clears the punc/delim/repeat bits, * if input is null uses the defaults. * values for how: 0 clears bits of chars supplied, * 1 clears allk, 2 sets bits for chars */ -int set_mask_bits (const char *input,const int which,const int how) +int spk_set_mask_bits (const char *input,const int which,const int how) {u_char *cp;short mask = punc_info[which].mask;
fs/cifs/file.c +30 -3
@@ -2107,7 +2107,7 @@ cifs_iovec_write(struct file *file, const struct iovec *iov, {unsigned int written;unsigned long num_pages, npages, i; -size_t copied, len, cur_len; +size_t bytes, copied, len, cur_len;ssize_t total_written =0 ;struct kvec *to_send;struct page **pages;
@@ -2165,17 +2165,44 @@ cifs_iovec_write(struct file *file, const struct iovec *iov, do { size_t save_len = cur_len; for (i = 0; i < npages; i++) { - copied = min_t(const size_t, cur_len, PAGE_CACHE_SIZE); + bytes = min_t(const size_t, cur_len, PAGE_CACHE_SIZE); copied = iov_iter_copy_from_user(pages[i], &it, 0, - copied); + bytes); cur_len -= copied; iov_iter_advance(&it, copied); to_send[i+1].iov_base = kmap(pages[i]); to_send[i+1].iov_len = copied; + /* + * If we didn't copy as much as we expected, then that + * may mean we trod into an unmapped area. Stop copying + * at that point. On the next pass through the big + * loop, we'll likely end up getting a zero-length + * write and bailing out of it. + */ + if (copied < bytes) + break; } cur_len = save_len - cur_len; + /* + * If we have no data to send, then that probably means that + * the copy above failed altogether. That's most likely because + * the address in the iovec was bogus. Set the rc to -EFAULT, + * free anything we allocated and bail out. + */ + if (!cur_len) { + kunmap(pages[0]); + rc = -EFAULT; + break; + } + + /* + * i + 1 now represents the number of pages we actually used in + * the copy phase above. + */ + npages = i + 1; + do { if (open_file->invalidHandle) { rc = cifs_reopen_file(open_file, false);
fs/ext4/inode.c +9 -6
@@ -38,6 +38,7 @@#include <linux/printk.h> #include <linux/slab.h> #include <linux/ratelimit.h> +#include <linux/bitops.h> #include "ext4_jbd2.h" #include "xattr.h"
@@ -3694,18 +3695,20 @@ int ext4_get_inode_loc(struct inode *inode, struct ext4_iloc *iloc)void ext4_set_inode_flags (struct inode *inode) {unsigned int flags =EXT4_I (inode)->i_flags; +unsigned int new_fl =0 ; - inode->i_flags &= ~(S_SYNC |S_APPEND |S_IMMUTABLE |S_NOATIME |S_DIRSYNC );if (flags &EXT4_SYNC_FL ) - inode->i_flags |=S_SYNC ; + new_fl |=S_SYNC ;if (flags &EXT4_APPEND_FL ) - inode->i_flags |=S_APPEND ; + new_fl |=S_APPEND ;if (flags &EXT4_IMMUTABLE_FL ) - inode->i_flags |=S_IMMUTABLE ; + new_fl |=S_IMMUTABLE ;if (flags &EXT4_NOATIME_FL ) - inode->i_flags |=S_NOATIME ; + new_fl |=S_NOATIME ;if (flags &EXT4_DIRSYNC_FL ) - inode->i_flags |=S_DIRSYNC ; + new_fl |=S_DIRSYNC ; +set_mask_bits (&inode->i_flags, +S_SYNC |S_APPEND |S_IMMUTABLE |S_NOATIME |S_DIRSYNC , new_fl); }/* Propagate flags from i_flags to EXT4_I(inode)->i_flags */
include/linux/bitops.h +15 -0
@@ -168,6 +168,21 @@ static inline unsigned long __ffs64(u64 word)#ifdef __KERNEL__ +#ifndef set_mask_bits +#define set_mask_bits (ptr, _mask, _bits) \ +({ \ + const typeof(*ptr) mask = (_mask), bits = (_bits); \ + typeof(*ptr) old, new; \ + \ + do { \ + old = ACCESS_ONCE(*ptr); \ + new = (old & ~mask) | bits; \ + } while (cmpxchg(ptr, old, new) != old); \ + \ + new; \ +}) +#endif +#ifndef find_last_bit/** * find_last_bit - find the last set bit in a memory region
include/linux/skbuff.h +19 -0
@@ -2143,6 +2143,8 @@ extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb,extern struct sk_buff *skb_segment (struct sk_buff *skb,u32 features); +unsigned int skb_gso_transport_seglen (const struct sk_buff *skb); +static inline void *skb_header_pointer (const struct sk_buff *skb,int offset,int len,void *buffer) {
@@ -2555,5 +2557,22 @@ static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size)return true; } + +/** +* skb_gso_network_seglen - Return length of individual segments of a gso packet +* +* @skb: GSO skb +* +* skb_gso_network_seglen is used to determine the real size of the +* individual segments, including Layer3 (IP, IPv6) and L4 headers (TCP/UDP). +* +* The MAC/L2 header is not accounted for. +*/ +static inline unsigned int skb_gso_network_seglen (const struct sk_buff *skb) +{ +unsigned int hdr_len =skb_transport_header (skb) - +skb_network_header (skb); +return hdr_len +skb_gso_transport_seglen (skb); +}#endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */
ipc/msg.c +2 -0
@@ -296,7 +296,9 @@ static void freeque(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp) }atomic_sub (msq->q_cbytes, &ns->msg_bytes);security_msg_queue_free (msq); +ipc_lock_by_ptr (&msq->q_perm);ipc_rcu_putref (msq); +ipc_unlock (&msq->q_perm); }/*
net/core/skbuff.c +25 -0
@@ -45,6 +45,8 @@#include <linux/in.h> #include <linux/inet.h> #include <linux/slab.h> +#include <linux/tcp.h> +#include <linux/udp.h> #include <linux/netdevice.h> #ifdef CONFIG_NET_CLS_ACT #include <net/pkt_sched.h>
@@ -3181,3 +3183,26 @@ void __skb_warn_lro_forwarding(const struct sk_buff *skb) " while LRO is enabled\n", skb->dev->name); }EXPORT_SYMBOL (__skb_warn_lro_forwarding); + +/** +* skb_gso_transport_seglen - Return length of individual segments of a gso packet +* +* @skb: GSO skb +* +* skb_gso_transport_seglen is used to determine the real size of the +* individual segments, including Layer4 headers (TCP/UDP). +* +* The MAC/L2 or network (IP, IPv6) headers are not accounted for. +*/ +unsigned int skb_gso_transport_seglen (const struct sk_buff *skb) +{ +const struct skb_shared_info *shinfo =skb_shinfo (skb); +unsigned int hdr_len; + +if (likely (shinfo->gso_type & (SKB_GSO_TCPV4 |SKB_GSO_TCPV6 ))) + hdr_len =tcp_hdrlen (skb); +else + hdr_len =sizeof (struct udphdr ); +return hdr_len + shinfo->gso_size; +} +EXPORT_SYMBOL_GPL (skb_gso_transport_seglen);
net/ipv4/ip_forward.c +66 -2
86 lines not on this page · raw message
net/ipv6/ip6_output.c +12 -1
@@ -381,6 +381,17 @@ static inline int ip6_forward_finish(struct sk_buff *skb)return dst_output (skb); } +static bool ip6_pkt_too_big (const struct sk_buff *skb,unsigned int mtu) +{ +if (skb->len <= mtu || skb->local_df) +return false; + +if (skb_is_gso (skb) &&skb_gso_network_seglen (skb) <= mtu) +return false; + +return true; +} +int ip6_forward (struct sk_buff *skb) {struct dst_entry *dst =skb_dst (skb);
@@ -504,7 +515,7 @@ int ip6_forward(struct sk_buff *skb)if (mtu <IPV6_MIN_MTU ) mtu =IPV6_MIN_MTU ; -if (skb->len > mtu && !skb_is_gso (skb)) { +if (ip6_pkt_too_big (skb, mtu)) {/* Again, force OUTPUT device used as source address */ skb->dev = dst->dev;icmpv6_send (skb,ICMPV6_PKT_TOOBIG ,0 , mtu);
net/netfilter/nf_conntrack_proto_dccp.c +3 -3
@@ -431,7 +431,7 @@ static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb,const char *msg;u_int8_t state; - dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &dh); + dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &_dh);BUG_ON (dh ==NULL ); state = dccp_state_table[CT_DCCP_ROLE_CLIENT ][dh->dccph_type][CT_DCCP_NONE ];
@@ -483,7 +483,7 @@ static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,u_int8_t type, old_state, new_state;enum ct_dccp_roles role; - dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &dh); + dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &_dh);BUG_ON (dh ==NULL ); type = dh->dccph_type;
@@ -575,7 +575,7 @@ static int dccp_error(struct net *net, struct nf_conn *tmpl,unsigned int cscov;const char *msg; - dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &dh); + dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &_dh);if (dh ==NULL ) { msg ="nf_ct_dccp: short packet " ; goto out_invalid;
scripts/package/builddeb +11 -11
@@ -41,9 +41,9 @@ create_package() { parisc*) debarch=hppa ;; mips*) - debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;; + debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;; arm*) - debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;; + debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;; *) echo "" >&2 echo "** ** ** WARNING ** ** **" >&2
@@ -62,7 +62,7 @@ create_package() { fi # Create the package - dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir" + dpkg-gencontrol -isp $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir" dpkg --build "$pdir" .. }
@@ -105,12 +105,12 @@ fi if [ "$ARCH" = "um" ] ; then $MAKE linux cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" - cp .config "$tmpdir/usr/share/doc/$packagename/config" + cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config" gzip "$tmpdir/usr/share/doc/$packagename/config" cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version" else cp System.map "$tmpdir/boot/System.map-$version" - cp .config "$tmpdir/boot/config-$version" + cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version" # Not all arches include the boot path in KBUILD_IMAGE if [ -e $KBUILD_IMAGE ]; then cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
@@ -119,7 +119,7 @@ else fi fi -if grep -q '^CONFIG_MODULES=y' .config ; then +if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install if [ "$ARCH" = "um" ] ; then mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"
@@ -240,21 +240,21 @@ fi # Build header package (cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles") (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles") -(cd $objtree; find .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles") +(cd $objtree; find Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles") destdir=$kernel_headers_dir/usr/src/linux-headers-$version mkdir -p "$destdir" (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -) (cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -) +(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" -arch=$(dpkg --print-architecture) cat <<EOF >> debian/control Package: $kernel_headers_packagename Provides: linux-headers, linux-headers-2.6 -Architecture: $arch -Description: Linux kernel headers for $KERNELRELEASE on $arch - This package provides kernel header files for $KERNELRELEASE on $arch +Architecture: any +Description: Linux kernel headers for $KERNELRELEASE on \${kernel:debarch} + This package provides kernel header files for $KERNELRELEASE on \${kernel:debarch} . This is useful for people who need to build external modules EOF
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.57 release. There are 18 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 09 00:00:00 UTC 2014. Anything received after that time might be too late.
Build results:
total: 116 pass: 87 skipped: 22 fail: 7
qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
Quoted 10 lines · Guenter Roeck
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.57 release. There are 18 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 09 00:00:00 UTC 2014. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 116 pass: 87 skipped: 22 fail: 7qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Thanks for checking, Guenter.
Ben.
Signature · 2 lines
Ben Hutchings Sturgeon's Law: Ninety percent of everything is crap.