Annotation of /trunk/kernel-magellan/patches-3.9/0109-3.9.10-all-fixes.patch
Parent Directory | Revision Log
Revision 2236 -
(hide annotations)
(download)
Mon Jul 15 09:13:58 2013 UTC (11 years, 2 months ago) by niro
File size: 13530 byte(s)
Mon Jul 15 09:13:58 2013 UTC (11 years, 2 months ago) by niro
File size: 13530 byte(s)
-linux-3.9.10
1 | niro | 2236 | diff --git a/MAINTAINERS b/MAINTAINERS |
2 | index 8bdd7a7..2b0fb85 100644 | ||
3 | --- a/MAINTAINERS | ||
4 | +++ b/MAINTAINERS | ||
5 | @@ -7512,6 +7512,7 @@ STABLE BRANCH | ||
6 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
7 | L: stable@vger.kernel.org | ||
8 | S: Supported | ||
9 | +F: Documentation/stable_kernel_rules.txt | ||
10 | |||
11 | STAGING SUBSYSTEM | ||
12 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
13 | diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c | ||
14 | index 0af1807..0e2f2a4 100644 | ||
15 | --- a/arch/x86/kvm/vmx.c | ||
16 | +++ b/arch/x86/kvm/vmx.c | ||
17 | @@ -3259,15 +3259,22 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu, | ||
18 | var->limit = vmx_read_guest_seg_limit(vmx, seg); | ||
19 | var->selector = vmx_read_guest_seg_selector(vmx, seg); | ||
20 | ar = vmx_read_guest_seg_ar(vmx, seg); | ||
21 | + var->unusable = (ar >> 16) & 1; | ||
22 | var->type = ar & 15; | ||
23 | var->s = (ar >> 4) & 1; | ||
24 | var->dpl = (ar >> 5) & 3; | ||
25 | - var->present = (ar >> 7) & 1; | ||
26 | + /* | ||
27 | + * Some userspaces do not preserve unusable property. Since usable | ||
28 | + * segment has to be present according to VMX spec we can use present | ||
29 | + * property to amend userspace bug by making unusable segment always | ||
30 | + * nonpresent. vmx_segment_access_rights() already marks nonpresent | ||
31 | + * segment as unusable. | ||
32 | + */ | ||
33 | + var->present = !var->unusable; | ||
34 | var->avl = (ar >> 12) & 1; | ||
35 | var->l = (ar >> 13) & 1; | ||
36 | var->db = (ar >> 14) & 1; | ||
37 | var->g = (ar >> 15) & 1; | ||
38 | - var->unusable = (ar >> 16) & 1; | ||
39 | } | ||
40 | |||
41 | static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg) | ||
42 | diff --git a/block/genhd.c b/block/genhd.c | ||
43 | index 3c001fb..5098a64 100644 | ||
44 | --- a/block/genhd.c | ||
45 | +++ b/block/genhd.c | ||
46 | @@ -512,7 +512,7 @@ static void register_disk(struct gendisk *disk) | ||
47 | |||
48 | ddev->parent = disk->driverfs_dev; | ||
49 | |||
50 | - dev_set_name(ddev, disk->disk_name); | ||
51 | + dev_set_name(ddev, "%s", disk->disk_name); | ||
52 | |||
53 | /* delay uevents, until we scanned partition table */ | ||
54 | dev_set_uevent_suppress(ddev, 1); | ||
55 | diff --git a/crypto/algapi.c b/crypto/algapi.c | ||
56 | index 6149a6e..7a1ae87 100644 | ||
57 | --- a/crypto/algapi.c | ||
58 | +++ b/crypto/algapi.c | ||
59 | @@ -495,7 +495,8 @@ static struct crypto_template *__crypto_lookup_template(const char *name) | ||
60 | |||
61 | struct crypto_template *crypto_lookup_template(const char *name) | ||
62 | { | ||
63 | - return try_then_request_module(__crypto_lookup_template(name), name); | ||
64 | + return try_then_request_module(__crypto_lookup_template(name), "%s", | ||
65 | + name); | ||
66 | } | ||
67 | EXPORT_SYMBOL_GPL(crypto_lookup_template); | ||
68 | |||
69 | diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c | ||
70 | index 7fecc78..5b94137 100644 | ||
71 | --- a/drivers/block/nbd.c | ||
72 | +++ b/drivers/block/nbd.c | ||
73 | @@ -714,7 +714,8 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, | ||
74 | else | ||
75 | blk_queue_flush(nbd->disk->queue, 0); | ||
76 | |||
77 | - thread = kthread_create(nbd_thread, nbd, nbd->disk->disk_name); | ||
78 | + thread = kthread_create(nbd_thread, nbd, "%s", | ||
79 | + nbd->disk->disk_name); | ||
80 | if (IS_ERR(thread)) { | ||
81 | mutex_lock(&nbd->tx_lock); | ||
82 | return PTR_ERR(thread); | ||
83 | diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c | ||
84 | index d620b44..8a3aff7 100644 | ||
85 | --- a/drivers/cdrom/cdrom.c | ||
86 | +++ b/drivers/cdrom/cdrom.c | ||
87 | @@ -2882,7 +2882,7 @@ static noinline int mmc_ioctl_cdrom_read_data(struct cdrom_device_info *cdi, | ||
88 | if (lba < 0) | ||
89 | return -EINVAL; | ||
90 | |||
91 | - cgc->buffer = kmalloc(blocksize, GFP_KERNEL); | ||
92 | + cgc->buffer = kzalloc(blocksize, GFP_KERNEL); | ||
93 | if (cgc->buffer == NULL) | ||
94 | return -ENOMEM; | ||
95 | |||
96 | diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c | ||
97 | index 8acc3f8..d31557f 100644 | ||
98 | --- a/drivers/power/charger-manager.c | ||
99 | +++ b/drivers/power/charger-manager.c | ||
100 | @@ -450,7 +450,7 @@ static void uevent_notify(struct charger_manager *cm, const char *event) | ||
101 | strncpy(env_str, event, UEVENT_BUF_SIZE); | ||
102 | kobject_uevent(&cm->dev->kobj, KOBJ_CHANGE); | ||
103 | |||
104 | - dev_info(cm->dev, event); | ||
105 | + dev_info(cm->dev, "%s", event); | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c | ||
110 | index 0fab6b5..9d86947 100644 | ||
111 | --- a/drivers/scsi/osd/osd_uld.c | ||
112 | +++ b/drivers/scsi/osd/osd_uld.c | ||
113 | @@ -485,7 +485,7 @@ static int osd_probe(struct device *dev) | ||
114 | oud->class_dev.class = &osd_uld_class; | ||
115 | oud->class_dev.parent = dev; | ||
116 | oud->class_dev.release = __remove; | ||
117 | - error = dev_set_name(&oud->class_dev, disk->disk_name); | ||
118 | + error = dev_set_name(&oud->class_dev, "%s", disk->disk_name); | ||
119 | if (error) { | ||
120 | OSD_ERR("dev_set_name failed => %d\n", error); | ||
121 | goto err_put_cdev; | ||
122 | diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c | ||
123 | index 82910cc..0f0370f 100644 | ||
124 | --- a/drivers/scsi/sd.c | ||
125 | +++ b/drivers/scsi/sd.c | ||
126 | @@ -142,7 +142,7 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr, | ||
127 | char *buffer_data; | ||
128 | struct scsi_mode_data data; | ||
129 | struct scsi_sense_hdr sshdr; | ||
130 | - const char *temp = "temporary "; | ||
131 | + static const char temp[] = "temporary "; | ||
132 | int len; | ||
133 | |||
134 | if (sdp->type != TYPE_DISK) | ||
135 | diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c | ||
136 | index 26e3a97..c52948b 100644 | ||
137 | --- a/drivers/tty/serial/8250/8250_pci.c | ||
138 | +++ b/drivers/tty/serial/8250/8250_pci.c | ||
139 | @@ -4797,10 +4797,6 @@ static struct pci_device_id serial_pci_tbl[] = { | ||
140 | PCI_VENDOR_ID_IBM, 0x0299, | ||
141 | 0, 0, pbn_b0_bt_2_115200 }, | ||
142 | |||
143 | - { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835, | ||
144 | - 0x1000, 0x0012, | ||
145 | - 0, 0, pbn_b0_bt_2_115200 }, | ||
146 | - | ||
147 | { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901, | ||
148 | 0xA000, 0x1000, | ||
149 | 0, 0, pbn_b0_1_115200 }, | ||
150 | diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c | ||
151 | index 9b6b2b6..be661d8 100644 | ||
152 | --- a/fs/ceph/xattr.c | ||
153 | +++ b/fs/ceph/xattr.c | ||
154 | @@ -675,17 +675,18 @@ ssize_t ceph_getxattr(struct dentry *dentry, const char *name, void *value, | ||
155 | if (!ceph_is_valid_xattr(name)) | ||
156 | return -ENODATA; | ||
157 | |||
158 | - spin_lock(&ci->i_ceph_lock); | ||
159 | - dout("getxattr %p ver=%lld index_ver=%lld\n", inode, | ||
160 | - ci->i_xattrs.version, ci->i_xattrs.index_version); | ||
161 | |||
162 | /* let's see if a virtual xattr was requested */ | ||
163 | vxattr = ceph_match_vxattr(inode, name); | ||
164 | if (vxattr && !(vxattr->exists_cb && !vxattr->exists_cb(ci))) { | ||
165 | err = vxattr->getxattr_cb(ci, value, size); | ||
166 | - goto out; | ||
167 | + return err; | ||
168 | } | ||
169 | |||
170 | + spin_lock(&ci->i_ceph_lock); | ||
171 | + dout("getxattr %p ver=%lld index_ver=%lld\n", inode, | ||
172 | + ci->i_xattrs.version, ci->i_xattrs.index_version); | ||
173 | + | ||
174 | if (__ceph_caps_issued_mask(ci, CEPH_CAP_XATTR_SHARED, 1) && | ||
175 | (ci->i_xattrs.index_version >= ci->i_xattrs.version)) { | ||
176 | goto get_xattr; | ||
177 | diff --git a/fs/hpfs/map.c b/fs/hpfs/map.c | ||
178 | index 4acb19d..803d3da 100644 | ||
179 | --- a/fs/hpfs/map.c | ||
180 | +++ b/fs/hpfs/map.c | ||
181 | @@ -17,7 +17,8 @@ __le32 *hpfs_map_bitmap(struct super_block *s, unsigned bmp_block, | ||
182 | struct quad_buffer_head *qbh, char *id) | ||
183 | { | ||
184 | secno sec; | ||
185 | - if (hpfs_sb(s)->sb_chk) if (bmp_block * 16384 > hpfs_sb(s)->sb_fs_size) { | ||
186 | + unsigned n_bands = (hpfs_sb(s)->sb_fs_size + 0x3fff) >> 14; | ||
187 | + if (hpfs_sb(s)->sb_chk) if (bmp_block >= n_bands) { | ||
188 | hpfs_error(s, "hpfs_map_bitmap called with bad parameter: %08x at %s", bmp_block, id); | ||
189 | return NULL; | ||
190 | } | ||
191 | diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c | ||
192 | index a0617e7..962e90c 100644 | ||
193 | --- a/fs/hpfs/super.c | ||
194 | +++ b/fs/hpfs/super.c | ||
195 | @@ -558,7 +558,13 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) | ||
196 | sbi->sb_cp_table = NULL; | ||
197 | sbi->sb_c_bitmap = -1; | ||
198 | sbi->sb_max_fwd_alloc = 0xffffff; | ||
199 | - | ||
200 | + | ||
201 | + if (sbi->sb_fs_size >= 0x80000000) { | ||
202 | + hpfs_error(s, "invalid size in superblock: %08x", | ||
203 | + (unsigned)sbi->sb_fs_size); | ||
204 | + goto bail4; | ||
205 | + } | ||
206 | + | ||
207 | /* Load bitmap directory */ | ||
208 | if (!(sbi->sb_bmp_dir = hpfs_load_bitmap_directory(s, le32_to_cpu(superblock->bitmaps)))) | ||
209 | goto bail4; | ||
210 | diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c | ||
211 | index 6eb0dc5..a49c11b 100644 | ||
212 | --- a/fs/nfsd/nfs4xdr.c | ||
213 | +++ b/fs/nfsd/nfs4xdr.c | ||
214 | @@ -162,8 +162,8 @@ static __be32 *read_buf(struct nfsd4_compoundargs *argp, u32 nbytes) | ||
215 | */ | ||
216 | memcpy(p, argp->p, avail); | ||
217 | /* step to next page */ | ||
218 | - argp->p = page_address(argp->pagelist[0]); | ||
219 | argp->pagelist++; | ||
220 | + argp->p = page_address(argp->pagelist[0]); | ||
221 | if (argp->pagelen < PAGE_SIZE) { | ||
222 | argp->end = argp->p + (argp->pagelen>>2); | ||
223 | argp->pagelen = 0; | ||
224 | diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h | ||
225 | index df1ff7c..eea4106 100644 | ||
226 | --- a/include/linux/hugetlb.h | ||
227 | +++ b/include/linux/hugetlb.h | ||
228 | @@ -354,6 +354,17 @@ static inline int hstate_index(struct hstate *h) | ||
229 | return h - hstates; | ||
230 | } | ||
231 | |||
232 | +pgoff_t __basepage_index(struct page *page); | ||
233 | + | ||
234 | +/* Return page->index in PAGE_SIZE units */ | ||
235 | +static inline pgoff_t basepage_index(struct page *page) | ||
236 | +{ | ||
237 | + if (!PageCompound(page)) | ||
238 | + return page->index; | ||
239 | + | ||
240 | + return __basepage_index(page); | ||
241 | +} | ||
242 | + | ||
243 | #else /* CONFIG_HUGETLB_PAGE */ | ||
244 | struct hstate {}; | ||
245 | #define alloc_huge_page_node(h, nid) NULL | ||
246 | @@ -374,6 +385,11 @@ static inline unsigned int pages_per_huge_page(struct hstate *h) | ||
247 | } | ||
248 | #define hstate_index_to_shift(index) 0 | ||
249 | #define hstate_index(h) 0 | ||
250 | + | ||
251 | +static inline pgoff_t basepage_index(struct page *page) | ||
252 | +{ | ||
253 | + return page->index; | ||
254 | +} | ||
255 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
256 | |||
257 | #endif /* _LINUX_HUGETLB_H */ | ||
258 | diff --git a/kernel/futex.c b/kernel/futex.c | ||
259 | index b26dcfc..49dacfb 100644 | ||
260 | --- a/kernel/futex.c | ||
261 | +++ b/kernel/futex.c | ||
262 | @@ -61,6 +61,7 @@ | ||
263 | #include <linux/nsproxy.h> | ||
264 | #include <linux/ptrace.h> | ||
265 | #include <linux/sched/rt.h> | ||
266 | +#include <linux/hugetlb.h> | ||
267 | |||
268 | #include <asm/futex.h> | ||
269 | |||
270 | @@ -365,7 +366,7 @@ again: | ||
271 | } else { | ||
272 | key->both.offset |= FUT_OFF_INODE; /* inode-based key */ | ||
273 | key->shared.inode = page_head->mapping->host; | ||
274 | - key->shared.pgoff = page_head->index; | ||
275 | + key->shared.pgoff = basepage_index(page); | ||
276 | } | ||
277 | |||
278 | get_futex_key_refs(key); | ||
279 | diff --git a/kernel/module.c b/kernel/module.c | ||
280 | index 97f202c..a55f61b 100644 | ||
281 | --- a/kernel/module.c | ||
282 | +++ b/kernel/module.c | ||
283 | @@ -2939,7 +2939,6 @@ static struct module *layout_and_allocate(struct load_info *info, int flags) | ||
284 | { | ||
285 | /* Module within temporary copy. */ | ||
286 | struct module *mod; | ||
287 | - Elf_Shdr *pcpusec; | ||
288 | int err; | ||
289 | |||
290 | mod = setup_load_info(info, flags); | ||
291 | @@ -2954,17 +2953,10 @@ static struct module *layout_and_allocate(struct load_info *info, int flags) | ||
292 | err = module_frob_arch_sections(info->hdr, info->sechdrs, | ||
293 | info->secstrings, mod); | ||
294 | if (err < 0) | ||
295 | - goto out; | ||
296 | + return ERR_PTR(err); | ||
297 | |||
298 | - pcpusec = &info->sechdrs[info->index.pcpu]; | ||
299 | - if (pcpusec->sh_size) { | ||
300 | - /* We have a special allocation for this section. */ | ||
301 | - err = percpu_modalloc(mod, | ||
302 | - pcpusec->sh_size, pcpusec->sh_addralign); | ||
303 | - if (err) | ||
304 | - goto out; | ||
305 | - pcpusec->sh_flags &= ~(unsigned long)SHF_ALLOC; | ||
306 | - } | ||
307 | + /* We will do a special allocation for per-cpu sections later. */ | ||
308 | + info->sechdrs[info->index.pcpu].sh_flags &= ~(unsigned long)SHF_ALLOC; | ||
309 | |||
310 | /* Determine total sizes, and put offsets in sh_entsize. For now | ||
311 | this is done generically; there doesn't appear to be any | ||
312 | @@ -2975,17 +2967,22 @@ static struct module *layout_and_allocate(struct load_info *info, int flags) | ||
313 | /* Allocate and move to the final place */ | ||
314 | err = move_module(mod, info); | ||
315 | if (err) | ||
316 | - goto free_percpu; | ||
317 | + return ERR_PTR(err); | ||
318 | |||
319 | /* Module has been copied to its final place now: return it. */ | ||
320 | mod = (void *)info->sechdrs[info->index.mod].sh_addr; | ||
321 | kmemleak_load_module(mod, info); | ||
322 | return mod; | ||
323 | +} | ||
324 | |||
325 | -free_percpu: | ||
326 | - percpu_modfree(mod); | ||
327 | -out: | ||
328 | - return ERR_PTR(err); | ||
329 | +static int alloc_module_percpu(struct module *mod, struct load_info *info) | ||
330 | +{ | ||
331 | + Elf_Shdr *pcpusec = &info->sechdrs[info->index.pcpu]; | ||
332 | + if (!pcpusec->sh_size) | ||
333 | + return 0; | ||
334 | + | ||
335 | + /* We have a special allocation for this section. */ | ||
336 | + return percpu_modalloc(mod, pcpusec->sh_size, pcpusec->sh_addralign); | ||
337 | } | ||
338 | |||
339 | /* mod is no longer valid after this! */ | ||
340 | @@ -3249,6 +3246,11 @@ static int load_module(struct load_info *info, const char __user *uargs, | ||
341 | } | ||
342 | #endif | ||
343 | |||
344 | + /* To avoid stressing percpu allocator, do this once we're unique. */ | ||
345 | + err = alloc_module_percpu(mod, info); | ||
346 | + if (err) | ||
347 | + goto unlink_mod; | ||
348 | + | ||
349 | /* Now module is in final location, initialize linked lists, etc. */ | ||
350 | err = module_unload_init(mod); | ||
351 | if (err) | ||
352 | diff --git a/mm/hugetlb.c b/mm/hugetlb.c | ||
353 | index ce4cb19..2baa6e3 100644 | ||
354 | --- a/mm/hugetlb.c | ||
355 | +++ b/mm/hugetlb.c | ||
356 | @@ -690,6 +690,23 @@ int PageHuge(struct page *page) | ||
357 | } | ||
358 | EXPORT_SYMBOL_GPL(PageHuge); | ||
359 | |||
360 | +pgoff_t __basepage_index(struct page *page) | ||
361 | +{ | ||
362 | + struct page *page_head = compound_head(page); | ||
363 | + pgoff_t index = page_index(page_head); | ||
364 | + unsigned long compound_idx; | ||
365 | + | ||
366 | + if (!PageHuge(page_head)) | ||
367 | + return page_index(page); | ||
368 | + | ||
369 | + if (compound_order(page_head) >= MAX_ORDER) | ||
370 | + compound_idx = page_to_pfn(page) - page_to_pfn(page_head); | ||
371 | + else | ||
372 | + compound_idx = page - page_head; | ||
373 | + | ||
374 | + return (index << compound_order(page_head)) + compound_idx; | ||
375 | +} | ||
376 | + | ||
377 | static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid) | ||
378 | { | ||
379 | struct page *page; | ||
380 | diff --git a/mm/memcontrol.c b/mm/memcontrol.c | ||
381 | index f10c112..bd8b380 100644 | ||
382 | --- a/mm/memcontrol.c | ||
383 | +++ b/mm/memcontrol.c | ||
384 | @@ -6186,8 +6186,6 @@ mem_cgroup_css_online(struct cgroup *cont) | ||
385 | * call __mem_cgroup_free, so return directly | ||
386 | */ | ||
387 | mem_cgroup_put(memcg); | ||
388 | - if (parent->use_hierarchy) | ||
389 | - mem_cgroup_put(parent); | ||
390 | } | ||
391 | return error; | ||
392 | } | ||
393 | diff --git a/net/ceph/auth_none.c b/net/ceph/auth_none.c | ||
394 | index 925ca58..8c93fa8 100644 | ||
395 | --- a/net/ceph/auth_none.c | ||
396 | +++ b/net/ceph/auth_none.c | ||
397 | @@ -39,6 +39,11 @@ static int should_authenticate(struct ceph_auth_client *ac) | ||
398 | return xi->starting; | ||
399 | } | ||
400 | |||
401 | +static int build_request(struct ceph_auth_client *ac, void *buf, void *end) | ||
402 | +{ | ||
403 | + return 0; | ||
404 | +} | ||
405 | + | ||
406 | /* | ||
407 | * the generic auth code decode the global_id, and we carry no actual | ||
408 | * authenticate state, so nothing happens here. | ||
409 | @@ -106,6 +111,7 @@ static const struct ceph_auth_client_ops ceph_auth_none_ops = { | ||
410 | .destroy = destroy, | ||
411 | .is_authenticated = is_authenticated, | ||
412 | .should_authenticate = should_authenticate, | ||
413 | + .build_request = build_request, | ||
414 | .handle_reply = handle_reply, | ||
415 | .create_authorizer = ceph_auth_none_create_authorizer, | ||
416 | .destroy_authorizer = ceph_auth_none_destroy_authorizer, |