3.12.37-stable review
Subsystems (3)
PATCH 150/176 time: settimeofday: Validate the values of tv from user
In reply to Jiri SlabyFrom: Sasha Levin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6ada1fc0e1c4775de0e043e1bd3ae9d065491aa5 upstream.
An unvalidated user input is multiplied by a constant, which can result in an undefined behaviour for large values. While this is validated later, we should avoid triggering undefined behaviour.
[jstultz: include trivial milisecond->microsecond correction noticed by Andy]
--- include/linux/time.h | 13 +++++++++++++ kernel/time.c | 4 ++++ 2 files changed, 17 insertions(+)
include/linux/time.h +13 -0
@@ -173,6 +173,19 @@ extern void getboottime(struct timespec *ts);extern void monotonic_to_bootbased (struct timespec *ts);extern void get_monotonic_boottime (struct timespec *ts); +static inline bool timeval_valid (const struct timeval *tv) +{ +/* Dates before 1970 are bogus */ +if (tv->tv_sec <0 ) +return false; + +/* Can't have more microseconds then a second */ +if (tv->tv_usec <0 || tv->tv_usec >=USEC_PER_SEC ) +return false; + +return true; +} +extern struct timespec timespec_trunc (struct timespec t,unsigned gran);extern int timekeeping_valid_for_hres (void );extern u64 timekeeping_max_deferment (void );
kernel/time.c +4 -0
@@ -195,6 +195,10 @@ SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv,if (tv) {if (copy_from_user (&user_tv, tv,sizeof (*tv)))return -EFAULT ; + +if (!timeval_valid (&user_tv)) +return -EINVAL ; + new_ts.tv_sec = user_tv.tv_sec; new_ts.tv_nsec = user_tv.tv_usec *NSEC_PER_USEC ; }
Signature · 1 line
2.2.2
PATCH 151/176 time: adjtimex: Validate the ADJ_FREQUENCY values
In reply to Jiri SlabyFrom: Sasha Levin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 5e5aeb4367b450a28f447f6d5ab57d8f2ab16a5f upstream.
Verify that the frequency value from userspace is valid and makes sense.
Unverified values can cause overflows later on.
--- kernel/time/ntp.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/time/ntp.c +7 -0
@@ -631,6 +631,13 @@ int ntp_validate_timex(struct timex *txc)if ((txc->modes &ADJ_SETOFFSET ) && (!capable (CAP_SYS_TIME )))return -EPERM ; +if (txc->modes &ADJ_FREQUENCY ) { +if (LONG_MIN /PPM_SCALE > txc->freq) +return -EINVAL ; +if (LONG_MAX /PPM_SCALE < txc->freq) +return -EINVAL ; + } +return 0 ; }
Signature · 1 line
2.2.2
PATCH 152/176 ARM: dts: imx25: Fix PWM "per" clocks
In reply to Jiri SlabyFrom: Fabio Estevam <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 7ecd0bde5bfea524a843ad8fa8cb66ccbce68779 upstream.
Currently PWM functionality is broken on mx25 due to the wrong assignment of the PWM "per" clock.
According to Documentation/devicetree/bindings/clock/imx25-clock.txt:
pwm_ipg_per 52
,so update the pwm "per" to use 'pwm_ipg_per' instead of 'per10' clock.
With this change PWM can work fine on mx25.
--- arch/arm/boot/dts/imx25.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx25.dtsi +4 -4
@@ -352,7 +352,7 @@ compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; #pwm-cells = <2>; reg = <0x53fa0000 0x4000>; - clocks = <&clks 106>, <&clks 36>; + clocks = <&clks 106>, <&clks 52>; clock-names = "ipg", "per"; interrupts = <36>; };
@@ -371,7 +371,7 @@ compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; #pwm-cells = <2>; reg = <0x53fa8000 0x4000>; - clocks = <&clks 107>, <&clks 36>; + clocks = <&clks 107>, <&clks 52>; clock-names = "ipg", "per"; interrupts = <41>; };
@@ -412,7 +412,7 @@ pwm4: pwm@53fc8000 { compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; reg = <0x53fc8000 0x4000>; - clocks = <&clks 108>, <&clks 36>; + clocks = <&clks 108>, <&clks 52>; clock-names = "ipg", "per"; interrupts = <42>; };
@@ -458,7 +458,7 @@ compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; #pwm-cells = <2>; reg = <0x53fe0000 0x4000>; - clocks = <&clks 105>, <&clks 36>; + clocks = <&clks 105>, <&clks 52>; clock-names = "ipg", "per"; interrupts = <26>; };
Signature · 1 line
2.2.2
PATCH 153/176 bus: mvebu-mbus: fix support of MBus window 13
In reply to Jiri SlabyFrom: Andrew Lunn <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 38bdf45f4aa5cb6186d50a29e6cbbd9d486a1519 upstream.
On Armada XP, 375 and 38x the MBus window 13 has the remap capability, like windows 0 to 7. However, the mvebu-mbus driver isn't currently taking into account this special case, which means that when window 13 is actually used, the remap registers are left to 0, making the device using this MBus window unavailable.
As a minimal fix for stable, don't use window 13. A full fix will follow later.
--- drivers/bus/mvebu-mbus.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/bus/mvebu-mbus.c +13 -0
@@ -181,12 +181,25 @@ static void mvebu_mbus_disable_window(struct mvebu_mbus_state *mbus, }/* Checks whether the given window number is available */ + +/* On Armada XP, 375 and 38x the MBus window 13 has the remap +* capability, like windows 0 to 7. However, the mvebu-mbus driver +* isn't currently taking into account this special case, which means +* that when window 13 is actually used, the remap registers are left +* to 0, making the device using this MBus window unavailable. The +* quick fix for stable is to not use window 13. A follow up patch +* will correctly handle this window. +*/ static int mvebu_mbus_window_is_free (struct mvebu_mbus_state *mbus,const int win) {void __iomem *addr = mbus->mbuswins_base + mbus->soc->win_cfg_offset (win);u32 ctrl =readl (addr +WIN_CTRL_OFF ); + +if (win ==13 ) +return false; +return !(ctrl &WIN_CTRL_ENABLE ); }
Signature · 1 line
2.2.2
PATCH 154/176 can: dev: fix crtlmode_supported check
In reply to Jiri SlabyFrom: Oliver Hartkopp <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 9b1087aa5e86448fe6ad40a58964e35f3ba423d5 upstream.
When changing flags in the CAN drivers ctrlmode the provided new content has to be checked whether the bits are allowed to be changed. The bits that are to be changed are given as a bitfield in cm->mask. Therefore checking against cm->flags is wrong as the content can hold any kind of values.
The iproute2 tool sets the bits in cm->mask and cm->flags depending on the detected command line options. To be robust against bogus user space applications additionally sanitize the provided flags with the provided mask.
--- drivers/net/can/dev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/can/dev.c +6 -2
@@ -643,10 +643,14 @@ static int can_changelink(struct net_device *dev,if (dev->flags &IFF_UP )return -EBUSY ; cm =nla_data (data[IFLA_CAN_CTRLMODE ]); -if (cm->flags & ~priv->ctrlmode_supported) + +/* check whether changed bits are allowed to be modified */ +if (cm->mask & ~priv->ctrlmode_supported)return -EOPNOTSUPP ; + +/* clear bits to be modified and copy the flag values */ priv->ctrlmode &= ~cm->mask; - priv->ctrlmode |= cm->flags; + priv->ctrlmode |= (cm->flags & cm->mask); }if (data[IFLA_CAN_BITTIMING ]) {
Signature · 1 line
2.2.2
PATCH 155/176 clocksource: exynos_mct: Fix bitmask regression for exynos4_mct_write
In reply to Jiri SlabyFrom: Tobias Jakobi <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8c38d28ba8da98f7102c31d35359b4dbe9d1f329 upstream.
EXYNOS4_MCT_L_MASK is defined as 0xffffff00, so applying this bitmask produces a number outside the range 0x00 to 0xff, which always results in execution of the default switch statement.
Obviously this is wrong and git history shows that the bitmask inversion was incorrectly set during a refactoring of the MCT code.
Fix this by putting the inversion at the correct position again.
--- drivers/clocksource/exynos_mct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/exynos_mct.c +2 -2
@@ -94,8 +94,8 @@ static void exynos4_mct_write(unsigned int value, unsigned long offset)__raw_writel (value, reg_base + offset);if (likely (offset >=EXYNOS4_MCT_L_BASE (0 ))) { - stat_addr = (offset & ~EXYNOS4_MCT_L_MASK ) +MCT_L_WSTAT_OFFSET ; -switch (offset &EXYNOS4_MCT_L_MASK ) { + stat_addr = (offset &EXYNOS4_MCT_L_MASK ) +MCT_L_WSTAT_OFFSET ; +switch (offset & ~EXYNOS4_MCT_L_MASK ) {case MCT_L_TCON_OFFSET : mask =1 <<3 ;/* L_TCON write status */ break ;
Signature · 1 line
2.2.2
PATCH 156/176 x86, hyperv: Mark the Hyper-V clocksource as being continuous
In reply to Jiri SlabyFrom: "K. Y. Srinivasan" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 32c6590d126836a062b3140ed52d898507987017 upstream.
The Hyper-V clocksource is continuous; mark it accordingly.
--- arch/x86/kernel/cpu/mshyperv.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/mshyperv.c +1 -0
@@ -63,6 +63,7 @@ static struct clocksource hyperv_cs = { .rating = 400, /* use this when running on Hyperv*/ .read = read_hv_clock, .mask = CLOCKSOURCE_MASK(64), + .flags = CLOCK_SOURCE_IS_CONTINUOUS, };static void __init ms_hyperv_init_platform (void )
Signature · 1 line
2.2.2
PATCH 157/176 x86/tsc: Change Fast TSC calibration failed from error to info
In reply to Jiri SlabyFrom: Alexandre Demers <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 520452172e6b318f3a8bd9d4fe1e25066393de25 upstream.
Many users see this message when booting without knowning that it is of no importance and that TSC calibration may have succeeded by another way.
As explained by Paul Bolle in
http://lkml.kernel.org/r/[email protected]
"Fast TSC calibration failed" should not be considered as an error since other calibration methods are being tried afterward. At most, those send a warning if they fail (not an error). So let's change the message from error to warning.
[ tglx: Make if pr_info. It's really not important at all ]
--- arch/x86/kernel/tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/tsc.c +1 -1
@@ -386,7 +386,7 @@ static unsigned long quick_pit_calibrate(void) goto success; } } -pr_err ("Fast TSC calibration failed\n" ); +pr_info ("Fast TSC calibration failed\n" );return 0 ; success:
Signature · 1 line
2.2.2
PATCH 158/176 x86, boot: Skip relocs when load address unchanged
In reply to Jiri SlabyFrom: Kees Cook <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f285f4a21c3253887caceed493089ece17579d59 upstream.
On 64-bit, relocation is not required unless the load address gets changed. Without this, relocations do unexpected things when the kernel is above 4G.
--- arch/x86/boot/compressed/misc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
arch/x86/boot/compressed/misc.c +8 -1
@@ -401,6 +401,8 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,unsigned char *output, unsigned long output_len) { + unsigned char *output_orig = output; + real_mode = rmode;sanitize_boot_params (real_mode);
@@ -439,7 +441,12 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,debug_putstr ("\nDecompressing Linux... " );decompress (input_data, input_len,NULL ,NULL , output,NULL , error);parse_elf (output); -handle_relocations (output, output_len); +/* +* 32-bit always performs relocations. 64-bit relocations are only +* needed if kASLR has chosen a different load address. +*/ +if (!IS_ENABLED (CONFIG_X86_64 ) || output != output_orig) +handle_relocations (output, output_len);debug_putstr ("done.\nBooting the kernel.\n" );return ; }
Signature · 1 line
2.2.2
PATCH 159/176 x86, tls, ldt: Stop checking lm in LDT_empty
In reply to Jiri SlabyFrom: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e30ab185c490e9a9381385529e0fd32f0a399495 upstream.
32-bit programs don't have an lm bit in their ABI, so they can't reliably cause LDT_empty to return true without resorting to memset. They shouldn't need to do this.
This should fix a longstanding, if minor, issue in all 64-bit kernels as well as a potential regression in the TLS hardening code.
--- arch/x86/include/asm/desc.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
arch/x86/include/asm/desc.h +2 -7
@@ -251,7 +251,8 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) gdt[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i]; } -#define _LDT_empty (info) \ +/* This intentionally ignores lm, since 32-bit apps don't have that field. */ +#define LDT_empty (info) \ ((info)->base_addr == 0 && \ (info)->limit == 0 && \ (info)->contents == 0 && \
@@ -261,12 +262,6 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) (info)->seg_not_present == 1 && \ (info)->useable == 0) -#ifdef CONFIG_X86_64 -#define LDT_empty (info) (_LDT_empty(info) && ((info)->lm == 0)) -#else -#define LDT_empty (info) (_LDT_empty(info)) -#endif -static inline void clear_LDT (void ) {set_ldt (NULL ,0 );
Signature · 1 line
2.2.2
PATCH 160/176 x86, tls: Interpret an all-zero struct user_desc as "no segment"
In reply to Jiri SlabyFrom: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3669ef9fa7d35f573ec9c0e0341b29251c2734a7 upstream.
The Witcher 2 did something like this to allocate a TLS segment index:
struct user_desc u_info;
bzero(&u_info, sizeof(u_info));
u_info.entry_number = (uint32_t)-1;
syscall(SYS_set_thread_area, &u_info);Strictly speaking, this code was never correct. It should have set read_exec_only and seg_not_present to 1 to indicate that it wanted to find a free slot without putting anything there, or it should have put something sensible in the TLS slot if it wanted to allocate a TLS entry for real. The actual effect of this code was to allocate a bogus segment that could be used to exploit espfix.
The set_thread_area hardening patches changed the behavior, causing set_thread_area to return -EINVAL and crashing the game.
This changes set_thread_area to interpret this as a request to find a free slot and to leave it empty, which isn't *quite* what the game expects but should be close enough to keep it working. In particular, using the code above to allocate two segments will allocate the same segment both times.
According to FrostbittenKing on Github, this fixes The Witcher 2.
If this somehow still causes problems, we could instead allocate a limit==0 32-bit data segment, but that seems rather ugly to me.
--- arch/x86/include/asm/desc.h | 13 +++++++++++++ arch/x86/kernel/tls.c | 25 +++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-)
arch/x86/include/asm/desc.h +13 -0
@@ -262,6 +262,19 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) (info)->seg_not_present == 1 && \ (info)->useable == 0) +/* Lots of programs expect an all-zero user_desc to mean "no segment at all". */ +static inline bool LDT_zero (const struct user_desc *info) +{ +return (info->base_addr ==0 && + info->limit ==0 && + info->contents ==0 && + info->read_exec_only ==0 && + info->seg_32bit ==0 && + info->limit_in_pages ==0 && + info->seg_not_present ==0 && + info->useable ==0 ); +} +static inline void clear_LDT (void ) {set_ldt (NULL ,0 );
arch/x86/kernel/tls.c +23 -2
@@ -29,7 +29,28 @@ static int get_free_idx(void)static bool tls_desc_okay (const struct user_desc *info) { -if (LDT_empty (info)) +/* +* For historical reasons (i.e. no one ever documented how any +* of the segmentation APIs work), user programs can and do +* assume that a struct user_desc that's all zeros except for +* entry_number means "no segment at all". This never actually +* worked. In fact, up to Linux 3.19, a struct user_desc like +* this would create a 16-bit read-write segment with base and +* limit both equal to zero. +* +* That was close enough to "no segment at all" until we +* hardened this function to disallow 16-bit TLS segments. Fix +* it up by interpreting these zeroed segments the way that they +* were almost certainly intended to be interpreted. +* +* The correct way to ask for "no segment at all" is to specify +* a user_desc that satisfies LDT_empty. To keep everything +* working, we accept both. +* +* Note that there's a similar kludge in modify_ldt -- look at +* the distinction between modes 1 and 0x11. +*/ +if (LDT_empty (info) ||LDT_zero (info))return true;/*
@@ -71,7 +92,7 @@ static void set_tls_desc(struct task_struct *p, int idx, cpu =get_cpu ();while (n-- >0 ) { -if (LDT_empty (info)) +if (LDT_empty (info) ||LDT_zero (info)) desc->a = desc->b =0 ;else fill_ldt (desc, info);
Signature · 1 line
2.2.2
PATCH 161/176 x86/apic: Re-enable PCI_MSI support for non-SMP X86_32
In reply to Jiri SlabyFrom: Bryan O'Donoghue <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 38a1dfda8e77d7ba74c94d06d8bc41ba98a4bc8c upstream.
Commit 0dbc6078c06bc0 ('x86, build, pci: Fix PCI_MSI build on !SMP') introduced the dependency that X86_UP_APIC is only available when PCI_MSI is false. This effectively prevents PCI_MSI support on 32bit UP systems because it disables both APIC and IO-APIC. But APIC support is architecturally required for PCI_MSI.
The intention of the patch was to enforce APIC support when PCI_MSI is enabled, but failed to do so.
Remove the !PCI_MSI dependency from X86_UP_APIC and enforce X86_UP_APIC when PCI_MSI support is enabled on 32bit UP systems.
[ tglx: Massaged changelog ]
Fixes 0dbc6078c06bc0 'x86, build, pci: Fix PCI_MSI build on !SMP'
--- arch/x86/Kconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/x86/Kconfig +5 -1
@@ -861,7 +861,7 @@ source "kernel/Kconfig.preempt" config X86_UP_APIC bool "Local APIC support on uniprocessors" - depends on X86_32 && !SMP && !X86_32_NON_STANDARD && !PCI_MSI + depends on X86_32 && !SMP && !X86_32_NON_STANDARD ---help--- A local APIC (Advanced Programmable Interrupt Controller) is an integrated interrupt controller in the CPU. If you have a single-CPU
@@ -872,6 +872,10 @@ config X86_UP_APIC performance counters), and the NMI watchdog which detects hard lockups. +config X86_UP_APIC_MSI + def_bool y + select X86_UP_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD && PCI_MSI + config X86_UP_IOAPIC bool "IO-APIC support on uniprocessors" depends on X86_UP_APIC
Signature · 1 line
2.2.2
PATCH 162/176 x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs
In reply to Jiri SlabyFrom: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 7ddc6a2199f1da405a2fb68c40db8899b1a8cd87 upstream.
These functions can be executed on the int3 stack, so kprobes are dangerous. Tracing is probably a bad idea, too.
[bwh: Backported to 3.10:
- Use __kprobes instead of NOKPROBE_SYMBOL()
- Adjust context]
--- arch/x86/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/traps.c +2 -2
@@ -369,7 +369,7 @@ exit:* for scheduling or signal handling. The actual stack switch is done in * entry.S */ -asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) +asmlinkage notrace __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) {struct pt_regs *regs = eregs;/* Did already sync */
@@ -394,7 +394,7 @@ struct bad_iret_stack {struct pt_regs regs; }; -asmlinkage __visible +asmlinkage __visible notrace __kprobesstruct bad_iret_stack *fixup_bad_iret (struct bad_iret_stack *s) {/*
Signature · 1 line
2.2.2
PATCH 163/176 sata_dwc_460ex: fix resource leak on error path
In reply to Jiri SlabyFrom: Andy Shevchenko <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4aaa71873ddb9faf4b0c4826579e2f6d18ff9ab4 upstream.
DMA mapped IO should be unmapped on the error path in probe() and unconditionally on remove().
--- drivers/ata/sata_dwc_460ex.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/ata/sata_dwc_460ex.c +12 -14
@@ -797,7 +797,7 @@ static int dma_dwc_init(struct sata_dwc_device *hsdev, int irq)if (err) {dev_err (host_pvt.dwc_dev,"%s: dma_request_interrupts returns" " %d\n" , __func__, err); - goto error_out; +return err; }/* Enabe DMA */
@@ -808,11 +808,6 @@ static int dma_dwc_init(struct sata_dwc_device *hsdev, int irq) sata_dma_regs);return 0 ; - -error_out: -dma_dwc_exit (hsdev); - -return err; }static int sata_dwc_scr_read (struct ata_link *link,unsigned int scr,u32 *val)
@@ -1662,7 +1657,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)char *ver = (char *)&versionr;u8 *base =NULL ;int err =0 ; -int irq, rc; +int irq;struct ata_host *host;struct ata_port_info pi = sata_dwc_port_info[0 ];const struct ata_port_info *ppi[] = { &pi,NULL };
@@ -1725,7 +1720,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)if (irq ==NO_IRQ ) {dev_err (&ofdev->dev,"no SATA DMA irq\n" ); err = -ENODEV ; - goto error_out; + goto error_iomap; }/* Get physical SATA DMA register base address */
@@ -1734,14 +1729,16 @@ static int sata_dwc_probe(struct platform_device *ofdev)dev_err (&ofdev->dev,"ioremap failed for AHBDMA register" " address\n" ); err = -ENODEV ; - goto error_out; + goto error_iomap; }/* Save dev for later use in dev_xxx() routines */ host_pvt.dwc_dev = &ofdev->dev;/* Initialize AHB DMAC */ -dma_dwc_init (hsdev, irq); + err =dma_dwc_init (hsdev, irq); +if (err) + goto error_dma_iomap;/* Enable SATA Interrupts */ sata_dwc_enable_interrupts (hsdev);
@@ -1759,9 +1756,8 @@ static int sata_dwc_probe(struct platform_device *ofdev)* device discovery process, invoking our port_start() handler & * error_handler() to execute a dummy Softreset EH session */ - rc =ata_host_activate (host, irq, sata_dwc_isr,0 , &sata_dwc_sht); - -if (rc !=0 ) + err =ata_host_activate (host, irq, sata_dwc_isr,0 , &sata_dwc_sht); +if (err)dev_err (&ofdev->dev,"failed to activate host" );dev_set_drvdata (&ofdev->dev, host);
@@ -1770,7 +1766,8 @@ static int sata_dwc_probe(struct platform_device *ofdev) error_out:/* Free SATA DMA resources */ dma_dwc_exit (hsdev); - +error_dma_iomap: +iounmap ((void __iomem *)host_pvt.sata_dma_regs); error_iomap:iounmap (base); error_kmalloc:
@@ -1791,6 +1788,7 @@ static int sata_dwc_remove(struct platform_device *ofdev)/* Free SATA DMA resources */ dma_dwc_exit (hsdev); +iounmap ((void __iomem *)host_pvt.sata_dma_regs);iounmap (hsdev->reg_base);kfree (hsdev);kfree (host);
Signature · 1 line
2.2.2
PATCH 164/176 KEYS: close race between key lookup and freeing
In reply to Jiri SlabyFrom: Sasha Levin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a3a8784454692dd72e5d5d34dcdab17b4420e74c upstream.
When a key is being garbage collected, it's key->user would get put before the ->destroy() callback is called, where the key is removed from it's respective tracking structures.
This leaves a key hanging in a semi-invalid state which leaves a window open for a different task to try an access key->user. An example is find_keyring_by_name() which would dereference key->user for a key that is in the process of being garbage collected (where key->user was freed but ->destroy() wasn't called yet - so it's still present in the linked list).
This would cause either a panic, or corrupt memory.
Fixes CVE-2014-9529.
--- security/keys/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/keys/gc.c +2 -2
@@ -201,12 +201,12 @@ static noinline void key_gc_unused_keys(struct list_head *keys)if (test_bit (KEY_FLAG_INSTANTIATED , &key->flags))atomic_dec (&key->user->nikeys); -key_user_put (key->user); -/* now throw away the key memory */ if (key->type->destroy) key->type->destroy (key); +key_user_put (key->user); +kfree (key->description);#ifdef KEY_DEBUGGING
Signature · 1 line
2.2.2
PATCH 165/176 ipvs: uninitialized data with IP_VS_IPV6
In reply to Jiri SlabyFrom: Dan Carpenter <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3b05ac3824ed9648c0d9c02d51d9b54e4e7e874f upstream.
The app_tcp_pkt_out() function expects "*diff" to be set and ends up using uninitialized data if CONFIG_IP_VS_IPV6 is turned on.
The same issue is there in app_tcp_pkt_in(). Thanks to Julian Anastasov for noticing that.
--- net/netfilter/ipvs/ip_vs_ftp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
net/netfilter/ipvs/ip_vs_ftp.c +5 -5
@@ -183,6 +183,8 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,struct nf_conn *ct;struct net *net; + *diff =0 ; +#ifdef CONFIG_IP_VS_IPV6 /* This application helper doesn't work with IPv6 yet, * so turn this into a no-op for IPv6 packets
@@ -191,8 +193,6 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,return 1 ;#endif - *diff =0 ; -/* Only useful for established sessions */ if (cp->state !=IP_VS_TCP_S_ESTABLISHED )return 1 ;
@@ -321,6 +321,9 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,struct ip_vs_conn *n_cp;struct net *net; +/* no diff required for incoming packets */ + *diff =0 ; +#ifdef CONFIG_IP_VS_IPV6 /* This application helper doesn't work with IPv6 yet, * so turn this into a no-op for IPv6 packets
@@ -329,9 +332,6 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,return 1 ;#endif -/* no diff required for incoming packets */ - *diff =0 ; -/* Only useful for established sessions */ if (cp->state !=IP_VS_TCP_S_ESTABLISHED )return 1 ;
Signature · 1 line
2.2.2
PATCH 167/176 crypto: prefix module autoloading with "crypto-"
In reply to Jiri SlabyFrom: Kees Cook <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 5d26a105b5a73e5635eae0629b42fa0a90e07b7b upstream.
This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause:
https://lkml.org/lkml/2013/3/4/70
--- arch/arm/crypto/aes_glue.c | 4 ++-- arch/arm/crypto/sha1_glue.c | 2 +- arch/powerpc/crypto/sha1.c | 2 +- arch/s390/crypto/aes_s390.c | 2 +- arch/s390/crypto/des_s390.c | 4 ++-- arch/s390/crypto/ghash_s390.c | 2 +- arch/s390/crypto/sha1_s390.c | 2 +- arch/s390/crypto/sha256_s390.c | 4 ++-- arch/s390/crypto/sha512_s390.c | 4 ++-- arch/sparc/crypto/aes_glue.c | 2 +- arch/sparc/crypto/camellia_glue.c | 2 +- arch/sparc/crypto/crc32c_glue.c | 2 +- arch/sparc/crypto/des_glue.c | 2 +- arch/sparc/crypto/md5_glue.c | 2 +- arch/sparc/crypto/sha1_glue.c | 2 +- arch/sparc/crypto/sha256_glue.c | 4 ++-- arch/sparc/crypto/sha512_glue.c | 4 ++-- arch/x86/crypto/aes_glue.c | 4 ++-- arch/x86/crypto/aesni-intel_glue.c | 2 +- arch/x86/crypto/blowfish_glue.c | 4 ++-- arch/x86/crypto/camellia_aesni_avx2_glue.c | 4 ++-- arch/x86/crypto/camellia_aesni_avx_glue.c | 4 ++-- arch/x86/crypto/camellia_glue.c | 4 ++-- arch/x86/crypto/cast5_avx_glue.c | 2 +- arch/x86/crypto/cast6_avx_glue.c | 2 +- arch/x86/crypto/crc32-pclmul_glue.c | 4 ++-- arch/x86/crypto/crc32c-intel_glue.c | 4 ++-- arch/x86/crypto/crct10dif-pclmul_glue.c | 4 ++-- arch/x86/crypto/ghash-clmulni-intel_glue.c | 2 +- arch/x86/crypto/salsa20_glue.c | 4 ++-- arch/x86/crypto/serpent_avx2_glue.c | 4 ++-- arch/x86/crypto/serpent_avx_glue.c | 2 +- arch/x86/crypto/serpent_sse2_glue.c | 2 +- arch/x86/crypto/sha1_ssse3_glue.c | 2 +- arch/x86/crypto/sha256_ssse3_glue.c | 4 ++-- arch/x86/crypto/sha512_ssse3_glue.c | 4 ++-- arch/x86/crypto/twofish_avx_glue.c | 2 +- arch/x86/crypto/twofish_glue.c | 4 ++-- arch/x86/crypto/twofish_glue_3way.c | 4 ++-- crypto/842.c | 1 + crypto/aes_generic.c | 2 +- crypto/ansi_cprng.c | 2 +- crypto/anubis.c | 1 + crypto/api.c | 4 ++-- crypto/arc4.c | 1 + crypto/blowfish_generic.c | 2 +- crypto/camellia_generic.c | 2 +- crypto/cast5_generic.c | 2 +- crypto/cast6_generic.c | 2 +- crypto/ccm.c | 4 ++-- crypto/crc32.c | 1 + crypto/crct10dif_generic.c | 2 +- crypto/crypto_null.c | 6 +++--- crypto/ctr.c | 2 +- crypto/deflate.c | 2 +- crypto/des_generic.c | 4 ++-- crypto/fcrypt.c | 1 + crypto/gcm.c | 6 +++--- crypto/ghash-generic.c | 2 +- crypto/khazad.c | 1 + crypto/krng.c | 2 +- crypto/lz4.c | 1 + crypto/lz4hc.c | 1 + crypto/lzo.c | 1 + crypto/md4.c | 2 +- crypto/md5.c | 1 + crypto/michael_mic.c | 1 + crypto/rmd128.c | 1 + crypto/rmd160.c | 1 + crypto/rmd256.c | 1 + crypto/rmd320.c | 1 + crypto/salsa20_generic.c | 2 +- crypto/seed.c | 1 + crypto/serpent_generic.c | 4 ++-- crypto/sha1_generic.c | 2 +- crypto/sha256_generic.c | 4 ++-- crypto/sha512_generic.c | 4 ++-- crypto/tea.c | 4 ++-- crypto/tgr192.c | 4 ++-- crypto/twofish_generic.c | 2 +- crypto/wp512.c | 4 ++-- crypto/zlib.c | 1 + drivers/crypto/padlock-aes.c | 2 +- drivers/crypto/padlock-sha.c | 8 ++++---- drivers/crypto/ux500/cryp/cryp_core.c | 4 ++-- drivers/crypto/ux500/hash/hash_core.c | 8 ++++---- drivers/s390/crypto/ap_bus.c | 3 ++- include/linux/crypto.h | 13 +++++++++++++ 88 files changed, 141 insertions(+), 110 deletions(-)
arch/arm/crypto/aes_glue.c +2 -2
@@ -103,6 +103,6 @@ module_exit(aes_fini);MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm (ASM)" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("aes" ); -MODULE_ALIAS ("aes-asm" ); +MODULE_ALIAS_CRYPTO ("aes" ); +MODULE_ALIAS_CRYPTO ("aes-asm" );MODULE_AUTHOR ("David McCullough <[email protected]>" );
arch/arm/crypto/sha1_glue.c +1 -1
@@ -175,5 +175,5 @@ module_exit(sha1_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm (ARM)" ); -MODULE_ALIAS ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1" );MODULE_AUTHOR ("David McCullough <[email protected]>" );
arch/powerpc/crypto/sha1.c +1 -1
@@ -154,4 +154,4 @@ module_exit(sha1_powerpc_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm" ); -MODULE_ALIAS ("sha1-powerpc" ); +MODULE_ALIAS_CRYPTO ("sha1-powerpc" );
arch/s390/crypto/aes_s390.c +1 -1
@@ -967,7 +967,7 @@ static void __exit aes_s390_fini(void)module_init (aes_s390_init);module_exit (aes_s390_fini); -MODULE_ALIAS ("aes-all" ); +MODULE_ALIAS_CRYPTO ("aes-all" );MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm" );MODULE_LICENSE ("GPL" );
arch/s390/crypto/des_s390.c +2 -2
@@ -616,8 +616,8 @@ static void __exit des_s390_exit(void)module_init (des_s390_init);module_exit (des_s390_exit); -MODULE_ALIAS ("des" ); -MODULE_ALIAS ("des3_ede" ); +MODULE_ALIAS_CRYPTO ("des" ); +MODULE_ALIAS_CRYPTO ("des3_ede" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("DES & Triple DES EDE Cipher Algorithms" );
arch/s390/crypto/ghash_s390.c +1 -1
@@ -160,7 +160,7 @@ static void __exit ghash_mod_exit(void)module_init (ghash_mod_init);module_exit (ghash_mod_exit); -MODULE_ALIAS ("ghash" ); +MODULE_ALIAS_CRYPTO ("ghash" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("GHASH Message Digest Algorithm, s390 implementation" );
arch/s390/crypto/sha1_s390.c +1 -1
@@ -103,6 +103,6 @@ static void __exit sha1_s390_fini(void)module_init (sha1_s390_init);module_exit (sha1_s390_fini); -MODULE_ALIAS ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm" );
arch/s390/crypto/sha256_s390.c +2 -2
@@ -143,7 +143,7 @@ static void __exit sha256_s390_fini(void)module_init (sha256_s390_init);module_exit (sha256_s390_fini); -MODULE_ALIAS ("sha256" ); -MODULE_ALIAS ("sha224" ); +MODULE_ALIAS_CRYPTO ("sha256" ); +MODULE_ALIAS_CRYPTO ("sha224" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA256 and SHA224 Secure Hash Algorithm" );
arch/s390/crypto/sha512_s390.c +2 -2
@@ -86,7 +86,7 @@ static struct shash_alg sha512_alg = { } }; -MODULE_ALIAS ("sha512" ); +MODULE_ALIAS_CRYPTO ("sha512" );static int sha384_init (struct shash_desc *desc) {
@@ -126,7 +126,7 @@ static struct shash_alg sha384_alg = { } }; -MODULE_ALIAS ("sha384" ); +MODULE_ALIAS_CRYPTO ("sha384" );static int __init init (void ) {
arch/sparc/crypto/aes_glue.c +1 -1
@@ -499,6 +499,6 @@ module_exit(aes_sparc64_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("AES Secure Hash Algorithm, sparc64 aes opcode accelerated" ); -MODULE_ALIAS ("aes" ); +MODULE_ALIAS_CRYPTO ("aes" );#include "crop_devid.c"
arch/sparc/crypto/camellia_glue.c +1 -1
@@ -322,6 +322,6 @@ module_exit(camellia_sparc64_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Camellia Cipher Algorithm, sparc64 camellia opcode accelerated" ); -MODULE_ALIAS ("aes" ); +MODULE_ALIAS_CRYPTO ("aes" );#include "crop_devid.c"
arch/sparc/crypto/crc32c_glue.c +1 -1
@@ -176,6 +176,6 @@ module_exit(crc32c_sparc64_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("CRC32c (Castagnoli), sparc64 crc32c opcode accelerated" ); -MODULE_ALIAS ("crc32c" ); +MODULE_ALIAS_CRYPTO ("crc32c" );#include "crop_devid.c"
arch/sparc/crypto/des_glue.c +1 -1
@@ -532,6 +532,6 @@ module_exit(des_sparc64_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("DES & Triple DES EDE Cipher Algorithms, sparc64 des opcode accelerated" ); -MODULE_ALIAS ("des" ); +MODULE_ALIAS_CRYPTO ("des" );#include "crop_devid.c"
arch/sparc/crypto/md5_glue.c +1 -1
@@ -185,6 +185,6 @@ module_exit(md5_sparc64_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("MD5 Secure Hash Algorithm, sparc64 md5 opcode accelerated" ); -MODULE_ALIAS ("md5" ); +MODULE_ALIAS_CRYPTO ("md5" );#include "crop_devid.c"
arch/sparc/crypto/sha1_glue.c +1 -1
@@ -180,6 +180,6 @@ module_exit(sha1_sparc64_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm, sparc64 sha1 opcode accelerated" ); -MODULE_ALIAS ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1" );#include "crop_devid.c"
arch/sparc/crypto/sha256_glue.c +2 -2
@@ -237,7 +237,7 @@ module_exit(sha256_sparc64_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA-224 and SHA-256 Secure Hash Algorithm, sparc64 sha256 opcode accelerated" ); -MODULE_ALIAS ("sha224" ); -MODULE_ALIAS ("sha256" ); +MODULE_ALIAS_CRYPTO ("sha224" ); +MODULE_ALIAS_CRYPTO ("sha256" );#include "crop_devid.c"
arch/sparc/crypto/sha512_glue.c +2 -2
@@ -222,7 +222,7 @@ module_exit(sha512_sparc64_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA-384 and SHA-512 Secure Hash Algorithm, sparc64 sha512 opcode accelerated" ); -MODULE_ALIAS ("sha384" ); -MODULE_ALIAS ("sha512" ); +MODULE_ALIAS_CRYPTO ("sha384" ); +MODULE_ALIAS_CRYPTO ("sha512" );#include "crop_devid.c"
arch/x86/crypto/aes_glue.c +2 -2
@@ -66,5 +66,5 @@ module_exit(aes_fini);MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm, asm optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("aes" ); -MODULE_ALIAS ("aes-asm" ); +MODULE_ALIAS_CRYPTO ("aes" ); +MODULE_ALIAS_CRYPTO ("aes-asm" );
arch/x86/crypto/aesni-intel_glue.c +1 -1
@@ -1373,4 +1373,4 @@ module_exit(aesni_exit);MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm, Intel AES-NI instructions optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("aes" ); +MODULE_ALIAS_CRYPTO ("aes" );
arch/x86/crypto/blowfish_glue.c +2 -2
@@ -481,5 +481,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Blowfish Cipher Algorithm, asm optimized" ); -MODULE_ALIAS ("blowfish" ); -MODULE_ALIAS ("blowfish-asm" ); +MODULE_ALIAS_CRYPTO ("blowfish" ); +MODULE_ALIAS_CRYPTO ("blowfish-asm" );
arch/x86/crypto/camellia_aesni_avx2_glue.c +2 -2
@@ -582,5 +582,5 @@ module_exit(camellia_aesni_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Camellia Cipher Algorithm, AES-NI/AVX2 optimized" ); -MODULE_ALIAS ("camellia" ); -MODULE_ALIAS ("camellia-asm" ); +MODULE_ALIAS_CRYPTO ("camellia" ); +MODULE_ALIAS_CRYPTO ("camellia-asm" );
arch/x86/crypto/camellia_aesni_avx_glue.c +2 -2
@@ -574,5 +574,5 @@ module_exit(camellia_aesni_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Camellia Cipher Algorithm, AES-NI/AVX optimized" ); -MODULE_ALIAS ("camellia" ); -MODULE_ALIAS ("camellia-asm" ); +MODULE_ALIAS_CRYPTO ("camellia" ); +MODULE_ALIAS_CRYPTO ("camellia-asm" );
arch/x86/crypto/camellia_glue.c +2 -2
@@ -1725,5 +1725,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Camellia Cipher Algorithm, asm optimized" ); -MODULE_ALIAS ("camellia" ); -MODULE_ALIAS ("camellia-asm" ); +MODULE_ALIAS_CRYPTO ("camellia" ); +MODULE_ALIAS_CRYPTO ("camellia-asm" );
arch/x86/crypto/cast5_avx_glue.c +1 -1
@@ -494,4 +494,4 @@ module_exit(cast5_exit);MODULE_DESCRIPTION ("Cast5 Cipher Algorithm, AVX optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("cast5" ); +MODULE_ALIAS_CRYPTO ("cast5" );
arch/x86/crypto/cast6_avx_glue.c +1 -1
@@ -611,4 +611,4 @@ module_exit(cast6_exit);MODULE_DESCRIPTION ("Cast6 Cipher Algorithm, AVX optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("cast6" ); +MODULE_ALIAS_CRYPTO ("cast6" );
arch/x86/crypto/crc32-pclmul_glue.c +2 -2
@@ -197,5 +197,5 @@ module_exit(crc32_pclmul_mod_fini);MODULE_AUTHOR ("Alexander Boyko <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("crc32" ); -MODULE_ALIAS ("crc32-pclmul" ); +MODULE_ALIAS_CRYPTO ("crc32" ); +MODULE_ALIAS_CRYPTO ("crc32-pclmul" );
arch/x86/crypto/crc32c-intel_glue.c +2 -2
@@ -280,5 +280,5 @@ MODULE_AUTHOR("Austin Zhang <[email protected]>, Kent Liu <[email protected]MODULE_DESCRIPTION ("CRC32c (Castagnoli) optimization using Intel Hardware." );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("crc32c" ); -MODULE_ALIAS ("crc32c-intel" ); +MODULE_ALIAS_CRYPTO ("crc32c" ); +MODULE_ALIAS_CRYPTO ("crc32c-intel" );
arch/x86/crypto/crct10dif-pclmul_glue.c +2 -2
@@ -147,5 +147,5 @@ MODULE_AUTHOR("Tim Chen <[email protected]>");MODULE_DESCRIPTION ("T10 DIF CRC calculation accelerated with PCLMULQDQ." );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("crct10dif" ); -MODULE_ALIAS ("crct10dif-pclmul" ); +MODULE_ALIAS_CRYPTO ("crct10dif" ); +MODULE_ALIAS_CRYPTO ("crct10dif-pclmul" );
arch/x86/crypto/ghash-clmulni-intel_glue.c +1 -1
@@ -341,4 +341,4 @@ module_exit(ghash_pclmulqdqni_mod_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("GHASH Message Digest Algorithm, " "acclerated by PCLMULQDQ-NI" ); -MODULE_ALIAS ("ghash" ); +MODULE_ALIAS_CRYPTO ("ghash" );
arch/x86/crypto/salsa20_glue.c +2 -2
@@ -119,5 +119,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm (optimized assembly version)" ); -MODULE_ALIAS ("salsa20" ); -MODULE_ALIAS ("salsa20-asm" ); +MODULE_ALIAS_CRYPTO ("salsa20" ); +MODULE_ALIAS_CRYPTO ("salsa20-asm" );
arch/x86/crypto/serpent_avx2_glue.c +2 -2
@@ -558,5 +558,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Serpent Cipher Algorithm, AVX2 optimized" ); -MODULE_ALIAS ("serpent" ); -MODULE_ALIAS ("serpent-asm" ); +MODULE_ALIAS_CRYPTO ("serpent" ); +MODULE_ALIAS_CRYPTO ("serpent-asm" );
arch/x86/crypto/serpent_avx_glue.c +1 -1
@@ -617,4 +617,4 @@ module_exit(serpent_exit);MODULE_DESCRIPTION ("Serpent Cipher Algorithm, AVX optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("serpent" ); +MODULE_ALIAS_CRYPTO ("serpent" );
arch/x86/crypto/serpent_sse2_glue.c +1 -1
@@ -618,4 +618,4 @@ module_exit(serpent_sse2_exit);MODULE_DESCRIPTION ("Serpent Cipher Algorithm, SSE2 optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("serpent" ); +MODULE_ALIAS_CRYPTO ("serpent" );
arch/x86/crypto/sha1_ssse3_glue.c +1 -1
@@ -237,4 +237,4 @@ module_exit(sha1_ssse3_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm, Supplemental SSE3 accelerated" ); -MODULE_ALIAS ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1" );
arch/x86/crypto/sha256_ssse3_glue.c +2 -2
@@ -318,5 +318,5 @@ module_exit(sha256_ssse3_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA256 Secure Hash Algorithm, Supplemental SSE3 accelerated" ); -MODULE_ALIAS ("sha256" ); -MODULE_ALIAS ("sha224" ); +MODULE_ALIAS_CRYPTO ("sha256" ); +MODULE_ALIAS_CRYPTO ("sha224" );
arch/x86/crypto/sha512_ssse3_glue.c +2 -2
@@ -326,5 +326,5 @@ module_exit(sha512_ssse3_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA512 Secure Hash Algorithm, Supplemental SSE3 accelerated" ); -MODULE_ALIAS ("sha512" ); -MODULE_ALIAS ("sha384" ); +MODULE_ALIAS_CRYPTO ("sha512" ); +MODULE_ALIAS_CRYPTO ("sha384" );
arch/x86/crypto/twofish_avx_glue.c +1 -1
@@ -579,4 +579,4 @@ module_exit(twofish_exit);MODULE_DESCRIPTION ("Twofish Cipher Algorithm, AVX optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish" );
arch/x86/crypto/twofish_glue.c +2 -2
@@ -96,5 +96,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Twofish Cipher Algorithm, asm optimized" ); -MODULE_ALIAS ("twofish" ); -MODULE_ALIAS ("twofish-asm" ); +MODULE_ALIAS_CRYPTO ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish-asm" );
arch/x86/crypto/twofish_glue_3way.c +2 -2
@@ -495,5 +495,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Twofish Cipher Algorithm, 3-way parallel asm optimized" ); -MODULE_ALIAS ("twofish" ); -MODULE_ALIAS ("twofish-asm" ); +MODULE_ALIAS_CRYPTO ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish-asm" );
crypto/842.c +1 -0
@@ -180,3 +180,4 @@ module_exit(nx842_mod_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("842 Compression Algorithm" ); +MODULE_ALIAS_CRYPTO ("842" );
crypto/aes_generic.c +1 -1
@@ -1474,4 +1474,4 @@ module_exit(aes_fini);MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm" );MODULE_LICENSE ("Dual BSD/GPL" ); -MODULE_ALIAS ("aes" ); +MODULE_ALIAS_CRYPTO ("aes" );
crypto/ansi_cprng.c +1 -1
@@ -476,4 +476,4 @@ module_param(dbg, int, 0);MODULE_PARM_DESC (dbg,"Boolean to enable debugging (0/1 == off/on)" );module_init (prng_mod_init);module_exit (prng_mod_fini); -MODULE_ALIAS ("stdrng" ); +MODULE_ALIAS_CRYPTO ("stdrng" );
crypto/anubis.c +1 -0
@@ -704,3 +704,4 @@ module_exit(anubis_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Anubis Cryptographic Algorithm" ); +MODULE_ALIAS_CRYPTO ("anubis" );
crypto/api.c +2 -2
@@ -216,11 +216,11 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask) alg =crypto_alg_lookup (name, type, mask);if (!alg) { -request_module ("%s" , name); +request_module ("crypto-%s" , name);if (!((type ^CRYPTO_ALG_NEED_FALLBACK ) & mask &CRYPTO_ALG_NEED_FALLBACK )) -request_module ("%s-all" , name); +request_module ("crypto-%s-all" , name); alg =crypto_alg_lookup (name, type, mask); }
crypto/arc4.c +1 -0
@@ -166,3 +166,4 @@ module_exit(arc4_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("ARC4 Cipher Algorithm" );MODULE_AUTHOR ("Jon Oberheide <[email protected]>" ); +MODULE_ALIAS_CRYPTO ("arc4" );
crypto/blowfish_generic.c +1 -1
@@ -138,4 +138,4 @@ module_exit(blowfish_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Blowfish Cipher Algorithm" ); -MODULE_ALIAS ("blowfish" ); +MODULE_ALIAS_CRYPTO ("blowfish" );
crypto/camellia_generic.c +1 -1
@@ -1098,4 +1098,4 @@ module_exit(camellia_fini);MODULE_DESCRIPTION ("Camellia Cipher Algorithm" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("camellia" ); +MODULE_ALIAS_CRYPTO ("camellia" );
crypto/cast5_generic.c +1 -1
@@ -549,4 +549,4 @@ module_exit(cast5_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Cast5 Cipher Algorithm" ); -MODULE_ALIAS ("cast5" ); +MODULE_ALIAS_CRYPTO ("cast5" );
crypto/cast6_generic.c +1 -1
@@ -291,4 +291,4 @@ module_exit(cast6_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Cast6 Cipher Algorithm" ); -MODULE_ALIAS ("cast6" ); +MODULE_ALIAS_CRYPTO ("cast6" );
crypto/ccm.c +2 -2
@@ -879,5 +879,5 @@ module_exit(crypto_ccm_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Counter with CBC MAC" ); -MODULE_ALIAS ("ccm_base" ); -MODULE_ALIAS ("rfc4309" ); +MODULE_ALIAS_CRYPTO ("ccm_base" ); +MODULE_ALIAS_CRYPTO ("rfc4309" );
crypto/crc32.c +1 -0
@@ -156,3 +156,4 @@ module_exit(crc32_mod_fini);MODULE_AUTHOR ("Alexander Boyko <[email protected]>" );MODULE_DESCRIPTION ("CRC32 calculations wrapper for lib/crc32" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS_CRYPTO ("crc32" );
crypto/crct10dif_generic.c +1 -1
@@ -124,4 +124,4 @@ module_exit(crct10dif_mod_fini);MODULE_AUTHOR ("Tim Chen <[email protected]>" );MODULE_DESCRIPTION ("T10 DIF CRC calculation." );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("crct10dif" ); +MODULE_ALIAS_CRYPTO ("crct10dif" );
crypto/crypto_null.c +3 -3
@@ -149,9 +149,9 @@ static struct crypto_alg null_algs[3] = { { .coa_decompress = null_compress } } } }; -MODULE_ALIAS ("compress_null" ); -MODULE_ALIAS ("digest_null" ); -MODULE_ALIAS ("cipher_null" ); +MODULE_ALIAS_CRYPTO ("compress_null" ); +MODULE_ALIAS_CRYPTO ("digest_null" ); +MODULE_ALIAS_CRYPTO ("cipher_null" );static int __init crypto_null_mod_init (void ) {
crypto/ctr.c +1 -1
@@ -466,4 +466,4 @@ module_exit(crypto_ctr_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("CTR Counter block mode" ); -MODULE_ALIAS ("rfc3686" ); +MODULE_ALIAS_CRYPTO ("rfc3686" );
crypto/deflate.c +1 -1
@@ -222,4 +222,4 @@ module_exit(deflate_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Deflate Compression Algorithm for IPCOMP" );MODULE_AUTHOR ("James Morris <[email protected]>" ); - +MODULE_ALIAS_CRYPTO ("deflate" );
crypto/des_generic.c +2 -2
@@ -971,7 +971,7 @@ static struct crypto_alg des_algs[2] = { { .cia_decrypt = des3_ede_decrypt } } } }; -MODULE_ALIAS ("des3_ede" ); +MODULE_ALIAS_CRYPTO ("des3_ede" );static int __init des_generic_mod_init (void ) {
@@ -989,4 +989,4 @@ module_exit(des_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("DES & Triple DES EDE Cipher Algorithms" );MODULE_AUTHOR ("Dag Arne Osvik <[email protected]>" ); -MODULE_ALIAS ("des" ); +MODULE_ALIAS_CRYPTO ("des" );
crypto/fcrypt.c +1 -0
@@ -420,3 +420,4 @@ module_exit(fcrypt_mod_fini);MODULE_LICENSE ("Dual BSD/GPL" );MODULE_DESCRIPTION ("FCrypt Cipher Algorithm" );MODULE_AUTHOR ("David Howells <[email protected]>" ); +MODULE_ALIAS_CRYPTO ("fcrypt" );
crypto/gcm.c +3 -3
@@ -1441,6 +1441,6 @@ module_exit(crypto_gcm_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Galois/Counter Mode" );MODULE_AUTHOR ("Mikko Herranen <[email protected]>" ); -MODULE_ALIAS ("gcm_base" ); -MODULE_ALIAS ("rfc4106" ); -MODULE_ALIAS ("rfc4543" ); +MODULE_ALIAS_CRYPTO ("gcm_base" ); +MODULE_ALIAS_CRYPTO ("rfc4106" ); +MODULE_ALIAS_CRYPTO ("rfc4543" );
crypto/ghash-generic.c +1 -1
@@ -172,4 +172,4 @@ module_exit(ghash_mod_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("GHASH Message Digest Algorithm" ); -MODULE_ALIAS ("ghash" ); +MODULE_ALIAS_CRYPTO ("ghash" );
crypto/khazad.c +1 -0
@@ -880,3 +880,4 @@ module_exit(khazad_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Khazad Cryptographic Algorithm" ); +MODULE_ALIAS_CRYPTO ("khazad" );
crypto/krng.c +1 -1
@@ -62,4 +62,4 @@ module_exit(krng_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Kernel Random Number Generator" ); -MODULE_ALIAS ("stdrng" ); +MODULE_ALIAS_CRYPTO ("stdrng" );
crypto/lz4.c +1 -0
@@ -104,3 +104,4 @@ module_exit(lz4_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("LZ4 Compression Algorithm" ); +MODULE_ALIAS_CRYPTO ("lz4" );
crypto/lz4hc.c +1 -0
@@ -104,3 +104,4 @@ module_exit(lz4hc_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("LZ4HC Compression Algorithm" ); +MODULE_ALIAS_CRYPTO ("lz4hc" );
crypto/lzo.c +1 -0
@@ -103,3 +103,4 @@ module_exit(lzo_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("LZO Compression Algorithm" ); +MODULE_ALIAS_CRYPTO ("lzo" );
crypto/md4.c +1 -1
@@ -255,4 +255,4 @@ module_exit(md4_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("MD4 Message Digest Algorithm" ); - +MODULE_ALIAS_CRYPTO ("md4" );
crypto/md5.c +1 -0
@@ -168,3 +168,4 @@ module_exit(md5_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("MD5 Message Digest Algorithm" ); +MODULE_ALIAS_CRYPTO ("md5" );
crypto/michael_mic.c +1 -0
@@ -184,3 +184,4 @@ module_exit(michael_mic_exit);MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("Michael MIC" );MODULE_AUTHOR ("Jouni Malinen <[email protected]>" ); +MODULE_ALIAS_CRYPTO ("michael_mic" );
crypto/rmd128.c +1 -0
@@ -327,3 +327,4 @@ module_exit(rmd128_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Adrian-Ken Rueegsegger <[email protected]>" );MODULE_DESCRIPTION ("RIPEMD-128 Message Digest" ); +MODULE_ALIAS_CRYPTO ("rmd128" );
crypto/rmd160.c +1 -0
@@ -371,3 +371,4 @@ module_exit(rmd160_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Adrian-Ken Rueegsegger <[email protected]>" );MODULE_DESCRIPTION ("RIPEMD-160 Message Digest" ); +MODULE_ALIAS_CRYPTO ("rmd160" );
crypto/rmd256.c +1 -0
@@ -346,3 +346,4 @@ module_exit(rmd256_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Adrian-Ken Rueegsegger <[email protected]>" );MODULE_DESCRIPTION ("RIPEMD-256 Message Digest" ); +MODULE_ALIAS_CRYPTO ("rmd256" );
crypto/rmd320.c +1 -0
@@ -395,3 +395,4 @@ module_exit(rmd320_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Adrian-Ken Rueegsegger <[email protected]>" );MODULE_DESCRIPTION ("RIPEMD-320 Message Digest" ); +MODULE_ALIAS_CRYPTO ("rmd320" );
crypto/salsa20_generic.c +1 -1
@@ -248,4 +248,4 @@ module_exit(salsa20_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm" ); -MODULE_ALIAS ("salsa20" ); +MODULE_ALIAS_CRYPTO ("salsa20" );
crypto/seed.c +1 -0
@@ -476,3 +476,4 @@ module_exit(seed_fini);MODULE_DESCRIPTION ("SEED Cipher Algorithm" );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Hye-Shik Chang <[email protected]>, Kim Hyun <[email protected]>" ); +MODULE_ALIAS_CRYPTO ("seed" );
crypto/serpent_generic.c +2 -2
@@ -665,5 +665,5 @@ module_exit(serpent_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm" );MODULE_AUTHOR ("Dag Arne Osvik <[email protected]>" ); -MODULE_ALIAS ("tnepres" ); -MODULE_ALIAS ("serpent" ); +MODULE_ALIAS_CRYPTO ("tnepres" ); +MODULE_ALIAS_CRYPTO ("serpent" );
crypto/sha1_generic.c +1 -1
@@ -153,4 +153,4 @@ module_exit(sha1_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm" ); -MODULE_ALIAS ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1" );
crypto/sha256_generic.c +2 -2
@@ -384,5 +384,5 @@ module_exit(sha256_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA-224 and SHA-256 Secure Hash Algorithm" ); -MODULE_ALIAS ("sha224" ); -MODULE_ALIAS ("sha256" ); +MODULE_ALIAS_CRYPTO ("sha224" ); +MODULE_ALIAS_CRYPTO ("sha256" );
crypto/sha512_generic.c +2 -2
@@ -287,5 +287,5 @@ module_exit(sha512_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA-512 and SHA-384 Secure Hash Algorithms" ); -MODULE_ALIAS ("sha384" ); -MODULE_ALIAS ("sha512" ); +MODULE_ALIAS_CRYPTO ("sha384" ); +MODULE_ALIAS_CRYPTO ("sha512" );
crypto/tea.c +2 -2
@@ -270,8 +270,8 @@ static void __exit tea_mod_fini(void)crypto_unregister_algs (tea_algs,ARRAY_SIZE (tea_algs)); } -MODULE_ALIAS ("xtea" ); -MODULE_ALIAS ("xeta" ); +MODULE_ALIAS_CRYPTO ("xtea" ); +MODULE_ALIAS_CRYPTO ("xeta" );module_init (tea_mod_init);module_exit (tea_mod_fini);
crypto/tgr192.c +2 -2
@@ -676,8 +676,8 @@ static void __exit tgr192_mod_fini(void)crypto_unregister_shashes (tgr_algs,ARRAY_SIZE (tgr_algs)); } -MODULE_ALIAS ("tgr160" ); -MODULE_ALIAS ("tgr128" ); +MODULE_ALIAS_CRYPTO ("tgr160" ); +MODULE_ALIAS_CRYPTO ("tgr128" );module_init (tgr192_mod_init);module_exit (tgr192_mod_fini);
crypto/twofish_generic.c +1 -1
@@ -211,4 +211,4 @@ module_exit(twofish_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Twofish Cipher Algorithm" ); -MODULE_ALIAS ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish" );
crypto/wp512.c +2 -2
@@ -1167,8 +1167,8 @@ static void __exit wp512_mod_fini(void)crypto_unregister_shashes (wp_algs,ARRAY_SIZE (wp_algs)); } -MODULE_ALIAS ("wp384" ); -MODULE_ALIAS ("wp256" ); +MODULE_ALIAS_CRYPTO ("wp384" ); +MODULE_ALIAS_CRYPTO ("wp256" );module_init (wp512_mod_init);module_exit (wp512_mod_fini);
crypto/zlib.c +1 -0
@@ -378,3 +378,4 @@ module_exit(zlib_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Zlib Compression Algorithm" );MODULE_AUTHOR ("Sony Corporation" ); +MODULE_ALIAS_CRYPTO ("zlib" );
drivers/crypto/padlock-aes.c +1 -1
@@ -563,4 +563,4 @@ MODULE_DESCRIPTION("VIA PadLock AES algorithm support");MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Michal Ludvig" ); -MODULE_ALIAS ("aes" ); +MODULE_ALIAS_CRYPTO ("aes" );
drivers/crypto/padlock-sha.c +4 -4
@@ -593,7 +593,7 @@ MODULE_DESCRIPTION("VIA PadLock SHA1/SHA256 algorithms support.");MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Michal Ludvig" ); -MODULE_ALIAS ("sha1-all" ); -MODULE_ALIAS ("sha256-all" ); -MODULE_ALIAS ("sha1-padlock" ); -MODULE_ALIAS ("sha256-padlock" ); +MODULE_ALIAS_CRYPTO ("sha1-all" ); +MODULE_ALIAS_CRYPTO ("sha256-all" ); +MODULE_ALIAS_CRYPTO ("sha1-padlock" ); +MODULE_ALIAS_CRYPTO ("sha256-padlock" );
drivers/crypto/ux500/cryp/cryp_core.c +2 -2
@@ -1810,7 +1810,7 @@ module_exit(ux500_cryp_mod_fini);module_param (cryp_mode, int,0 );MODULE_DESCRIPTION ("Driver for ST-Ericsson UX500 CRYP crypto engine." ); -MODULE_ALIAS ("aes-all" ); -MODULE_ALIAS ("des-all" ); +MODULE_ALIAS_CRYPTO ("aes-all" ); +MODULE_ALIAS_CRYPTO ("des-all" );MODULE_LICENSE ("GPL" );
drivers/crypto/ux500/hash/hash_core.c +4 -4
@@ -1995,7 +1995,7 @@ module_exit(ux500_hash_mod_fini);MODULE_DESCRIPTION ("Driver for ST-Ericsson UX500 HASH engine." );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("sha1-all" ); -MODULE_ALIAS ("sha256-all" ); -MODULE_ALIAS ("hmac-sha1-all" ); -MODULE_ALIAS ("hmac-sha256-all" ); +MODULE_ALIAS_CRYPTO ("sha1-all" ); +MODULE_ALIAS_CRYPTO ("sha256-all" ); +MODULE_ALIAS_CRYPTO ("hmac-sha1-all" ); +MODULE_ALIAS_CRYPTO ("hmac-sha256-all" );
drivers/s390/crypto/ap_bus.c +2 -1
@@ -44,6 +44,7 @@#include <linux/hrtimer.h> #include <linux/ktime.h> #include <asm/facility.h> +#include <linux/crypto.h> #include "ap_bus.h"
@@ -71,7 +72,7 @@ MODULE_AUTHOR("IBM Corporation");MODULE_DESCRIPTION ("Adjunct Processor Bus driver, " \"Copyright IBM Corp. 2006, 2012" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("z90crypt" ); +MODULE_ALIAS_CRYPTO ("z90crypt" );/* * Module parameter
include/linux/crypto.h +13 -0
@@ -26,6 +26,19 @@#include <linux/uaccess.h> /* +* Autoloaded crypto modules should only use a prefixed name to avoid allowing +* arbitrary modules to be loaded. Loading from userspace may still need the +* unprefixed names, so retains those aliases as well. +* This uses __MODULE_INFO directly instead of MODULE_ALIAS because pre-4.3 +* gcc (e.g. avr32 toolchain) uses __LINE__ for uniqueness, and this macro +* expands twice on the same line. Instead, use a separate base name for the +* alias. +*/ +#define MODULE_ALIAS_CRYPTO (name) \ + __MODULE_INFO(alias, alias_userspace, name); \ + __MODULE_INFO(alias, alias_crypto, "crypto-" name) + +/* * Algorithm masks and types. */ #define CRYPTO_ALG_TYPE_MASK 0x0000000f
Signature · 1 line
2.2.2
PATCH 168/176 crypto: include crypto- module prefix in template
In reply to Jiri SlabyFrom: Kees Cook <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4943ba16bbc2db05115707b3ff7b4874e9e3c560 upstream.
This adds the module loading prefix "crypto-" to the template lookup as well.
For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly includes the "crypto-" prefix at every level, correctly rejecting "vfat":
net-pf-38 algif-hash crypto-vfat(blowfish) crypto-vfat(blowfish)-all crypto-vfat
--- arch/x86/crypto/fpu.c | 3 +++ crypto/algapi.c | 4 ++-- crypto/authenc.c | 1 + crypto/authencesn.c | 1 + crypto/cbc.c | 1 + crypto/ccm.c | 1 + crypto/chainiv.c | 1 + crypto/cmac.c | 1 + crypto/cryptd.c | 1 + crypto/ctr.c | 1 + crypto/cts.c | 1 + crypto/ecb.c | 1 + crypto/eseqiv.c | 1 + crypto/gcm.c | 1 + crypto/hmac.c | 1 + crypto/lrw.c | 1 + crypto/pcbc.c | 1 + crypto/pcrypt.c | 1 + crypto/seqiv.c | 1 + crypto/vmac.c | 1 + crypto/xcbc.c | 1 + crypto/xts.c | 1 + 22 files changed, 25 insertions(+), 2 deletions(-)
arch/x86/crypto/fpu.c +3 -0
@@ -17,6 +17,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h> +#include <linux/crypto.h> #include <asm/i387.h> struct crypto_fpu_ctx {
@@ -159,3 +160,5 @@ void __exit crypto_fpu_exit(void) {crypto_unregister_template (&crypto_fpu_tmpl); } + +MODULE_ALIAS_CRYPTO ("fpu" );
crypto/algapi.c +2 -2
@@ -495,8 +495,8 @@ static struct crypto_template *__crypto_lookup_template(const char *name)struct crypto_template *crypto_lookup_template (const char *name) { -return try_then_request_module (__crypto_lookup_template (name),"%s" , - name); +return try_then_request_module (__crypto_lookup_template (name), +"crypto-%s" , name); }EXPORT_SYMBOL_GPL (crypto_lookup_template);
crypto/authenc.c +1 -0
@@ -709,3 +709,4 @@ module_exit(crypto_authenc_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Simple AEAD wrapper for IPsec" ); +MODULE_ALIAS_CRYPTO ("authenc" );
crypto/authencesn.c +1 -0
@@ -832,3 +832,4 @@ module_exit(crypto_authenc_esn_module_exit);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Steffen Klassert <[email protected]>" );MODULE_DESCRIPTION ("AEAD wrapper for IPsec with extended sequence numbers" ); +MODULE_ALIAS_CRYPTO ("authencesn" );
crypto/cbc.c +1 -0
@@ -289,3 +289,4 @@ module_exit(crypto_cbc_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("CBC block cipher algorithm" ); +MODULE_ALIAS_CRYPTO ("cbc" );
crypto/ccm.c +1 -0
@@ -881,3 +881,4 @@ MODULE_LICENSE("GPL");MODULE_DESCRIPTION ("Counter with CBC MAC" );MODULE_ALIAS_CRYPTO ("ccm_base" );MODULE_ALIAS_CRYPTO ("rfc4309" ); +MODULE_ALIAS_CRYPTO ("ccm" );
crypto/chainiv.c +1 -0
@@ -359,3 +359,4 @@ module_exit(chainiv_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Chain IV Generator" ); +MODULE_ALIAS_CRYPTO ("chainiv" );
crypto/cmac.c +1 -0
@@ -313,3 +313,4 @@ module_exit(crypto_cmac_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("CMAC keyed hash algorithm" ); +MODULE_ALIAS_CRYPTO ("cmac" );
crypto/cryptd.c +1 -0
@@ -955,3 +955,4 @@ module_exit(cryptd_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Software async crypto daemon" ); +MODULE_ALIAS_CRYPTO ("cryptd" );
crypto/ctr.c +1 -0
@@ -467,3 +467,4 @@ module_exit(crypto_ctr_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("CTR Counter block mode" );MODULE_ALIAS_CRYPTO ("rfc3686" ); +MODULE_ALIAS_CRYPTO ("ctr" );
crypto/cts.c +1 -0
@@ -350,3 +350,4 @@ module_exit(crypto_cts_module_exit);MODULE_LICENSE ("Dual BSD/GPL" );MODULE_DESCRIPTION ("CTS-CBC CipherText Stealing for CBC" ); +MODULE_ALIAS_CRYPTO ("cts" );
crypto/ecb.c +1 -0
@@ -185,3 +185,4 @@ module_exit(crypto_ecb_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("ECB block cipher algorithm" ); +MODULE_ALIAS_CRYPTO ("ecb" );
crypto/eseqiv.c +1 -0
@@ -267,3 +267,4 @@ module_exit(eseqiv_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Encrypted Sequence Number IV Generator" ); +MODULE_ALIAS_CRYPTO ("eseqiv" );
crypto/gcm.c +1 -0
@@ -1444,3 +1444,4 @@ MODULE_AUTHOR("Mikko Herranen <[email protected]>");MODULE_ALIAS_CRYPTO ("gcm_base" );MODULE_ALIAS_CRYPTO ("rfc4106" );MODULE_ALIAS_CRYPTO ("rfc4543" ); +MODULE_ALIAS_CRYPTO ("gcm" );
crypto/hmac.c +1 -0
@@ -271,3 +271,4 @@ module_exit(hmac_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("HMAC hash algorithm" ); +MODULE_ALIAS_CRYPTO ("hmac" );
crypto/lrw.c +1 -0
@@ -400,3 +400,4 @@ module_exit(crypto_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("LRW block cipher mode" ); +MODULE_ALIAS_CRYPTO ("lrw" );
crypto/pcbc.c +1 -0
@@ -295,3 +295,4 @@ module_exit(crypto_pcbc_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("PCBC block cipher algorithm" ); +MODULE_ALIAS_CRYPTO ("pcbc" );
crypto/pcrypt.c +1 -0
@@ -565,3 +565,4 @@ module_exit(pcrypt_exit);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Steffen Klassert <[email protected]>" );MODULE_DESCRIPTION ("Parallel crypto wrapper" ); +MODULE_ALIAS_CRYPTO ("pcrypt" );
crypto/seqiv.c +1 -0
@@ -362,3 +362,4 @@ module_exit(seqiv_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Sequence Number IV Generator" ); +MODULE_ALIAS_CRYPTO ("seqiv" );
crypto/vmac.c +1 -0
@@ -713,3 +713,4 @@ module_exit(vmac_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("VMAC hash algorithm" ); +MODULE_ALIAS_CRYPTO ("vmac" );
crypto/xcbc.c +1 -0
@@ -286,3 +286,4 @@ module_exit(crypto_xcbc_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("XCBC keyed hash algorithm" ); +MODULE_ALIAS_CRYPTO ("xcbc" );
crypto/xts.c +1 -0
@@ -362,3 +362,4 @@ module_exit(crypto_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("XTS block cipher mode" ); +MODULE_ALIAS_CRYPTO ("xts" );
Signature · 1 line
2.2.2
PATCH 169/176 crypto: add missing crypto module aliases
In reply to Jiri SlabyFrom: Mathias Krause <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3e14dcf7cb80b34a1f38b55bc96f02d23fdaaaaf upstream.
Commit 5d26a105b5a7 ("crypto: prefix module autoloading with "crypto-"") changed the automatic module loading when requesting crypto algorithms to prefix all module requests with "crypto-". This requires all crypto modules to have a crypto specific module alias even if their file name would otherwise match the requested crypto algorithm.
Even though commit 5d26a105b5a7 added those aliases for a vast amount of modules, it was missing a few. Add the required MODULE_ALIAS_CRYPTO annotations to those files to make them get loaded automatically, again. This fixes, e.g., requesting 'ecb(blowfish-generic)', which used to work with kernels v3.18 and below.
Also change MODULE_ALIAS() lines to MODULE_ALIAS_CRYPTO(). The former won't work for crypto modules any more.
--- arch/powerpc/crypto/sha1.c | 1 + crypto/aes_generic.c | 1 + crypto/ansi_cprng.c | 1 + crypto/blowfish_generic.c | 1 + crypto/camellia_generic.c | 1 + crypto/cast5_generic.c | 1 + crypto/cast6_generic.c | 1 + crypto/crct10dif_generic.c | 1 + crypto/des_generic.c | 5 +++-- crypto/ghash-generic.c | 1 + crypto/krng.c | 1 + crypto/salsa20_generic.c | 1 + crypto/serpent_generic.c | 1 + crypto/sha1_generic.c | 1 + crypto/sha256_generic.c | 2 ++ crypto/sha512_generic.c | 2 ++ crypto/tea.c | 1 + crypto/tgr192.c | 1 + crypto/twofish_generic.c | 1 + crypto/wp512.c | 1 + 20 files changed, 24 insertions(+), 2 deletions(-)
arch/powerpc/crypto/sha1.c +1 -0
@@ -154,4 +154,5 @@ module_exit(sha1_powerpc_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm" ); +MODULE_ALIAS_CRYPTO ("sha1" );MODULE_ALIAS_CRYPTO ("sha1-powerpc" );
crypto/aes_generic.c +1 -0
@@ -1475,3 +1475,4 @@ module_exit(aes_fini);MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm" );MODULE_LICENSE ("Dual BSD/GPL" );MODULE_ALIAS_CRYPTO ("aes" ); +MODULE_ALIAS_CRYPTO ("aes-generic" );
crypto/ansi_cprng.c +1 -0
@@ -477,3 +477,4 @@ MODULE_PARM_DESC(dbg, "Boolean to enable debugging (0/1 == off/on)");module_init (prng_mod_init);module_exit (prng_mod_fini);MODULE_ALIAS_CRYPTO ("stdrng" ); +MODULE_ALIAS_CRYPTO ("ansi_cprng" );
crypto/blowfish_generic.c +1 -0
@@ -139,3 +139,4 @@ module_exit(blowfish_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Blowfish Cipher Algorithm" );MODULE_ALIAS_CRYPTO ("blowfish" ); +MODULE_ALIAS_CRYPTO ("blowfish-generic" );
crypto/camellia_generic.c +1 -0
@@ -1099,3 +1099,4 @@ module_exit(camellia_fini);MODULE_DESCRIPTION ("Camellia Cipher Algorithm" );MODULE_LICENSE ("GPL" );MODULE_ALIAS_CRYPTO ("camellia" ); +MODULE_ALIAS_CRYPTO ("camellia-generic" );
crypto/cast5_generic.c +1 -0
@@ -550,3 +550,4 @@ module_exit(cast5_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Cast5 Cipher Algorithm" );MODULE_ALIAS_CRYPTO ("cast5" ); +MODULE_ALIAS_CRYPTO ("cast5-generic" );
crypto/cast6_generic.c +1 -0
@@ -292,3 +292,4 @@ module_exit(cast6_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Cast6 Cipher Algorithm" );MODULE_ALIAS_CRYPTO ("cast6" ); +MODULE_ALIAS_CRYPTO ("cast6-generic" );
crypto/crct10dif_generic.c +1 -0
@@ -125,3 +125,4 @@ MODULE_AUTHOR("Tim Chen <[email protected]>");MODULE_DESCRIPTION ("T10 DIF CRC calculation." );MODULE_LICENSE ("GPL" );MODULE_ALIAS_CRYPTO ("crct10dif" ); +MODULE_ALIAS_CRYPTO ("crct10dif-generic" );
crypto/des_generic.c +3 -2
@@ -971,8 +971,6 @@ static struct crypto_alg des_algs[2] = { { .cia_decrypt = des3_ede_decrypt } } } }; -MODULE_ALIAS_CRYPTO ("des3_ede" ); -static int __init des_generic_mod_init (void ) {return crypto_register_algs (des_algs,ARRAY_SIZE (des_algs));
@@ -990,3 +988,6 @@ MODULE_LICENSE("GPL");MODULE_DESCRIPTION ("DES & Triple DES EDE Cipher Algorithms" );MODULE_AUTHOR ("Dag Arne Osvik <[email protected]>" );MODULE_ALIAS_CRYPTO ("des" ); +MODULE_ALIAS_CRYPTO ("des-generic" ); +MODULE_ALIAS_CRYPTO ("des3_ede" ); +MODULE_ALIAS_CRYPTO ("des3_ede-generic" );
crypto/ghash-generic.c +1 -0
@@ -173,3 +173,4 @@ module_exit(ghash_mod_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("GHASH Message Digest Algorithm" );MODULE_ALIAS_CRYPTO ("ghash" ); +MODULE_ALIAS_CRYPTO ("ghash-generic" );
crypto/krng.c +1 -0
@@ -63,3 +63,4 @@ module_exit(krng_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Kernel Random Number Generator" );MODULE_ALIAS_CRYPTO ("stdrng" ); +MODULE_ALIAS_CRYPTO ("krng" );
crypto/salsa20_generic.c +1 -0
@@ -249,3 +249,4 @@ module_exit(salsa20_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm" );MODULE_ALIAS_CRYPTO ("salsa20" ); +MODULE_ALIAS_CRYPTO ("salsa20-generic" );
crypto/serpent_generic.c +1 -0
@@ -667,3 +667,4 @@ MODULE_DESCRIPTION("Serpent and tnepres (kerneli compatible serpent reversed) CiMODULE_AUTHOR ("Dag Arne Osvik <[email protected]>" );MODULE_ALIAS_CRYPTO ("tnepres" );MODULE_ALIAS_CRYPTO ("serpent" ); +MODULE_ALIAS_CRYPTO ("serpent-generic" );
crypto/sha1_generic.c +1 -0
@@ -154,3 +154,4 @@ MODULE_LICENSE("GPL");MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm" );MODULE_ALIAS_CRYPTO ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1-generic" );
crypto/sha256_generic.c +2 -0
@@ -385,4 +385,6 @@ MODULE_LICENSE("GPL");MODULE_DESCRIPTION ("SHA-224 and SHA-256 Secure Hash Algorithm" );MODULE_ALIAS_CRYPTO ("sha224" ); +MODULE_ALIAS_CRYPTO ("sha224-generic" );MODULE_ALIAS_CRYPTO ("sha256" ); +MODULE_ALIAS_CRYPTO ("sha256-generic" );
crypto/sha512_generic.c +2 -0
@@ -288,4 +288,6 @@ MODULE_LICENSE("GPL");MODULE_DESCRIPTION ("SHA-512 and SHA-384 Secure Hash Algorithms" );MODULE_ALIAS_CRYPTO ("sha384" ); +MODULE_ALIAS_CRYPTO ("sha384-generic" );MODULE_ALIAS_CRYPTO ("sha512" ); +MODULE_ALIAS_CRYPTO ("sha512-generic" );
crypto/tea.c +1 -0
@@ -270,6 +270,7 @@ static void __exit tea_mod_fini(void)crypto_unregister_algs (tea_algs,ARRAY_SIZE (tea_algs)); } +MODULE_ALIAS_CRYPTO ("tea" );MODULE_ALIAS_CRYPTO ("xtea" );MODULE_ALIAS_CRYPTO ("xeta" );
crypto/tgr192.c +1 -0
@@ -676,6 +676,7 @@ static void __exit tgr192_mod_fini(void)crypto_unregister_shashes (tgr_algs,ARRAY_SIZE (tgr_algs)); } +MODULE_ALIAS_CRYPTO ("tgr192" );MODULE_ALIAS_CRYPTO ("tgr160" );MODULE_ALIAS_CRYPTO ("tgr128" );
crypto/twofish_generic.c +1 -0
@@ -212,3 +212,4 @@ module_exit(twofish_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Twofish Cipher Algorithm" );MODULE_ALIAS_CRYPTO ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish-generic" );
crypto/wp512.c +1 -0
@@ -1167,6 +1167,7 @@ static void __exit wp512_mod_fini(void)crypto_unregister_shashes (wp_algs,ARRAY_SIZE (wp_algs)); } +MODULE_ALIAS_CRYPTO ("wp512" );MODULE_ALIAS_CRYPTO ("wp384" );MODULE_ALIAS_CRYPTO ("wp256" );
Signature · 1 line
2.2.2
PATCH 170/176 mmc: sdhci: Don't signal the sdio irq if it's not setup
In reply to Jiri SlabyFrom: Sjoerd Simons <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[Not needed in newer kernels due to refactoring fixing this issue.]
With 3.14.29 (and older kernels) some of my I.mx6 Sabrelite boards were crashing with the following oops:
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-esdhc-imx 2198000.usdhc: could not get ultra high speed state, work on normal mode
mmc0: no vqmmc regulator found
mmc0: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA
Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0004000 [00000000] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.29 #1 task: c08a7120 ti: c089c000 task.ti: c089c000 PC is at wake_up_process+0x8/0x40 LR is at sdhci_irq+0x748/0x9c4
Full boot log can be found at:
http://storage.kernelci.org/stable/v3.14.29/arm-multi_v7_defconfig/lab-collabora/boot-imx6q-sabrelite.html
This happens if the sdhci interrupt status contains SDHCI_INT_CARD_INT, while the sdio irq was never setup. This patch fixes that in a minimal way by checking if the sdio irq was setup.
In more recent kernels this bug went away due to refactoring done by Russel King. So an alternative (potentially better?) fix for this patch is to cherrypick the following patches from a recent kernel:
18258f7239a6 - genirq: Provide synchronize_hardirq() bf3b5ec66bd0 - mmc: sdio_irq: rework sdio irq handling 41005003bcaf - mmc: sdhci: clean up interrupt handling 781e989cf593 - mmc: sdhci: convert to new SDIO IRQ handling
--- drivers/mmc/host/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci.c +1 -1
@@ -2508,7 +2508,7 @@ out:/* * We have to delay this as it calls back into the driver. */ -if (cardint) +if (cardint && host->mmc->sdio_irqs)mmc_signal_sdio_irq (host->mmc);return result;
Signature · 1 line
2.2.2
PATCH 171/176 mm: get rid of radix tree gfp mask for pagecache_get_page
In reply to Jiri SlabyFrom: Michal Hocko <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 45f87de57f8fad59302fd263dd81ffa4843b5b24 upstream.
Commit 2457aec63745 ("mm: non-atomically mark page accessed during page cache allocation where possible") has added a separate parameter for specifying gfp mask for radix tree allocations.
Not only this is less than optimal from the API point of view because it is error prone, it is also buggy currently because grab_cache_page_write_begin is using GFP_KERNEL for radix tree and if fgp_flags doesn't contain FGP_NOFS (mostly controlled by fs by AOP_FLAG_NOFS flag) but the mapping_gfp_mask has __GFP_FS cleared then the radix tree allocation wouldn't obey the restriction and might recurse into filesystem and cause deadlocks. This is the case for most filesystems unfortunately because only ext4 and gfs2 are using AOP_FLAG_NOFS.
Let's simply remove radix_gfp_mask parameter because the allocation context is same for both page cache and for the radix tree. Just make sure that the radix tree gets only the sane subset of the mask (e.g. do not pass __GFP_WRITE).
Long term it is more preferable to convert remaining users of AOP_FLAG_NOFS to use mapping_gfp_mask instead and simplify this interface even further.
--- include/linux/pagemap.h | 13 ++++++------- mm/filemap.c | 20 +++++++++----------- 2 files changed, 15 insertions(+), 18 deletions(-)
include/linux/pagemap.h +6 -7
@@ -256,7 +256,7 @@ pgoff_t page_cache_prev_hole(struct address_space *mapping,#define FGP_NOWAIT 0x00000020struct page *pagecache_get_page (struct address_space *mapping,pgoff_t offset, -int fgp_flags,gfp_t cache_gfp_mask,gfp_t radix_gfp_mask); +int fgp_flags,gfp_t cache_gfp_mask);/** * find_get_page - find and get a page reference
@@ -271,13 +271,13 @@ struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset,static inline struct page *find_get_page (struct address_space *mapping,pgoff_t offset) { -return pagecache_get_page (mapping, offset,0 ,0 ,0 ); +return pagecache_get_page (mapping, offset,0 ,0 ); }static inline struct page *find_get_page_flags (struct address_space *mapping,pgoff_t offset,int fgp_flags) { -return pagecache_get_page (mapping, offset, fgp_flags,0 ,0 ); +return pagecache_get_page (mapping, offset, fgp_flags,0 ); }/**
@@ -297,7 +297,7 @@ static inline struct page *find_get_page_flags(struct address_space *mapping,static inline struct page *find_lock_page (struct address_space *mapping,pgoff_t offset) { -return pagecache_get_page (mapping, offset,FGP_LOCK ,0 ,0 ); +return pagecache_get_page (mapping, offset,FGP_LOCK ,0 ); }/**
@@ -324,7 +324,7 @@ static inline struct page *find_or_create_page(struct address_space *mapping, {return pagecache_get_page (mapping, offset,FGP_LOCK |FGP_ACCESSED |FGP_CREAT , - gfp_mask, gfp_mask &GFP_RECLAIM_MASK ); + gfp_mask); }/**
@@ -345,8 +345,7 @@ static inline struct page *grab_cache_page_nowait(struct address_space *mapping, {return pagecache_get_page (mapping, index,FGP_LOCK |FGP_CREAT |FGP_NOFS |FGP_NOWAIT , -mapping_gfp_mask (mapping), -GFP_NOFS ); +mapping_gfp_mask (mapping)); }struct page *find_get_entry (struct address_space *mapping,pgoff_t offset);
mm/filemap.c +9 -11
@@ -897,7 +897,7 @@ EXPORT_SYMBOL(find_lock_entry);* @mapping: the address_space to search * @offset: the page index * @fgp_flags: PCG flags -* @gfp_mask: gfp mask to use if a page is to be allocated +* @gfp_mask: gfp mask to use for the page cache data page allocation * * Looks up the page cache slot at @mapping & @offset. *
@@ -916,7 +916,7 @@ EXPORT_SYMBOL(find_lock_entry);* If there is a page cache page, it is returned with an increased refcount. */ struct page *pagecache_get_page (struct address_space *mapping,pgoff_t offset, -int fgp_flags,gfp_t cache_gfp_mask,gfp_t radix_gfp_mask) +int fgp_flags,gfp_t gfp_mask) {struct page *page;
@@ -953,13 +953,11 @@ no_page:if (!page && (fgp_flags &FGP_CREAT )) {int err;if ((fgp_flags &FGP_WRITE ) &&mapping_cap_account_dirty (mapping)) - cache_gfp_mask |= __GFP_WRITE; -if (fgp_flags &FGP_NOFS ) { - cache_gfp_mask &= ~__GFP_FS; - radix_gfp_mask &= ~__GFP_FS; - } + gfp_mask |= __GFP_WRITE; +if (fgp_flags &FGP_NOFS ) + gfp_mask &= ~__GFP_FS; - page =__page_cache_alloc (cache_gfp_mask); + page =__page_cache_alloc (gfp_mask);if (!page)return NULL ;
@@ -970,7 +968,8 @@ no_page:if (fgp_flags &FGP_ACCESSED )init_page_accessed (page); - err =add_to_page_cache_lru (page, mapping, offset, radix_gfp_mask); + err =add_to_page_cache_lru (page, mapping, offset, + gfp_mask &GFP_RECLAIM_MASK );if (unlikely (err)) {page_cache_release (page); page =NULL ;
@@ -2462,8 +2461,7 @@ struct page *grab_cache_page_write_begin(struct address_space *mapping, fgp_flags |=FGP_NOFS ; page =pagecache_get_page (mapping, index, fgp_flags, -mapping_gfp_mask (mapping), -GFP_KERNEL ); +mapping_gfp_mask (mapping));if (page)wait_for_stable_page (page);
Signature · 1 line
2.2.2
PATCH 172/176 md/raid5: fetch_block must fetch all the blocks handle_stripe_dirtying wants.
In reply to Jiri SlabyFrom: NeilBrown <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 108cef3aa41669610e1836fe638812dd067d72de upstream.
It is critical that fetch_block() and handle_stripe_dirtying() are consistent in their analysis of what needs to be loaded. Otherwise raid5 can wait forever for a block that won't be loaded.
Currently when writing to a RAID5 that is resyncing, to a location beyond the resync offset, handle_stripe_dirtying chooses a reconstruct-write cycle, but fetch_block() assumes a read-modify-write, and a lockup can happen.
So treat that case just like RAID6, just as we do in handle_stripe_dirtying. RAID6 always does reconstruct-write.
This bug was introduced when the behaviour of handle_stripe_dirtying was changed in 3.7, so the patch is suitable for any kernel since, though it will need careful merging for some versions.
--- drivers/md/raid5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/raid5.c +2 -1
@@ -2789,7 +2789,8 @@ static int fetch_block(struct stripe_head *sh, struct stripe_head_state *s, (s->failed >=2 && fdev[1 ]->toread) || (sh->raid_conf->level <=5 && s->failed && fdev[0 ]->towrite && !test_bit (R5_OVERWRITE , &fdev[0 ]->flags)) || - (sh->raid_conf->level == 6 && s->failed && s->to_write))) { + ((sh->raid_conf->level ==6 || sh->sector >= sh->raid_conf->mddev->recovery_cp) + && s->failed && s->to_write))) {/* we would like to get this block, possibly by computing it, * otherwise read it if the backing disk is insync */
Signature · 1 line
2.2.2
PATCH 173/176 USB: adutux: NULL dereferences on disconnect
In reply to Jiri SlabyFrom: Dan Carpenter <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fc625960edecfb57e62c2975d1f155155e28e6ba upstream.
Both "dev->udev" and "interface->dev" are NULL. These printks are not very interesting so I just deleted them.
--- drivers/usb/misc/adutux.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/usb/misc/adutux.c +0 -5
@@ -815,15 +815,10 @@ static void adu_disconnect(struct usb_interface *interface)usb_set_intfdata (interface,NULL );/* if the device is not opened, then we clean up right now */ -dev_dbg (&dev->udev->dev,"%s : open count %d\n" , - __func__, dev->open_count);if (!dev->open_count)adu_delete (dev);mutex_unlock (&adutux_mutex); - -dev_info (&interface->dev,"ADU device adutux%d now disconnected\n" , - (minor -ADU_MINOR_BASE )); }/* usb specific object needed to register this driver with the usb subsystem */
Signature · 1 line
2.2.2
PATCH 174/176 usb: musb: Fix a few off-by-one lengths
In reply to Jiri SlabyFrom: Rasmus Villemoes <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e87c3f80ad0490d26ffe04754b7d094463b40f30 upstream.
!strncmp(buf, "force host", 9) is true if and only if buf starts with "force hos". This was obviously not what was intended. The same error exists for "force full-speed", "force high-speed" and "test packet". Using strstarts avoids the error-prone hardcoding of the prefix length.
For consistency, also change the other occurences of the !strncmp idiom.
--- drivers/usb/musb/musb_cppi41.c | 4 ++-- drivers/usb/musb/musb_debugfs.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/usb/musb/musb_cppi41.c +2 -2
@@ -586,9 +586,9 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) ret =of_property_read_string_index (np,"dma-names" , i, &str);if (ret) goto err; -if (!strncmp (str,"tx" ,2 )) +if (strstarts (str,"tx" )) is_tx =1 ; -else if (!strncmp (str,"rx" ,2 )) +else if (strstarts (str,"rx" )) is_tx =0 ;else {dev_err (dev,"Wrong dmatype %s\n" , str);
drivers/usb/musb/musb_debugfs.c +8 -8
@@ -194,30 +194,30 @@ static ssize_t musb_test_mode_write(struct file *file,if (copy_from_user (&buf, ubuf,min_t (size_t,sizeof (buf) -1 , count)))return -EFAULT ; -if (!strncmp (buf,"force host" ,9 )) +if (strstarts (buf,"force host" )) test =MUSB_TEST_FORCE_HOST ; -if (!strncmp (buf,"fifo access" ,11 )) +if (strstarts (buf,"fifo access" )) test =MUSB_TEST_FIFO_ACCESS ; -if (!strncmp (buf,"force full-speed" ,15 )) +if (strstarts (buf,"force full-speed" )) test =MUSB_TEST_FORCE_FS ; -if (!strncmp (buf,"force high-speed" ,15 )) +if (strstarts (buf,"force high-speed" )) test =MUSB_TEST_FORCE_HS ; -if (!strncmp (buf,"test packet" ,10 )) { +if (strstarts (buf,"test packet" )) { test =MUSB_TEST_PACKET ;musb_load_testpacket (musb); } -if (!strncmp (buf,"test K" ,6 )) +if (strstarts (buf,"test K" )) test =MUSB_TEST_K ; -if (!strncmp (buf,"test J" ,6 )) +if (strstarts (buf,"test J" )) test =MUSB_TEST_J ; -if (!strncmp (buf,"test SE0 NAK" ,12 )) +if (strstarts (buf,"test SE0 NAK" )) test =MUSB_TEST_SE0_NAK ;musb_writeb (musb->mregs,MUSB_TESTMODE , test);
Signature · 1 line
2.2.2
PATCH 175/176 move d_rcu from overlapping d_child to overlapping d_alias
In reply to Jiri SlabyFrom: Al Viro <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 946e51f2bf37f1656916eb75bd0742ba33983c28 upstream.
--- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- drivers/staging/lustre/lustre/llite/dcache.c | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/llite/namei.c | 8 ++-- fs/affs/amigaffs.c | 2 +- fs/autofs4/expire.c | 12 +++--- fs/autofs4/root.c | 2 +- fs/ceph/dir.c | 8 ++-- fs/ceph/inode.c | 6 +-- fs/cifs/inode.c | 2 +- fs/coda/cache.c | 2 +- fs/dcache.c | 56 ++++++++++++------------- fs/debugfs/inode.c | 4 +- fs/exportfs/expfs.c | 2 +- fs/libfs.c | 12 +++--- fs/ncpfs/dir.c | 2 +- fs/ncpfs/ncplib_kernel.h | 4 +- fs/nfs/getroot.c | 2 +- fs/notify/fsnotify.c | 4 +- fs/ocfs2/dcache.c | 2 +- include/linux/dcache.h | 8 ++-- kernel/cgroup.c | 2 +- kernel/trace/trace.c | 4 +- kernel/trace/trace_events.c | 2 +- security/selinux/selinuxfs.c | 6 +-- 25 files changed, 79 insertions(+), 79 deletions(-)
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
@@ -164,7 +164,7 @@ static void spufs_prune_dir(struct dentry *dir)struct dentry *dentry, *tmp;mutex_lock (&dir->d_inode->i_mutex); -list_for_each_entry_safe (dentry, tmp, &dir->d_subdirs, d_u.d_child) { +list_for_each_entry_safe (dentry, tmp, &dir->d_subdirs, d_child) {spin_lock (&dentry->d_lock);if (!(d_unhashed (dentry)) && dentry->d_inode) {dget_dlock (dentry);
drivers/staging/lustre/lustre/llite/dcache.c +1 -1
@@ -278,7 +278,7 @@ void ll_invalidate_aliases(struct inode *inode) inode->i_ino, inode->i_generation, inode);ll_lock_dcache (inode); -ll_d_hlist_for_each_entry (dentry, p, &inode->i_dentry, d_alias) { +ll_d_hlist_for_each_entry (dentry, p, &inode->i_dentry, d_u.d_alias) { CDEBUG(D_DENTRY, "dentry in drop %.*s (%p) parent %p " "inode %p flags %d\n", dentry->d_name.len, dentry->d_name.name, dentry, dentry->d_parent,
drivers/staging/lustre/lustre/llite/llite_lib.c +1 -1
@@ -665,7 +665,7 @@ void lustre_dump_dentry(struct dentry *dentry, int recur)return ;list_for_each (tmp, &dentry->d_subdirs) { - struct dentry *d = list_entry(tmp, struct dentry, d_u.d_child); + struct dentry *d = list_entry(tmp, struct dentry, d_child);lustre_dump_dentry (d, recur -1 ); } }
drivers/staging/lustre/lustre/llite/namei.c +4 -4
@@ -175,14 +175,14 @@ static void ll_invalidate_negative_children(struct inode *dir)struct ll_d_hlist_node *p;ll_lock_dcache (dir); -ll_d_hlist_for_each_entry (dentry, p, &dir->i_dentry, d_alias) { +ll_d_hlist_for_each_entry (dentry, p, &dir->i_dentry, d_u.d_alias) {spin_lock (&dentry->d_lock);if (!list_empty (&dentry->d_subdirs)) {struct dentry *child;list_for_each_entry_safe (child, tmp_subdir, &dentry->d_subdirs, - d_u.d_child) { + d_child) {if (child->d_inode ==NULL )d_lustre_invalidate (child,1 ); }
@@ -363,7 +363,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) discon_alias = invalid_alias =NULL ;ll_lock_dcache (inode); -ll_d_hlist_for_each_entry (alias, p, &inode->i_dentry, d_alias) { +ll_d_hlist_for_each_entry (alias, p, &inode->i_dentry, d_u.d_alias) {LASSERT (alias != dentry);spin_lock (&alias->d_lock);
@@ -953,7 +953,7 @@ static void ll_get_child_fid(struct inode * dir, struct qstr *name, {struct dentry *parent, *child; - parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_alias); + parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_u.d_alias); child =d_lookup (parent, name);if (child) {if (child->d_inode)
fs/affs/amigaffs.c +1 -1
@@ -126,7 +126,7 @@ affs_fix_dcache(struct inode *inode, u32 entry_ino) {struct dentry *dentry;spin_lock (&inode->i_lock); -hlist_for_each_entry (dentry, &inode->i_dentry, d_alias) { +hlist_for_each_entry (dentry, &inode->i_dentry, d_u.d_alias) {if (entry_ino == (u32 )(long )dentry->d_fsdata) { dentry->d_fsdata = (void *)inode->i_ino;break ;
fs/autofs4/expire.c +6 -6
@@ -91,7 +91,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,spin_lock (&root->d_lock);if (prev) - next = prev->d_u.d_child.next; + next = prev->d_child.next;else { prev =dget_dlock (root); next = prev->d_subdirs.next;
@@ -105,13 +105,13 @@ cont:return NULL ; } - q = list_entry(next, struct dentry, d_u.d_child); + q = list_entry(next, struct dentry, d_child);spin_lock_nested (&q->d_lock,DENTRY_D_LOCK_NESTED );/* Already gone or negative dentry (under construction) - try next */ if (!d_count (q) || !simple_positive (q)) {spin_unlock (&q->d_lock); - next = q->d_u.d_child.next; + next = q->d_child.next; goto cont; }dget_dlock (q);
@@ -161,13 +161,13 @@ again: goto relock; }spin_unlock (&p->d_lock); - next = p->d_u.d_child.next; + next = p->d_child.next; p = parent;if (next != &parent->d_subdirs)break ; } } - ret = list_entry(next, struct dentry, d_u.d_child); + ret = list_entry(next, struct dentry, d_child);spin_lock_nested (&ret->d_lock,DENTRY_D_LOCK_NESTED );/* Negative dentry - try next */
@@ -447,7 +447,7 @@ found:spin_lock (&sbi->lookup_lock);spin_lock (&expired->d_parent->d_lock);spin_lock_nested (&expired->d_lock,DENTRY_D_LOCK_NESTED ); -list_move (&expired->d_parent->d_subdirs, &expired->d_u.d_child); +list_move (&expired->d_parent->d_subdirs, &expired->d_child);spin_unlock (&expired->d_lock);spin_unlock (&expired->d_parent->d_lock);spin_unlock (&sbi->lookup_lock);
fs/autofs4/root.c +1 -1
@@ -655,7 +655,7 @@ static void autofs_clear_leaf_automount_flags(struct dentry *dentry)/* only consider parents below dentrys in the root */ if (IS_ROOT (parent->d_parent))return ; - d_child = &dentry->d_u.d_child; + d_child = &dentry->d_child;/* Set parent managed if it's becoming empty */ if (d_child->next == &parent->d_subdirs && d_child->prev == &parent->d_subdirs)
fs/ceph/dir.c +4 -4
@@ -103,7 +103,7 @@ static unsigned fpos_off(loff_t p)/* * When possible, we try to satisfy a readdir by peeking at the * dcache. We make this work by carefully ordering dentries on -* d_u.d_child when we initially get results back from the MDS, and +* d_child when we initially get results back from the MDS, and * falling back to a "normal" sync readdir if any dentries in the dir * are dropped. *
@@ -138,11 +138,11 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx) p = parent->d_subdirs.prev;dout (" initial p %p/%p\n" , p->prev, p->next); }else { - p = last->d_u.d_child.prev; + p = last->d_child.prev; } more: - dentry = list_entry(p, struct dentry, d_u.d_child); + dentry = list_entry(p, struct dentry, d_child); di =ceph_dentry (dentry);while (1 ) { dout(" p %p/%p %s d_subdirs %p/%p\n", p->prev, p->next,
@@ -164,7 +164,7 @@ more: !dentry->d_inode ? " null" : "");spin_unlock (&dentry->d_lock); p = p->prev; - dentry = list_entry(p, struct dentry, d_u.d_child); + dentry = list_entry(p, struct dentry, d_child); di =ceph_dentry (dentry); }
fs/ceph/inode.c +3 -3
@@ -880,9 +880,9 @@ static void ceph_set_dentry_offset(struct dentry *dn)spin_lock (&dir->d_lock);spin_lock_nested (&dn->d_lock,DENTRY_D_LOCK_NESTED ); -list_move (&dn->d_u.d_child, &dir->d_subdirs); +list_move (&dn->d_child, &dir->d_subdirs);dout ("set_dentry_offset %p %lld (%p %p)\n" , dn, di->offset, - dn->d_u.d_child.prev, dn->d_u.d_child.next); + dn->d_child.prev, dn->d_child.next);spin_unlock (&dn->d_lock);spin_unlock (&dir->d_lock); }
@@ -1309,7 +1309,7 @@ retry_lookup:/* reorder parent's d_subdirs */ spin_lock (&parent->d_lock);spin_lock_nested (&dn->d_lock,DENTRY_D_LOCK_NESTED ); -list_move (&dn->d_u.d_child, &parent->d_subdirs); +list_move (&dn->d_child, &parent->d_subdirs);spin_unlock (&dn->d_lock);spin_unlock (&parent->d_lock); }
fs/cifs/inode.c +1 -1
@@ -874,7 +874,7 @@ inode_has_hashed_dentries(struct inode *inode)struct dentry *dentry;spin_lock (&inode->i_lock); -hlist_for_each_entry (dentry, &inode->i_dentry, d_alias) { +hlist_for_each_entry (dentry, &inode->i_dentry, d_u.d_alias) {if (!d_unhashed (dentry) ||IS_ROOT (dentry)) {spin_unlock (&inode->i_lock);return true;
fs/coda/cache.c +1 -1
@@ -92,7 +92,7 @@ static void coda_flag_children(struct dentry *parent, int flag)struct dentry *de;spin_lock (&parent->d_lock); -list_for_each_entry (de, &parent->d_subdirs, d_u.d_child) { +list_for_each_entry (de, &parent->d_subdirs, d_child) {/* don't know what to do with negative dentries */ if (de->d_inode )coda_flag_inode (de->d_inode, flag);
fs/dcache.c +28 -28
207 lines not on this page · raw message
fs/debugfs/inode.c +2 -2
@@ -549,10 +549,10 @@ void debugfs_remove_recursive(struct dentry *dentry)/* * The parent->d_subdirs is protected by the d_lock. Outside that * lock, the child can be unlinked and set to be freed which can -* use the d_u.d_child as the rcu head and corrupt this list. +* use the d_child as the rcu head and corrupt this list. */ spin_lock (&parent->d_lock); -list_for_each_entry (child, &parent->d_subdirs, d_u.d_child) { +list_for_each_entry (child, &parent->d_subdirs, d_child) {if (!debugfs_positive (child))continue ;
fs/exportfs/expfs.c +1 -1
@@ -50,7 +50,7 @@ find_acceptable_alias(struct dentry *result, inode = result->d_inode;spin_lock (&inode->i_lock); -hlist_for_each_entry (dentry, &inode->i_dentry, d_alias) { +hlist_for_each_entry (dentry, &inode->i_dentry, d_u.d_alias) {dget (dentry);spin_unlock (&inode->i_lock);if (toput)
fs/libfs.c +6 -6
@@ -105,18 +105,18 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)spin_lock (&dentry->d_lock);/* d_lock not required for cursor */ -list_del (&cursor->d_u.d_child); +list_del (&cursor->d_child); p = dentry->d_subdirs.next;while (n && p != &dentry->d_subdirs) {struct dentry *next; - next = list_entry(p, struct dentry, d_u.d_child); + next = list_entry(p, struct dentry, d_child);spin_lock_nested (&next->d_lock,DENTRY_D_LOCK_NESTED );if (simple_positive (next)) n--;spin_unlock (&next->d_lock); p = p->next; } -list_add_tail (&cursor->d_u.d_child, p); +list_add_tail (&cursor->d_child, p);spin_unlock (&dentry->d_lock); } }
@@ -140,7 +140,7 @@ int dcache_readdir(struct file *file, struct dir_context *ctx) {struct dentry *dentry = file->f_path.dentry;struct dentry *cursor = file->private_data; -struct list_head *p, *q = &cursor->d_u.d_child; +struct list_head *p, *q = &cursor->d_child;if (!dir_emit_dots (file, ctx))return 0 ;
@@ -149,7 +149,7 @@ int dcache_readdir(struct file *file, struct dir_context *ctx)list_move (q, &dentry->d_subdirs);for (p = q->next; p != &dentry->d_subdirs; p = p->next) { - struct dentry *next = list_entry(p, struct dentry, d_u.d_child); + struct dentry *next = list_entry(p, struct dentry, d_child);spin_lock_nested (&next->d_lock,DENTRY_D_LOCK_NESTED );if (!simple_positive (next)) {spin_unlock (&next->d_lock);
@@ -270,7 +270,7 @@ int simple_empty(struct dentry *dentry)int ret =0 ;spin_lock (&dentry->d_lock); -list_for_each_entry (child, &dentry->d_subdirs, d_u.d_child) { +list_for_each_entry (child, &dentry->d_subdirs, d_child) {spin_lock_nested (&child->d_lock,DENTRY_D_LOCK_NESTED );if (simple_positive (child)) {spin_unlock (&child->d_lock);
fs/ncpfs/dir.c +1 -1
@@ -407,7 +407,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)spin_lock (&parent->d_lock); next = parent->d_subdirs.next;while (next != &parent->d_subdirs) { - dent = list_entry(next, struct dentry, d_u.d_child); + dent = list_entry(next, struct dentry, d_child);if ((unsigned long )dent->d_fsdata == fpos) {if (dent->d_inode)dget (dent);
fs/ncpfs/ncplib_kernel.h +2 -2
@@ -194,7 +194,7 @@ ncp_renew_dentries(struct dentry *parent)spin_lock (&parent->d_lock); next = parent->d_subdirs.next;while (next != &parent->d_subdirs) { - dentry = list_entry(next, struct dentry, d_u.d_child); + dentry = list_entry(next, struct dentry, d_child);if (dentry->d_fsdata ==NULL )ncp_age_dentry (server, dentry);
@@ -216,7 +216,7 @@ ncp_invalidate_dircache_entries(struct dentry *parent)spin_lock (&parent->d_lock); next = parent->d_subdirs.next;while (next != &parent->d_subdirs) { - dentry = list_entry(next, struct dentry, d_u.d_child); + dentry = list_entry(next, struct dentry, d_child); dentry->d_fsdata =NULL ;ncp_age_dentry (server, dentry); next = next->next;
fs/nfs/getroot.c +1 -1
@@ -58,7 +58,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i*/ spin_lock (&sb->s_root->d_inode->i_lock);spin_lock (&sb->s_root->d_lock); -hlist_del_init (&sb->s_root->d_alias); +hlist_del_init (&sb->s_root->d_u.d_alias);spin_unlock (&sb->s_root->d_lock);spin_unlock (&sb->s_root->d_inode->i_lock); }
fs/notify/fsnotify.c +2 -2
@@ -63,14 +63,14 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)spin_lock (&inode->i_lock);/* run all of the dentries associated with this inode. Since this is a * directory, there damn well better only be one item on this list */ -hlist_for_each_entry (alias, &inode->i_dentry, d_alias) { +hlist_for_each_entry (alias, &inode->i_dentry, d_u.d_alias) {struct dentry *child;/* run all of the children of the original inode and fix their * d_flags to indicate parental interest (their parent is the * original inode) */ spin_lock (&alias->d_lock); -list_for_each_entry (child, &alias->d_subdirs, d_u.d_child) { +list_for_each_entry (child, &alias->d_subdirs, d_child) {if (!child->d_inode)continue ;
fs/ocfs2/dcache.c +1 -1
@@ -172,7 +172,7 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode,struct dentry *dentry;spin_lock (&inode->i_lock); -hlist_for_each_entry (dentry, &inode->i_dentry, d_alias) { +hlist_for_each_entry (dentry, &inode->i_dentry, d_u.d_alias) {spin_lock (&dentry->d_lock);if (ocfs2_match_dentry (dentry, parent_blkno, skip_unhashed)) { trace_ocfs2_find_local_alias(dentry->d_name.len,
include/linux/dcache.h +4 -4
@@ -122,15 +122,15 @@ struct dentry {void *d_fsdata;/* fs-specific data */ struct list_head d_lru;/* LRU list */ +struct list_head d_child;/* child of parent list */ +struct list_head d_subdirs;/* our children */ /* -* d_child and d_rcu can share memory +* d_alias and d_rcu can share memory */ union { -struct list_head d_child;/* child of parent list */ +struct hlist_node d_alias;/* inode alias list */ struct rcu_head d_rcu; } d_u; -struct list_head d_subdirs;/* our children */ -struct hlist_node d_alias;/* inode alias list */ };/*
kernel/cgroup.c +1 -1
@@ -1012,7 +1012,7 @@ static void cgroup_d_remove_dir(struct dentry *dentry) parent = dentry->d_parent;spin_lock (&parent->d_lock);spin_lock_nested (&dentry->d_lock,DENTRY_D_LOCK_NESTED ); -list_del_init (&dentry->d_u.d_child); +list_del_init (&dentry->d_child);spin_unlock (&dentry->d_lock);spin_unlock (&parent->d_lock);remove_dir (dentry);
kernel/trace/trace.c +2 -2
@@ -6063,7 +6063,7 @@ static int instance_mkdir (struct inode *inode, struct dentry *dentry, umode_t mint ret;/* Paranoid: Make sure the parent is the "instances" directory */ - parent = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); + parent = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);if (WARN_ON_ONCE (parent != trace_instance_dir))return -ENOENT ;
@@ -6090,7 +6090,7 @@ static int instance_rmdir(struct inode *inode, struct dentry *dentry)int ret;/* Paranoid: Make sure the parent is the "instances" directory */ - parent = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); + parent = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);if (WARN_ON_ONCE (parent != trace_instance_dir))return -ENOENT ;
kernel/trace/trace_events.c +1 -1
@@ -427,7 +427,7 @@ static void remove_event_file_dir(struct ftrace_event_file *file)if (dir) {spin_lock (&dir->d_lock);/* probably unneeded */ -list_for_each_entry (child, &dir->d_subdirs, d_u.d_child) { +list_for_each_entry (child, &dir->d_subdirs, d_child) {if (child->d_inode)/* probably unneeded */ child->d_inode->i_private =NULL ; }
security/selinux/selinuxfs.c +3 -3
@@ -1190,7 +1190,7 @@ static void sel_remove_entries(struct dentry *de)spin_lock (&de->d_lock); node = de->d_subdirs.next;while (node != &de->d_subdirs) { - struct dentry *d = list_entry(node, struct dentry, d_u.d_child); + struct dentry *d = list_entry(node, struct dentry, d_child);spin_lock_nested (&d->d_lock,DENTRY_D_LOCK_NESTED );list_del_init (node);
@@ -1664,12 +1664,12 @@ static void sel_remove_classes(void)list_for_each (class_node, &class_dir->d_subdirs) {struct dentry *class_subdir =list_entry (class_node, - struct dentry, d_u.d_child); + struct dentry, d_child);struct list_head *class_subdir_node;list_for_each (class_subdir_node, &class_subdir->d_subdirs) {struct dentry *d =list_entry (class_subdir_node, - struct dentry, d_u.d_child); + struct dentry, d_child);if (d->d_inode)if (d->d_inode->i_mode &S_IFDIR )
Signature · 1 line
2.2.2
PATCH 176/176 deal with deadlock in d_walk()
In reply to Jiri SlabyFrom: Al Viro <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ca5358ef75fc69fee5322a38a340f5739d997c10 upstream.
... by not hitting rename_retry for reasons other than rename having happened. In other words, do _not_ restart when finding that between unlocking the child and locking the parent the former got into __dentry_kill(). Skip the killed siblings instead...
--- fs/dcache.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-)
fs/dcache.c +16 -15
@@ -488,7 +488,7 @@ static void __dentry_kill(struct dentry *dentry) }/* if it was on the hash then remove it */ __d_drop (dentry); -list_del (&dentry->d_child); +__list_del_entry (&dentry->d_child);/* * Inform d_walk() that we are no longer attached to the * dentry tree
@@ -1142,33 +1142,31 @@ resume:/* * All done at this level ... ascend and resume the search. */ +rcu_read_lock (); +ascend:if (this_parent != parent) {struct dentry *child = this_parent; this_parent = child->d_parent; -rcu_read_lock ();spin_unlock (&child->d_lock);spin_lock (&this_parent->d_lock); -/* -* might go back up the wrong parent if we have had a rename -* or deletion -*/ -if (this_parent != child->d_parent || - (child->d_flags &DCACHE_DENTRY_KILLED ) || -need_seqretry (&rename_lock, seq)) { -spin_unlock (&this_parent->d_lock); -rcu_read_unlock (); +/* might go back up the wrong parent if we have had a rename. */ +if (need_seqretry (&rename_lock, seq)) goto rename_retry; + next = child->d_child.next; +while (unlikely (child->d_flags &DCACHE_DENTRY_KILLED )) { +if (next == &this_parent->d_subdirs) + goto ascend; + child = list_entry(next, struct dentry, d_child); + next = next->next; }rcu_read_unlock (); - next = child->d_child.next; goto resume; } -if (need_seqretry (&rename_lock, seq)) { -spin_unlock (&this_parent->d_lock); +if (need_seqretry (&rename_lock, seq)) goto rename_retry; - } +rcu_read_unlock ();if (finish)finish (data);
@@ -1178,6 +1176,9 @@ out_unlock:return ; rename_retry: +spin_unlock (&this_parent->d_lock); +rcu_read_unlock (); +BUG_ON (seq &1 );if (!retry)return ; seq =1 ;
Signature · 1 line
2.2.2
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.37 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Jan 30 15:29:12 CET 2015. Anything received after that time might be too late.
Build results:
total: 135 pass: 112 fail: 23 Failed builds: arm:davinci_all_defconfig arm:vexpress_defconfig arm:imx_v4_v5_defconfig arm:lpc32xx_defconfig arm:orion5x_defconfig arm:msm_defconfig microblaze:mmu_defconfig microblaze:nommu_defconfig mips:cavium_octeon_defconfig openrisc:defconfig powerpc:allmodconfig powerpc:ppc64e_defconfig powerpc:ppc6xx_defconfig powerpc:mpc83xx_defconfig powerpc:mpc85xx_defconfig powerpc:mpc85xx_smp_defconfig powerpc:allmodconfig powerpc:ppc64e_defconfig powerpc:ppc6xx_defconfig powerpc:mpc83xx_defconfig powerpc:mpc85xx_defconfig powerpc:mpc85xx_smp_defconfig xtensa:allmodconfig
Qemu tests:
total: 27 pass: 25 fail: 2
Failed tests:
arm:arm_vexpress_defconfig
openrisc:openrisc_defconfig
Details are available at http://server.roeck-us.net:8010/builders.
---
Common error message:
drivers/gpio/gpiolib-of.c: In function ‘of_gpiochip_find_and_xlate’:drivers/gpio/gpiolib-of.c:50:3: error: implicit declaration of function ‘ERR_PTR’
gg_data->out_gpio = ERR_PTR(ret);
"#include <linux/err.h>" is missing in drivers/gpio/gpiolib-of.c.
Guenter
Quoted 45 lines · Guenter Roeck
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.37 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Jan 30 15:29:12 CET 2015. Anything received after that time might be too late.
Build results:
total: 135 pass: 112 fail: 23 Failed builds: arm:davinci_all_defconfig arm:vexpress_defconfig arm:imx_v4_v5_defconfig arm:lpc32xx_defconfig arm:orion5x_defconfig arm:msm_defconfig microblaze:mmu_defconfig microblaze:nommu_defconfig mips:cavium_octeon_defconfig openrisc:defconfig powerpc:allmodconfig powerpc:ppc64e_defconfig powerpc:ppc6xx_defconfig powerpc:mpc83xx_defconfig powerpc:mpc85xx_defconfig powerpc:mpc85xx_smp_defconfig powerpc:allmodconfig powerpc:ppc64e_defconfig powerpc:ppc6xx_defconfig powerpc:mpc83xx_defconfig powerpc:mpc85xx_defconfig powerpc:mpc85xx_smp_defconfig xtensa:allmodconfigQemu tests:
total: 27 pass: 25 fail: 2Failed tests:
arm:arm_vexpress_defconfig
openrisc:openrisc_defconfigDetails are available at http://server.roeck-us.net:8010/builders.
Quoted 8 lines
---
Common error message:
drivers/gpio/gpiolib-of.c: In function ‘of_gpiochip_find_and_xlate’:drivers/gpio/gpiolib-of.c:50:3: error: implicit declaration of function ‘ERR_PTR’
gg_data->out_gpio=ERR_PTR(ret);"#include <
linux/err.h>" is missing indrivers/gpio/gpiolib-of.c.
I see... Now fixed hopefully. Thanks for letting me know.
Signature · 2 lines
js suse labs
Quoted 10 lines · Jiri Slaby
Quoted 9 lines · Guenter Roeck
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.37 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Jan 30 15:29:12 CET 2015. Anything received after that time might be too late.
[ ... ]
Quoted 11 lines
Quoted 8 lines
---
Common error message:
drivers/gpio/gpiolib-of.c: In function ‘of_gpiochip_find_and_xlate’:drivers/gpio/gpiolib-of.c:50:3: error: implicit declaration of function ‘ERR_PTR’
gg_data->out_gpio=ERR_PTR(ret);"#include <
linux/err.h>" is missing indrivers/gpio/gpiolib-of.c.I see... Now fixed hopefully. Thanks for letting me know.
Confirmed fixed. All builds and qemu tests passed.
Thanks,
Guenter
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.37 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Jan 30 15:29:12 CET 2015. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.37-rc1.xzand the diffstat can be found below.
thanks,
js
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Signature · 5 lines
Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978