Skip to content

Commit e3f0f47

Browse files
author
Alex Shi
committed
Merge tag 'v4.4.59' into linux-linaro-lsk-v4.4
This is the 4.4.59 stable release
2 parents f1e991e + 61a4577 commit e3f0f47

18 files changed

Lines changed: 57 additions & 135 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 58
3+
SUBLEVEL = 59
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/c6x/kernel/ptrace.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -69,46 +69,6 @@ static int gpr_get(struct task_struct *target,
6969
0, sizeof(*regs));
7070
}
7171

72-
static int gpr_set(struct task_struct *target,
73-
const struct user_regset *regset,
74-
unsigned int pos, unsigned int count,
75-
const void *kbuf, const void __user *ubuf)
76-
{
77-
int ret;
78-
struct pt_regs *regs = task_pt_regs(target);
79-
80-
/* Don't copyin TSR or CSR */
81-
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
82-
&regs,
83-
0, PT_TSR * sizeof(long));
84-
if (ret)
85-
return ret;
86-
87-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
88-
PT_TSR * sizeof(long),
89-
(PT_TSR + 1) * sizeof(long));
90-
if (ret)
91-
return ret;
92-
93-
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
94-
&regs,
95-
(PT_TSR + 1) * sizeof(long),
96-
PT_CSR * sizeof(long));
97-
if (ret)
98-
return ret;
99-
100-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
101-
PT_CSR * sizeof(long),
102-
(PT_CSR + 1) * sizeof(long));
103-
if (ret)
104-
return ret;
105-
106-
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
107-
&regs,
108-
(PT_CSR + 1) * sizeof(long), -1);
109-
return ret;
110-
}
111-
11272
enum c6x_regset {
11373
REGSET_GPR,
11474
};
@@ -120,7 +80,6 @@ static const struct user_regset c6x_regsets[] = {
12080
.size = sizeof(u32),
12181
.align = sizeof(u32),
12282
.get = gpr_get,
123-
.set = gpr_set
12483
},
12584
};
12685

arch/h8300/kernel/ptrace.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ static int regs_get(struct task_struct *target,
9595
long *reg = (long *)&regs;
9696

9797
/* build user regs in buffer */
98-
for (r = 0; r < ARRAY_SIZE(register_offset); r++)
98+
BUILD_BUG_ON(sizeof(regs) % sizeof(long) != 0);
99+
for (r = 0; r < sizeof(regs) / sizeof(long); r++)
99100
*reg++ = h8300_get_reg(target, r);
100101

101102
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
@@ -113,7 +114,8 @@ static int regs_set(struct task_struct *target,
113114
long *reg;
114115

115116
/* build user regs in buffer */
116-
for (reg = (long *)&regs, r = 0; r < ARRAY_SIZE(register_offset); r++)
117+
BUILD_BUG_ON(sizeof(regs) % sizeof(long) != 0);
118+
for (reg = (long *)&regs, r = 0; r < sizeof(regs) / sizeof(long); r++)
117119
*reg++ = h8300_get_reg(target, r);
118120

119121
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
@@ -122,7 +124,7 @@ static int regs_set(struct task_struct *target,
122124
return ret;
123125

124126
/* write back to pt_regs */
125-
for (reg = (long *)&regs, r = 0; r < ARRAY_SIZE(register_offset); r++)
127+
for (reg = (long *)&regs, r = 0; r < sizeof(regs) / sizeof(long); r++)
126128
h8300_put_reg(target, r, *reg++);
127129
return 0;
128130
}

arch/metag/kernel/ptrace.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@
2424
* user_regset definitions.
2525
*/
2626

27+
static unsigned long user_txstatus(const struct pt_regs *regs)
28+
{
29+
unsigned long data = (unsigned long)regs->ctx.Flags;
30+
31+
if (regs->ctx.SaveMask & TBICTX_CBUF_BIT)
32+
data |= USER_GP_REGS_STATUS_CATCH_BIT;
33+
34+
return data;
35+
}
36+
2737
int metag_gp_regs_copyout(const struct pt_regs *regs,
2838
unsigned int pos, unsigned int count,
2939
void *kbuf, void __user *ubuf)
@@ -62,9 +72,7 @@ int metag_gp_regs_copyout(const struct pt_regs *regs,
6272
if (ret)
6373
goto out;
6474
/* TXSTATUS */
65-
data = (unsigned long)regs->ctx.Flags;
66-
if (regs->ctx.SaveMask & TBICTX_CBUF_BIT)
67-
data |= USER_GP_REGS_STATUS_CATCH_BIT;
75+
data = user_txstatus(regs);
6876
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
6977
&data, 4*25, 4*26);
7078
if (ret)
@@ -119,6 +127,7 @@ int metag_gp_regs_copyin(struct pt_regs *regs,
119127
if (ret)
120128
goto out;
121129
/* TXSTATUS */
130+
data = user_txstatus(regs);
122131
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
123132
&data, 4*25, 4*26);
124133
if (ret)
@@ -244,6 +253,8 @@ int metag_rp_state_copyin(struct pt_regs *regs,
244253
unsigned long long *ptr;
245254
int ret, i;
246255

256+
if (count < 4*13)
257+
return -EINVAL;
247258
/* Read the entire pipeline before making any changes */
248259
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
249260
&rp, 0, 4*13);
@@ -303,7 +314,7 @@ static int metag_tls_set(struct task_struct *target,
303314
const void *kbuf, const void __user *ubuf)
304315
{
305316
int ret;
306-
void __user *tls;
317+
void __user *tls = target->thread.tls_ptr;
307318

308319
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1);
309320
if (ret)

arch/mips/kernel/ptrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ static int fpr_set(struct task_struct *target,
485485
&target->thread.fpu,
486486
0, sizeof(elf_fpregset_t));
487487

488-
for (i = 0; i < NUM_FPU_REGS; i++) {
488+
BUILD_BUG_ON(sizeof(fpr_val) != sizeof(elf_fpreg_t));
489+
for (i = 0; i < NUM_FPU_REGS && count >= sizeof(elf_fpreg_t); i++) {
489490
err = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
490491
&fpr_val, i * sizeof(elf_fpreg_t),
491492
(i + 1) * sizeof(elf_fpreg_t));

arch/sparc/kernel/ptrace_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int genregs64_set(struct task_struct *target,
311311
}
312312

313313
if (!ret) {
314-
unsigned long y;
314+
unsigned long y = regs->y;
315315

316316
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
317317
&y,

drivers/pinctrl/qcom/pinctrl-msm.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,6 @@ static void msm_gpio_irq_unmask(struct irq_data *d)
597597

598598
spin_lock_irqsave(&pctrl->lock, flags);
599599

600-
val = readl(pctrl->regs + g->intr_status_reg);
601-
val &= ~BIT(g->intr_status_bit);
602-
writel(val, pctrl->regs + g->intr_status_reg);
603-
604600
val = readl(pctrl->regs + g->intr_cfg_reg);
605601
val |= BIT(g->intr_enable_bit);
606602
writel(val, pctrl->regs + g->intr_cfg_reg);

drivers/virtio/virtio_balloon.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ static int init_vqs(struct virtio_balloon *vb)
416416
* Prime this virtqueue with one buffer so the hypervisor can
417417
* use it to signal us later (it can't be broken yet!).
418418
*/
419+
update_balloon_stats(vb);
420+
419421
sg_init_one(&sg, vb->stats, sizeof vb->stats);
420422
if (virtqueue_add_outbuf(vb->stats_vq, &sg, 1, vb, GFP_KERNEL)
421423
< 0)

fs/ext4/crypto_key.c

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ void ext4_free_crypt_info(struct ext4_crypt_info *ci)
8888
if (!ci)
8989
return;
9090

91-
if (ci->ci_keyring_key)
92-
key_put(ci->ci_keyring_key);
9391
crypto_free_ablkcipher(ci->ci_ctfm);
9492
kmem_cache_free(ext4_crypt_info_cachep, ci);
9593
}
@@ -111,7 +109,7 @@ void ext4_free_encryption_info(struct inode *inode,
111109
ext4_free_crypt_info(ci);
112110
}
113111

114-
int _ext4_get_encryption_info(struct inode *inode)
112+
int ext4_get_encryption_info(struct inode *inode)
115113
{
116114
struct ext4_inode_info *ei = EXT4_I(inode);
117115
struct ext4_crypt_info *crypt_info;
@@ -128,22 +126,15 @@ int _ext4_get_encryption_info(struct inode *inode)
128126
char mode;
129127
int res;
130128

129+
if (ei->i_crypt_info)
130+
return 0;
131+
131132
if (!ext4_read_workqueue) {
132133
res = ext4_init_crypto();
133134
if (res)
134135
return res;
135136
}
136137

137-
retry:
138-
crypt_info = ACCESS_ONCE(ei->i_crypt_info);
139-
if (crypt_info) {
140-
if (!crypt_info->ci_keyring_key ||
141-
key_validate(crypt_info->ci_keyring_key) == 0)
142-
return 0;
143-
ext4_free_encryption_info(inode, crypt_info);
144-
goto retry;
145-
}
146-
147138
res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION,
148139
EXT4_XATTR_NAME_ENCRYPTION_CONTEXT,
149140
&ctx, sizeof(ctx));
@@ -166,7 +157,6 @@ int _ext4_get_encryption_info(struct inode *inode)
166157
crypt_info->ci_data_mode = ctx.contents_encryption_mode;
167158
crypt_info->ci_filename_mode = ctx.filenames_encryption_mode;
168159
crypt_info->ci_ctfm = NULL;
169-
crypt_info->ci_keyring_key = NULL;
170160
memcpy(crypt_info->ci_master_key, ctx.master_key_descriptor,
171161
sizeof(crypt_info->ci_master_key));
172162
if (S_ISREG(inode->i_mode))
@@ -206,7 +196,6 @@ int _ext4_get_encryption_info(struct inode *inode)
206196
keyring_key = NULL;
207197
goto out;
208198
}
209-
crypt_info->ci_keyring_key = keyring_key;
210199
if (keyring_key->type != &key_type_logon) {
211200
printk_once(KERN_WARNING
212201
"ext4: key type must be logon\n");
@@ -253,16 +242,13 @@ int _ext4_get_encryption_info(struct inode *inode)
253242
ext4_encryption_key_size(mode));
254243
if (res)
255244
goto out;
256-
memzero_explicit(raw_key, sizeof(raw_key));
257-
if (cmpxchg(&ei->i_crypt_info, NULL, crypt_info) != NULL) {
258-
ext4_free_crypt_info(crypt_info);
259-
goto retry;
260-
}
261-
return 0;
262245

246+
if (cmpxchg(&ei->i_crypt_info, NULL, crypt_info) == NULL)
247+
crypt_info = NULL;
263248
out:
264249
if (res == -ENOKEY)
265250
res = 0;
251+
key_put(keyring_key);
266252
ext4_free_crypt_info(crypt_info);
267253
memzero_explicit(raw_key, sizeof(raw_key));
268254
return res;

fs/ext4/ext4.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,23 +2330,11 @@ static inline void ext4_fname_free_filename(struct ext4_filename *fname) { }
23302330
/* crypto_key.c */
23312331
void ext4_free_crypt_info(struct ext4_crypt_info *ci);
23322332
void ext4_free_encryption_info(struct inode *inode, struct ext4_crypt_info *ci);
2333-
int _ext4_get_encryption_info(struct inode *inode);
23342333

23352334
#ifdef CONFIG_EXT4_FS_ENCRYPTION
23362335
int ext4_has_encryption_key(struct inode *inode);
23372336

2338-
static inline int ext4_get_encryption_info(struct inode *inode)
2339-
{
2340-
struct ext4_crypt_info *ci = EXT4_I(inode)->i_crypt_info;
2341-
2342-
if (!ci ||
2343-
(ci->ci_keyring_key &&
2344-
(ci->ci_keyring_key->flags & ((1 << KEY_FLAG_INVALIDATED) |
2345-
(1 << KEY_FLAG_REVOKED) |
2346-
(1 << KEY_FLAG_DEAD)))))
2347-
return _ext4_get_encryption_info(inode);
2348-
return 0;
2349-
}
2337+
int ext4_get_encryption_info(struct inode *inode);
23502338

23512339
static inline struct ext4_crypt_info *ext4_encryption_info(struct inode *inode)
23522340
{

0 commit comments

Comments
 (0)