3.4.15-stable review
Subsystems (41)
Greg Kroah-Hartman
maintainercover 3.4.15-stable review
This is the start of the stable review cycle for the 3.4.15 release. There are 62 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 Sun Oct 21 02:42:38 UTC 2012. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.15-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Maxim Kachur <[email protected]>
ALSA: emu10k1: add chip details for E-mu 1010 PCIe card
Takashi Iwai <[email protected]>
ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new()
Peter Ujfalusi <[email protected]>
ASoC: omap-abe-twl6040: Fix typo of Vibrator
Mark Brown <[email protected]>
ASoC: wm2200: Fix non-inverted OUT2 mute control
Mark Brown <[email protected]>
ASoC: wm2200: Use rev A register patches on rev B
Guennadi Liakhovetski <[email protected]>
ASoC: fsi: don't reschedule DMA from an atomic context
David Henningsson <[email protected]>
ALSA: hda - Always check array bounds in alc_get_line_out_pfx
Fabio Porcedda <[email protected]>
usb: gadget: at91_udc: fix dt support
Tyler Hicks <[email protected]>
eCryptfs: Call lower ->flush() from ecryptfs_flush()
Tyler Hicks <[email protected]>
eCryptfs: Write out all dirty pages just before releasing the lower file
Tyler Hicks <[email protected]>
eCryptfs: Revert to a writethrough cache model
Tyler Hicks <[email protected]>
eCryptfs: Initialize empty lower files when opening them
Tyler Hicks <[email protected]>
eCryptfs: Unlink lower inode when ecryptfs_create() fails
Peter Huewe <[email protected]>
tpm: Propagate error from tpm_transmit to fix a timeout hang
Hiroaki SHIMODA <[email protected]>
e1000e: Change wthresh to 1 to avoid possible Tx stalls
Jan Kara <[email protected]>
jbd: Fix assertion failure in commit code due to lacking transaction credits
Jani Nikula <[email protected]>
drm/i915: use adjusted_mode instead of mode for checking the 6bpc force flag
Egbert Eich <[email protected]>
drm/radeon: Don't destroy I2C Bus Rec in radeon_ext_tmds_enc_destroy().
Jean-Christian de Rivaz <[email protected]>
Add CDC-ACM support for the CX93010-2x UCMxx USB Modem
Jan Engelhardt <[email protected]>
netfilter: xt_limit: have r->cost != 0 case work
Florian Westphal <[email protected]>
netfilter: limit, hashlimit: avoid duplicated inline
Pablo Neira Ayuso <[email protected]>
netfilter: nf_ct_expect: fix possible access to uninitialized timer
Patrick McHardy <[email protected]>
netfilter: nf_nat_sip: fix via header translation with multiple parameters
Pablo Neira Ayuso <[email protected]>
netfilter: nf_nat_sip: fix incorrect handling of EBUSY for RTCP expectation
Lin Ming <[email protected]>
ipvs: fix oops on NAT reply in br_nf context
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: timeout fixing bug broke SET target special timeout value
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: fix timeout value overflow bug
Pablo Neira Ayuso <[email protected]>
netfilter: nf_conntrack: fix racy timer handling with reliable events
Julian Anastasov <[email protected]>
ipvs: fix oops in ip_vs_dst_event on rmmod
Amerigo Wang <[email protected]>
pktgen: fix crash when generating IPv6 packets
Jason Wessel <[email protected]>
kdb,vt_console: Fix missed data due to pager overruns
Dan Carpenter <[email protected]>
md/raid10: use correct limit variable
Felix Fietkau <[email protected]>
ath9k: use ieee80211_free_txskb
Hildner, Christian <[email protected]>
timers: Fix endless looping between cascade() and internal_add_timer()
Daniel Drake <[email protected]>
viafb: don't touch clock state on OLPC XO-1.5
Alexander Holler <[email protected]>
video/udlfb: fix line counting in fb_write
Matthew Garrett <[email protected]>
module: taint kernel when lve module is loaded
Ian Kent <[email protected]>
autofs4 - fix reset pending flag on mount fail
Tejun Heo <[email protected]>
block: fix request_queue->flags initialization
Konrad Rzeszutek Wilk <[email protected]>
xen/bootup: allow read_tscp call for Xen PV guests.
Konrad Rzeszutek Wilk <[email protected]>
xen/bootup: allow {read|write}_cr8 pvops call.
Peter Senna Tschudin <[email protected]>
target: fix return code in target_core_init_configfs error path
Trond Myklebust <[email protected]>
SUNRPC: Ensure that the TCP socket is closed when in CLOSE_WAIT
Stefan Richter <[email protected]>
firewire: cdev: fix user memory corruption (i386 userland on amd64 kernel)
Simon Horman <[email protected]>
ARM: 7541/1: Add ARM ERRATA 775420 workaround
Lukas Czerner <[email protected]>
SCSI: scsi_debug: Fix off-by-one bug when unmapping region
K. Y. Srinivasan <[email protected]>
SCSI: storvsc: Account for in-transit packets in the RESET path
Nicholas Bellinger <[email protected]>
iscsi-target: Bump defaults for nopin_timeout + nopin_response_timeout values
Nicholas Bellinger <[email protected]>
iscsi-target: Add explicit set of cache_dynamic_acls=1 for TPG demo-mode
Christoph Hellwig <[email protected]>
iscsit: remove incorrect unlock in iscsit_build_sendtargets_resp
Nicholas Bellinger <[email protected]>
iscsi-target: Correctly set 0xffffffff field within ISCSI_OP_REJECT PDU
Stephen M. Cameron <[email protected]>
SCSI: hpsa: dial down lockup detection during firmware flash
Hugh Dickins <[email protected]>
tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking
Jason Wessel <[email protected]>
mips,kgdb: fix recursive page fault with CONFIG_KPROBES
Takashi Iwai <[email protected]>
ALSA: hda - Fix memory leaks at error path in patch_cirrus.c
David Henningsson <[email protected]>
ALSA: hda - do not detect jack on internal speakers for Realtek
Feng Tang <[email protected]>
ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop
Feng Tang <[email protected]>
ACPI: EC: Make the GPE storm threshold a module parameter
Stanislav Kinsbursky <[email protected]>
lockd: use rpc client's cl_nodename for id encoding
Malahal Naineni <[email protected]>
NFSD: pass null terminated buf to kstrtouint()
J. Bruce Fields <[email protected]>
nfsd4: fix nfs4 stateid leak
Russell King <[email protected]>
ARM: vfp: fix saving d16-d31 vfp registers on v6+ kernels
-------------
Diffstat:
Makefile | 4 ++-- arch/arm/Kconfig | 10 ++++++++ arch/arm/include/asm/vfpmacros.h | 4 ++-- arch/arm/mm/cache-v7.S | 3 +++ arch/mips/kernel/kgdb.c | 9 ++++++++ arch/x86/xen/enlighten.c | 18 ++++++++++++++- block/blk-core.c | 2 +- drivers/acpi/ec.c | 30 ++++++++++++++++++++---- drivers/char/tpm/tpm.c | 21 +++++++++++------ drivers/firewire/core-cdev.c | 4 ++-- drivers/gpu/drm/i915/intel_display.c | 4 ++-- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 6 +---- drivers/md/raid10.c | 2 +- drivers/net/ethernet/intel/e1000e/e1000.h | 6 ++--- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- drivers/net/wireless/ath/ath9k/beacon.c | 2 +- drivers/net/wireless/ath/ath9k/main.c | 2 +- drivers/net/wireless/ath/ath9k/xmit.c | 53 +++++++++++++++++++++++------------------- drivers/scsi/hpsa.c | 39 +++++++++++++++++++++++++++---- drivers/scsi/hpsa.h | 2 ++ drivers/scsi/hpsa_cmd.h | 1 + drivers/scsi/scsi_debug.c | 2 +- drivers/scsi/storvsc_drv.c | 5 ++++ drivers/target/iscsi/iscsi_target.c | 2 +- drivers/target/iscsi/iscsi_target_core.h | 4 ++-- drivers/target/iscsi/iscsi_target_tpg.c | 12 ++++++++++ drivers/target/target_core_configfs.c | 8 ++++++- drivers/tty/vt/vt.c | 13 +++++++++++ drivers/usb/class/cdc-acm.c | 3 +++ drivers/usb/gadget/at91_udc.c | 2 +- drivers/video/udlfb.c | 2 +- drivers/video/via/via_clock.c | 19 +++++++++++++++ fs/autofs4/root.c | 6 +++-- fs/ceph/export.c | 18 +++++++++++---- fs/ecryptfs/ecryptfs_kernel.h | 2 ++ fs/ecryptfs/file.c | 100 ++++++++++++++++++++++++++++++++++++++----------------------------------------- fs/ecryptfs/inode.c | 65 ++++++++++++++++++++++++++------------------------- fs/ecryptfs/main.c | 1 + fs/ecryptfs/mmap.c | 39 +++++++++++-------------------- fs/gfs2/export.c | 4 ++++ fs/isofs/export.c | 2 +- fs/jbd/commit.c | 45 +++++++++++++++++++++++++++--------- fs/jbd/transaction.c | 64 ++++++++++++++++++++++++++++++++++---------------- fs/lockd/mon.c | 4 +++- fs/nfsd/nfs4idmap.c | 2 +- fs/nfsd/nfs4state.c | 1 + fs/reiserfs/inode.c | 6 ++++- fs/xfs/xfs_export.c | 3 +++ include/linux/netfilter/ipset/ip_set_timeout.h | 4 ++++ include/net/ip_vs.h | 2 +- include/net/netfilter/nf_conntrack_ecache.h | 1 + kernel/debug/kdb/kdb_io.c | 33 ++++++++++++++++++++++---- kernel/module.c | 4 ++++ kernel/timer.c | 10 ++++---- mm/shmem.c | 6 +++-- net/core/pktgen.c | 2 +- net/ipv4/netfilter/nf_nat_sip.c | 10 +++++--- net/netfilter/ipvs/ip_vs_ctl.c | 5 ++-- net/netfilter/nf_conntrack_core.c | 16 +++++++++---- net/netfilter/nf_conntrack_expect.c | 29 +++++------------------ net/netfilter/xt_hashlimit.c | 8 +++---- net/netfilter/xt_limit.c | 13 +++++------ net/netfilter/xt_set.c | 17 ++++++++++++-- net/sunrpc/xprtsock.c | 21 +++++++++++++---- sound/pci/ac97/ac97_codec.c | 2 ++ sound/pci/emu10k1/emu10k1_main.c | 9 ++++++++ sound/pci/hda/patch_cirrus.c | 6 ++--- sound/pci/hda/patch_realtek.c | 6 ++++- sound/soc/codecs/wm2200.c | 3 ++- sound/soc/omap/omap-abe-twl6040.c | 2 +- sound/soc/sh/fsi.c | 15 ++++++------ 71 files changed, 584 insertions(+), 298 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/62 ARM: vfp: fix saving d16-d31 vfp registers on v6+ kernels
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit 846a136881b8f73c1f74250bf6acfaa309cab1f2 upstream.
Michael Olbrich reported that his test program fails when built with -O2 -mcpu=cortex-a8 -mfpu=neon, and a kernel which supports v6 and v7 CPUs:
volatile int x = 2;
volatile int64_t y = 2;
int main() {
volatile int a = 0;
volatile int64_t b = 0;
while (1) {
a = (a + x) % (1 << 30);
b = (b + y) % (1 << 30);
assert(a == b);
}
}and two instances are run. When built for just v7 CPUs, this program works fine. It uses the "vadd.i64 d19, d18, d16" VFP instruction.
It appears that we do not save the high-16 double VFP registers across context switches when the kernel is built for v6 CPUs. Fix that.
--- arch/arm/include/asm/vfpmacros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/include/asm/vfpmacros.h +2 -2
@@ -28,7 +28,7 @@ ldr \tmp, =elf_hwcap @ may not have MVFR regs ldr \tmp, [\tmp, #0] tst \tmp, #HWCAP_VFPv3D16 - ldceq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} + ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} addne \base, \base, #32*4 @ step over unused register space#else VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
@@ -52,7 +52,7 @@ ldr \tmp, =elf_hwcap @ may not have MVFR regs ldr \tmp, [\tmp, #0] tst \tmp, #HWCAP_VFPv3D16 - stceq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} + stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} addne \base, \base, #32*4 @ step over unused register space#else VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
Greg Kroah-Hartman
maintainerPATCH 2/62 nfsd4: fix nfs4 stateid leak
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "J. Bruce Fields" <[email protected]>
commit cf9182e90b2af04245ac4fae497fe73fc71285b4 upstream.
Processes that open and close multiple files may end up setting this oo_last_closed_stid without freeing what was previously pointed to. This can result in a major leak, visible for example by watching the nfsd4_stateids line of /proc/slabinfo.
--- fs/nfsd/nfs4state.c | 1 + 1 file changed, 1 insertion(+)
fs/nfsd/nfs4state.c +1 -0
@@ -3783,6 +3783,7 @@ nfsd4_close(struct svc_rqst *rqstp, strumemcpy (&close->cl_stateid, &stp->st_stid.sc_stateid,sizeof (stateid_t));nfsd4_close_open_stateid (stp); +release_last_closed_stateid (oo); oo->oo_last_closed_stid = stp;/* place unused nfs4_stateowners on so_close_lru list to be
Greg Kroah-Hartman
maintainerPATCH 3/62 NFSD: pass null terminated buf to kstrtouint()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Malahal Naineni <[email protected]>
commit 9959ba0c241a71c7ed8133401cfbbee2720da0b5 upstream.
The 'buf' is prepared with null termination with intention of using it for this purpose, but 'name' is passed instead!
--- fs/nfsd/nfs4idmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4idmap.c +1 -1
@@ -581,7 +581,7 @@ numeric_name_to_id(struct svc_rqst *rqst/* Just to make sure it's null-terminated: */ memcpy (buf, name, namelen); buf[namelen] ='\0' ; - ret =kstrtouint (name,10 , id); + ret =kstrtouint (buf,10 , id);return ret ==0 ; }
Greg Kroah-Hartman
maintainerPATCH 4/62 lockd: use rpc clients cl_nodename for id encoding
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Kinsbursky <[email protected]>
commit 303a7ce92064c285a04c870f2dc0192fdb2968cb upstream.
Taking hostname from uts namespace if not safe, because this cuold be performind during umount operation on child reaper death. And in this case current->nsproxy is NULL already.
--- fs/lockd/mon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/lockd/mon.c +3 -1
@@ -40,6 +40,7 @@ struct nsm_args {u32 proc;char *mon_name; +char *nodename; };struct nsm_res {
@@ -94,6 +95,7 @@ static int nsm_mon_unmon(struct nsm_hand .vers = 3, .proc = NLMPROC_NSM_NOTIFY, .mon_name = nsm->sm_mon_name, + .nodename = utsname()->nodename, };struct rpc_message msg = { .rpc_argp = &args,
@@ -430,7 +432,7 @@ static void encode_my_id(struct xdr_stre {__be32 *p; -encode_nsm_string (xdr,utsname ()->nodename); +encode_nsm_string (xdr, argp->nodename); p =xdr_reserve_space (xdr,4 +4 +4 ); *p++ =cpu_to_be32 (argp->prog); *p++ =cpu_to_be32 (argp->vers);
Greg Kroah-Hartman
maintainerPATCH 5/62 ACPI: EC: Make the GPE storm threshold a module parameter
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feng Tang <[email protected]>
commit a520d52e99b14ba7db135e916348f12f2a6e09be upstream.
The Linux EC driver includes a mechanism to detect GPE storms, and switch from interrupt-mode to polling mode. However, polling mode sometimes doesn't work, so the workaround is problematic. Also, different systems seem to need the threshold for detecting the GPE storm at different levels.
ACPI_EC_STORM_THRESHOLD was initially 20 when it's created, and was changed to 8 in 2.6.28 commit 06cf7d3c7 "ACPI: EC: lower interrupt storm threshold" to fix kernel bug 11892 by forcing the laptop in that bug to work in polling mode. However in bug 45151, it works fine in interrupt mode if we lift the threshold back to 20.
This patch makes the threshold a module parameter so that user has a flexible option to debug/workaround this issue.
The default is unchanged.
This is also a preparation patch to fix specific systems:
https://bugzilla.kernel.org/show_bug.cgi?id=45151
--- drivers/acpi/ec.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/acpi/ec.c +10 -4
@@ -71,9 +71,6 @@ enum ec_command {#define ACPI_EC_UDELAY_GLK 1000/* Wait 1ms max. to get global lock */ #define ACPI_EC_MSI_UDELAY 550/* Wait 550us for MSI EC */ -#define ACPI_EC_STORM_THRESHOLD 8/* number of false interrupts -per one transaction */ -enum {EC_FLAGS_QUERY_PENDING ,/* Query is pending */ EC_FLAGS_GPE_STORM ,/* GPE storm detected */
@@ -87,6 +84,15 @@ static unsigned int ec_delay __read_mostmodule_param (ec_delay, uint,0644 );MODULE_PARM_DESC (ec_delay,"Timeout(ms) waited until an EC command completes" ); +/* +* If the number of false interrupts per one transaction exceeds +* this threshold, will think there is a GPE storm happened and +* will disable the GPE for normal transaction. +*/ +static unsigned int ec_storm_threshold__read_mostly =8 ; +module_param (ec_storm_threshold, uint,0644 ); +MODULE_PARM_DESC (ec_storm_threshold,"Maxim false GPE numbers not considered as GPE storm" ); +/* If we find an EC via the ECDT, we need to keep a ptr to its context */ /* External interfaces use first EC only, so remember */ typedef int (*acpi_ec_query_func ) (void *data);
@@ -319,7 +325,7 @@ static int acpi_ec_transaction(struct acmsleep (1 );/* It is safe to enable the GPE outside of the transaction. */ acpi_enable_gpe (NULL , ec->gpe); - }else if (t->irq_count >ACPI_EC_STORM_THRESHOLD ) { + }else if (t->irq_count > ec_storm_threshold) {pr_info (PREFIX "GPE storm detected, " "transactions will use polling mode\n" );set_bit (EC_FLAGS_GPE_STORM , &ec->flags);
Greg Kroah-Hartman
maintainerPATCH 6/62 ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feng Tang <[email protected]>
commit 67bfa9b60bd689601554526d144b21d529f78a09 upstream.
By enlarging the GPE storm threshold back to 20, that laptop's EC works fine with interrupt mode instead of polling mode.
https://bugzilla.kernel.org/show_bug.cgi?id=45151
--- drivers/acpi/ec.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/acpi/ec.c +15 -1
@@ -930,6 +930,17 @@ static int ec_flag_msi(const struct dmi_return 0 ; } +/* +* Clevo M720 notebook actually works ok with IRQ mode, if we lifted +* the GPE storm threshold back to 20 +*/ +static int ec_enlarge_storm_threshold (const struct dmi_system_id *id) +{ +pr_debug ("Setting the EC GPE storm threshold to 20\n" ); + ec_storm_threshold =20 ; +return 0 ; +} +static struct dmi_system_id __initdata ec_dmi_table[] = { { ec_skip_dsdt_scan,"Compal JFL92" , {
@@ -961,10 +972,13 @@ static struct dmi_system_id __initdata e { ec_validate_ecdt, "ASUS hardware", { DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc.") }, NULL}, + { + ec_enlarge_storm_threshold, "CLEVO hardware", { +DMI_MATCH (DMI_SYS_VENDOR ,"CLEVO Co." ), + DMI_MATCH(DMI_PRODUCT_NAME, "M720T/M730T"),}, NULL}, {}, }; -int __init acpi_ec_ecdt_probe (void ) {acpi_status status;
Greg Kroah-Hartman
maintainerPATCH 7/62 ALSA: hda - do not detect jack on internal speakers for Realtek
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Henningsson <[email protected]>
commit f7f4b2322bf7b8c5929b7eb5a667091f32592580 upstream.
This caused the internal speaker to mute itself because it was present, which happened after powersave.
It was found on Dell XPS 15 (L502x), ALC665.
--- sound/pci/hda/patch_realtek.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_realtek.c +2 -0
@@ -602,6 +602,8 @@ static void alc_line_automute(struct hda {struct alc_spec *spec = codec->spec; +if (spec->autocfg.line_out_type ==AUTO_PIN_SPEAKER_OUT ) +return ;/* check LO jack only when it's different from HP */ if (spec->autocfg.line_out_pins[0 ] == spec->autocfg.hp_pins[0 ])return ;
Greg Kroah-Hartman
maintainerPATCH 8/62 ALSA: hda - Fix memory leaks at error path in patch_cirrus.c
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit c5e0b6dbad9b4d18c561af90b384d02373f1c994 upstream.
The proper destructor should be called at the error path.
--- sound/pci/hda/patch_cirrus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/hda/patch_cirrus.c +3 -3
@@ -1427,7 +1427,7 @@ static int patch_cs420x(struct hda_codecreturn 0 ; error: -kfree (codec->spec); +cs_free (codec); codec->spec =NULL ;return err; }
@@ -1984,7 +1984,7 @@ static int patch_cs4210(struct hda_codecreturn 0 ; error: -kfree (codec->spec); +cs_free (codec); codec->spec =NULL ;return err; }
@@ -2009,7 +2009,7 @@ static int patch_cs4213(struct hda_codecreturn 0 ; error: -kfree (codec->spec); +cs_free (codec); codec->spec =NULL ;return err; }
Greg Kroah-Hartman
maintainerPATCH 9/62 mips,kgdb: fix recursive page fault with CONFIG_KPROBES
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wessel <[email protected]>
commit f0a996eeeda214f4293e234df33b29bec003b536 upstream.
This fault was detected using the kgdb test suite on boot and it crashes recursively due to the fact that CONFIG_KPROBES on mips adds an extra die notifier in the page fault handler. The crash signature looks like this:
kgdbts:RUN bad memory access test
KGDB: re-enter exception: ALL breakpoints killed
Call Trace: [<807b7548>] dump_stack+0x20/0x54 [<807b7548>] dump_stack+0x20/0x54
The fix for now is to have kgdb return immediately if the fault type is DIE_PAGE_FAULT and allow the kprobe code to decide what is supposed to happen.
--- arch/mips/kernel/kgdb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/mips/kernel/kgdb.c +9 -0
@@ -283,6 +283,15 @@ static int kgdb_mips_notify(struct notifstruct pt_regs *regs = args->regs;int trap = (regs->cp0_cause &0x7c ) >>2 ; +#ifdef CONFIG_KPROBES +/* +* Return immediately if the kprobes fault notifier has set +* DIE_PAGE_FAULT. +*/ +if (cmd ==DIE_PAGE_FAULT ) +return NOTIFY_DONE ; +#endif /* CONFIG_KPROBES */ +/* Userspace events, ignore. */ if (user_mode (regs))return NOTIFY_DONE ;
Greg Kroah-Hartman
maintainerPATCH 10/62 tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugh Dickins <[email protected]>
commit 35c2a7f4908d404c9124c2efc6ada4640ca4d5d5 upstream.
Fuzzing with trinity oopsed on the 1st instruction of shmem_fh_to_dentry(),
u64 inum = fid->raw[2];
which is unhelpfully reported as at the end of shmem_alloc_inode():
BUG: unable to handle kernel paging request at ffff880061cd3000 IP: [<ffffffff812190d0>] shmem_alloc_inode+0x40/0x40 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC Call Trace: [<ffffffff81488649>] ? exportfs_decode_fh+0x79/0x2d0 [<ffffffff812d77c3>] do_handle_open+0x163/0x2c0 [<ffffffff812d792c>] sys_open_by_handle_at+0xc/0x10 [<ffffffff83a5f3f8>] tracesys+0xe1/0xe6
Right, tmpfs is being stupid to access fid->raw[2] before validating that fh_len includes it: the buffer kmalloc'ed by do_sys_name_to_handle() may fall at the end of a page, and the next page not be present.
But some other filesystems (ceph, gfs2, isofs, reiserfs, xfs) are being careless about fh_len too, in fh_to_dentry() and/or fh_to_parent(), and could oops in the same way: add the missing fh_len checks to those.
--- fs/ceph/export.c | 18 ++++++++++++++---- fs/gfs2/export.c | 4 ++++ fs/isofs/export.c | 2 +- fs/reiserfs/inode.c | 6 +++++- fs/xfs/xfs_export.c | 3 +++ mm/shmem.c | 6 ++++-- 6 files changed, 31 insertions(+), 8 deletions(-)
fs/ceph/export.c +14 -4
@@ -89,7 +89,7 @@ static int ceph_encode_fh(struct dentry* FIXME: we should try harder by querying the mds for the ino. */ static struct dentry *__fh_to_dentry (struct super_block *sb, -struct ceph_nfs_fh *fh) +struct ceph_nfs_fh *fh,int fh_len) {struct ceph_mds_client *mdsc =ceph_sb_to_client (sb)->mdsc;struct inode *inode;
@@ -97,6 +97,9 @@ static struct dentry *__fh_to_dentry(strstruct ceph_vino vino;int err; +if (fh_len <sizeof (*fh) /4 ) +return ERR_PTR (-ESTALE ); +dout ("__fh_to_dentry %llx\n" , fh->ino); vino.ino = fh->ino; vino.snap =CEPH_NOSNAP ;
@@ -140,7 +143,7 @@ static struct dentry *__fh_to_dentry(str* convert connectable fh to dentry */ static struct dentry *__cfh_to_dentry (struct super_block *sb, -struct ceph_nfs_confh *cfh) +struct ceph_nfs_confh *cfh,int fh_len) {struct ceph_mds_client *mdsc =ceph_sb_to_client (sb)->mdsc;struct inode *inode;
@@ -148,6 +151,9 @@ static struct dentry *__cfh_to_dentry(ststruct ceph_vino vino;int err; +if (fh_len <sizeof (*cfh) /4 ) +return ERR_PTR (-ESTALE ); +dout ("__cfh_to_dentry %llx (%llx/%x)\n" , cfh->ino, cfh->parent_ino, cfh->parent_name_hash);
@@ -197,9 +203,11 @@ static struct dentry *ceph_fh_to_dentry( int fh_len, int fh_type) {if (fh_type ==1 ) -return __fh_to_dentry (sb, (struct ceph_nfs_fh *)fid->raw); +return __fh_to_dentry (sb, (struct ceph_nfs_fh *)fid->raw, + fh_len);else -return __cfh_to_dentry (sb, (struct ceph_nfs_confh *)fid->raw); +return __cfh_to_dentry (sb, (struct ceph_nfs_confh *)fid->raw, + fh_len); }/*
@@ -220,6 +228,8 @@ static struct dentry *ceph_fh_to_parent(if (fh_type ==1 )return ERR_PTR (-ESTALE ); +if (fh_len <sizeof (*cfh) /4 ) +return ERR_PTR (-ESTALE );pr_debug ("fh_to_parent %llx/%d\n" , cfh->parent_ino, cfh->parent_name_hash);
fs/gfs2/export.c +4 -0
@@ -168,6 +168,8 @@ static struct dentry *gfs2_fh_to_dentry(case GFS2_SMALL_FH_SIZE :case GFS2_LARGE_FH_SIZE :case GFS2_OLD_FH_SIZE : +if (fh_len <GFS2_SMALL_FH_SIZE ) +return NULL ; this.no_formal_ino = ((u64 )be32_to_cpu (fh[0 ])) <<32 ; this.no_formal_ino |=be32_to_cpu (fh[1 ]); this.no_addr = ((u64 )be32_to_cpu (fh[2 ])) <<32 ;
@@ -187,6 +189,8 @@ static struct dentry *gfs2_fh_to_parent(switch (fh_type) {case GFS2_LARGE_FH_SIZE :case GFS2_OLD_FH_SIZE : +if (fh_len <GFS2_LARGE_FH_SIZE ) +return NULL ; parent.no_formal_ino = ((u64 )be32_to_cpu (fh[4 ])) <<32 ; parent.no_formal_ino |=be32_to_cpu (fh[5 ]); parent.no_addr = ((u64 )be32_to_cpu (fh[6 ])) <<32 ;
fs/isofs/export.c +1 -1
@@ -179,7 +179,7 @@ static struct dentry *isofs_fh_to_parent {struct isofs_fid *ifid = (struct isofs_fid *)fid; -if (fh_type !=2 ) +if (fh_len <2 || fh_type !=2 )return NULL ; return isofs_export_iget(sb,
fs/reiserfs/inode.c +5 -1
@@ -1573,8 +1573,10 @@ struct dentry *reiserfs_fh_to_dentry(strreiserfs_warning (sb,"reiserfs-13077" ,"nfsd/reiserfs, fhtype=%d, len=%d - odd" , fh_type, fh_len); - fh_type =5 ; + fh_type = fh_len; } +if (fh_len <2 ) +return NULL ;return reiserfs_get_dentry (sb, fid->raw[0 ], fid->raw[1 ], (fh_type ==3 || fh_type >=5 ) ? fid->raw[2 ] :0 );
@@ -1583,6 +1585,8 @@ struct dentry *reiserfs_fh_to_dentry(strstruct dentry *reiserfs_fh_to_parent (struct super_block *sb,struct fid *fid,int fh_len,int fh_type) { +if (fh_type > fh_len) + fh_type = fh_len;if (fh_type <4 )return NULL ;
fs/xfs/xfs_export.c +3 -0
@@ -195,6 +195,9 @@ xfs_fs_fh_to_parent(struct super_block *struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fid;struct inode *inode =NULL ; +if (fh_len <xfs_fileid_length (fileid_type)) +return NULL ; +switch (fileid_type) {case FILEID_INO32_GEN_PARENT : inode = xfs_nfs_get_inode(sb, fid->i32.parent_ino,
mm/shmem.c +4 -2
@@ -2018,12 +2018,14 @@ static struct dentry *shmem_fh_to_dentry {struct inode *inode;struct dentry *dentry =NULL ; -u64 inum = fid->raw[2 ]; - inum = (inum <<32 ) | fid->raw[1 ]; +u64 inum;if (fh_len <3 )return NULL ; + inum = fid->raw[2 ]; + inum = (inum <<32 ) | fid->raw[1 ]; + inode =ilookup5 (sb, (unsigned long )(inum + fid->raw[0 ]), shmem_match, fid->raw);if (inode) {
Greg Kroah-Hartman
maintainerPATCH 11/62 SCSI: hpsa: dial down lockup detection during firmware flash
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Stephen M. Cameron" <[email protected]>
commit e85c59746957fd6e3595d02cf614370056b5816e upstream.
Dial back the aggressiveness of the controller lockup detection thread. Currently it will declare the controller to be locked up if it goes for 10 seconds with no interrupts and no change in the heartbeat register. Dial back this to 30 seconds with no heartbeat change, and also snoop the ioctl path and if a firmware flash command is detected, dial it back further to 4 minutes until the firmware flash command completes. The reason for this is that during the firmware flash operation, the controller apparently doesn't update the heartbeat register as frequently as it is supposed to, and we can get a false positive.
--- drivers/scsi/hpsa.c | 39 ++++++++++++++++++++++++++++++++++----- drivers/scsi/hpsa.h | 2 ++ drivers/scsi/hpsa_cmd.h | 1 + 3 files changed, 37 insertions(+), 5 deletions(-)
drivers/scsi/hpsa.c +34 -5
@@ -548,12 +548,42 @@ static void set_performant_mode(struct c c->busaddr |=1 | (h->blockFetchTable[c->Header.SGList] <<1 ); } +static int is_firmware_flash_cmd (u8 *cdb) +{ +return cdb[0 ] ==BMIC_WRITE && cdb[6 ] ==BMIC_FLASH_FIRMWARE ; +} + +/* +* During firmware flash, the heartbeat register may not update as frequently +* as it should. So we dial down lockup detection during firmware flash. and +* dial it back up when firmware flash completes. +*/ +#define HEARTBEAT_SAMPLE_INTERVAL_DURING_FLASH (240 * HZ) +#define HEARTBEAT_SAMPLE_INTERVAL (30 * HZ) +static void dial_down_lockup_detection_during_fw_flash (struct ctlr_info *h, +struct CommandList *c) +{ +if (!is_firmware_flash_cmd (c->Request.CDB)) +return ; +atomic_inc (&h->firmware_flash_in_progress); + h->heartbeat_sample_interval =HEARTBEAT_SAMPLE_INTERVAL_DURING_FLASH ; +} + +static void dial_up_lockup_detection_on_fw_flash_complete (struct ctlr_info *h, +struct CommandList *c) +{ +if (is_firmware_flash_cmd (c->Request.CDB) && +atomic_dec_and_test (&h->firmware_flash_in_progress)) + h->heartbeat_sample_interval =HEARTBEAT_SAMPLE_INTERVAL ; +} +static void enqueue_cmd_and_start_io (struct ctlr_info *h,struct CommandList *c) {unsigned long flags;set_performant_mode (h, c); +dial_down_lockup_detection_during_fw_flash (h, c);spin_lock_irqsave (&h->lock, flags);addQ (&h->reqQ, c); h->Qdepth++;
@@ -3049,6 +3079,7 @@ static inline int bad_tag(struct ctlr_instatic inline void finish_cmd (struct CommandList *c,u32 raw_tag) {removeQ (c); +dial_up_lockup_detection_on_fw_flash_complete (c->h, c);if (likely (c->cmd_type ==CMD_SCSI ))complete_scsi_command (c);else if (c->cmd_type ==CMD_IOCTL_PEND )
@@ -4189,9 +4220,6 @@ static void controller_lockup_detected(sspin_unlock_irqrestore (&h->lock, flags); } -#define HEARTBEAT_SAMPLE_INTERVAL (10 * HZ) -#define HEARTBEAT_CHECK_MINIMUM_INTERVAL (HEARTBEAT_SAMPLE_INTERVAL / 2) -static void detect_controller_lockup (struct ctlr_info *h) {u64 now;
@@ -4202,7 +4230,7 @@ static void detect_controller_lockup(str now =get_jiffies_64 ();/* If we've received an interrupt recently, we're ok. */ if (time_after64 (h->last_intr_timestamp + - (HEARTBEAT_CHECK_MINIMUM_INTERVAL ), now)) + (h->heartbeat_sample_interval), now))return ;/*
@@ -4211,7 +4239,7 @@ static void detect_controller_lockup(str* otherwise don't care about signals in this thread. */ if (time_after64 (h->last_heartbeat_timestamp + - (HEARTBEAT_CHECK_MINIMUM_INTERVAL ), now)) + (h->heartbeat_sample_interval), now))return ;/* If heartbeat has not changed since we last looked, we're not ok. */
@@ -4253,6 +4281,7 @@ static void add_ctlr_to_lockup_detector_ {unsigned long flags; + h->heartbeat_sample_interval =HEARTBEAT_SAMPLE_INTERVAL ;spin_lock_irqsave (&lockup_detector_lock, flags);list_add_tail (&h->lockup_list, &hpsa_ctlr_list);spin_unlock_irqrestore (&lockup_detector_lock, flags);
drivers/scsi/hpsa.h +2 -0
@@ -123,6 +123,8 @@ struct ctlr_info {u64 last_intr_timestamp;u32 last_heartbeat;u64 last_heartbeat_timestamp; +u32 heartbeat_sample_interval; +atomic_t firmware_flash_in_progress;u32 lockup_detected;struct list_head lockup_list; };
drivers/scsi/hpsa_cmd.h +1 -0
@@ -162,6 +162,7 @@ struct SenseSubsystem_info {#define BMIC_WRITE 0x27#define BMIC_CACHE_FLUSH 0xc2#define HPSA_CACHE_FLUSH 0x01/* C2 was already being used by HPSA */ +#define BMIC_FLASH_FIRMWARE 0xF7/* Command List Structure */ union SCSI3Addr {
Greg Kroah-Hartman
maintainerPATCH 12/62 iscsi-target: Correctly set 0xffffffff field within ISCSI_OP_REJECT PDU
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit f25590f39d543272f7ae7b00d533359c8d7ff331 upstream.
This patch adds a missing iscsi_reject->ffffffff assignment within iscsit_send_reject() code to properly follow RFC-3720 Section 10.17 Bytes 16 -> 19 for the PDU format definition of ISCSI_OP_REJECT.
We've not seen any initiators care about this bytes in practice, but as Ronnie reported this was causing trouble with wireshark packet decoding lets go ahead and fix this up now.
--- drivers/target/iscsi/iscsi_target.c | 1 + 1 file changed, 1 insertion(+)
drivers/target/iscsi/iscsi_target.c +1 -0
@@ -3349,6 +3349,7 @@ static int iscsit_send_reject( hdr->opcode =ISCSI_OP_REJECT ; hdr->flags |=ISCSI_FLAG_CMD_FINAL ;hton24 (hdr->dlength,ISCSI_HDR_LEN ); + hdr->ffffffff =0xffffffff ; cmd->stat_sn = conn->stat_sn++; hdr->statsn =cpu_to_be32 (cmd->stat_sn); hdr->exp_cmdsn =cpu_to_be32 (conn->sess->exp_cmd_sn);
Greg Kroah-Hartman
maintainerPATCH 13/62 iscsit: remove incorrect unlock in iscsit_build_sendtargets_resp
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
commit 904753da183566c71211d23c169a80184648c121 upstream.
Fix a potential multiple spin-unlock -> deadlock scenario during the overflow check within iscsit_build_sendtargets_resp() as found by sparse static checking.
--- drivers/target/iscsi/iscsi_target.c | 1 - 1 file changed, 1 deletion(-)
drivers/target/iscsi/iscsi_target.c +0 -1
@@ -3196,7 +3196,6 @@ static int iscsit_build_sendtargets_resp len +=1 ;if ((len + payload_len) > buffer_len) { -spin_unlock (&tiqn->tiqn_tpg_lock); end_of_buf =1 ; goto eob; }
Greg Kroah-Hartman
maintainerPATCH 14/62 iscsi-target: Add explicit set of cache_dynamic_acls=1 for TPG demo-mode
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit 38b11bae6ba02da352340aff12ee25755977b222 upstream.
We've had reports in the past about this specific case, so it's time to go ahead and explicitly set cache_dynamic_acls=1 for generate_node_acls=1 (TPG demo-mode) operation.
During normal generate_node_acls=0 operation with explicit NodeACLs -> se_node_acl memory is persistent to the configfs group located at /sys/kernel/config/target/$TARGETNAME/$TPGT/acls/$INITIATORNAME, so in the generate_node_acls=1 case we want the reservation logic to reference existing per initiator IQN se_node_acl memory (not to generate a new se_node_acl), so go ahead and always set cache_dynamic_acls=1 when TPG demo-mode is enabled.
--- drivers/target/iscsi/iscsi_target_tpg.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/target/iscsi/iscsi_target_tpg.c +12 -0
@@ -672,6 +672,12 @@ int iscsit_ta_generate_node_acls(pr_debug ("iSCSI_TPG[%hu] - Generate Initiator Portal Group ACLs: %s\n" , tpg->tpgt, (a->generate_node_acls) ?"Enabled" :"Disabled" ); +if (flag ==1 && a->cache_dynamic_acls ==0 ) { +pr_debug ("Explicitly setting cache_dynamic_acls=1 when " +"generate_node_acls=1\n" ); + a->cache_dynamic_acls =1 ; + } +return 0 ; }
@@ -711,6 +717,12 @@ int iscsit_ta_cache_dynamic_acls(return -EINVAL ; } +if (a->generate_node_acls ==1 && flag ==0 ) { +pr_debug ("Skipping cache_dynamic_acls=0 when" +" generate_node_acls=1\n" ); +return 0 ; + } + a->cache_dynamic_acls = flag; pr_debug("iSCSI_TPG[%hu] - Cache Dynamic Initiator Portal Group" " ACLs %s\n", tpg->tpgt, (a->cache_dynamic_acls) ?
Greg Kroah-Hartman
maintainerPATCH 15/62 iscsi-target: Bump defaults for nopin_timeout + nopin_response_timeout values
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit cf0eb28d3ba60098865bf7dbcbfdd6b1cc483e3b upstream.
This patch increases the default for nopin_timeout to 15 seconds (wait between sending a new NopIN ping) and nopin_response_timeout to 30 seconds (wait for NopOUT response before failing the connection) in order to avoid false positives by iSCSI Initiators who are not always able (under load) to respond to NopIN echo PING requests within the current 5 second window.
False positives have been observed recently using Open-iSCSI code on v3.3.x with heavy large-block READ workloads over small MTU 1 Gb/sec ports, and increasing these values to more reasonable defaults significantly reduces the possibility of false positive NopIN response timeout events under this specific workload.
Historically these have been set low to initiate connection recovery as soon as possible if we don't hear a ping back, but for modern v3.x code on 1 -> 10 Gb/sec ports these new defaults make alot more sense.
--- drivers/target/iscsi/iscsi_target_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/iscsi/iscsi_target_core.h +2 -2
@@ -25,10 +25,10 @@#define NA_DATAOUT_TIMEOUT_RETRIES 5#define NA_DATAOUT_TIMEOUT_RETRIES_MAX 15#define NA_DATAOUT_TIMEOUT_RETRIES_MIN 1 -#define NA_NOPIN_TIMEOUT 5 +#define NA_NOPIN_TIMEOUT 15#define NA_NOPIN_TIMEOUT_MAX 60#define NA_NOPIN_TIMEOUT_MIN 3 -#define NA_NOPIN_RESPONSE_TIMEOUT 5 +#define NA_NOPIN_RESPONSE_TIMEOUT 30#define NA_NOPIN_RESPONSE_TIMEOUT_MAX 60#define NA_NOPIN_RESPONSE_TIMEOUT_MIN 3#define NA_RANDOM_DATAIN_PDU_OFFSETS 0
Greg Kroah-Hartman
maintainerPATCH 16/62 SCSI: storvsc: Account for in-transit packets in the RESET path
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "K. Y. Srinivasan" <[email protected]>
commit 5c1b10ab7f93d24f29b5630286e323d1c5802d5c upstream.
Properly account for I/O in transit before returning from the RESET call. In the absense of this patch, we could have a situation where the host may respond to a command that was issued prior to the issuance of the RESET command at some arbitrary time after responding to the RESET command. Currently, the host does not do anything with the RESET command.
--- drivers/scsi/storvsc_drv.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/scsi/storvsc_drv.c +5 -0
@@ -1211,7 +1211,12 @@ static int storvsc_host_reset_handler(st/* * At this point, all outstanding requests in the adapter * should have been flushed out and return to us +* There is a potential race here where the host may be in +* the process of responding when we return from here. +* Just wait for all in-transit packets to be accounted for +* before we return from here. */ +storvsc_wait_to_drain (stor_device);return SUCCESS ; }
Greg Kroah-Hartman
maintainerPATCH 17/62 SCSI: scsi_debug: Fix off-by-one bug when unmapping region
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Czerner <[email protected]>
commit bc977749e967daa56de1922cf4cb38525631c51c upstream.
Currently it is possible to unmap one more block than user requested to due to the off-by-one error in unmap_region(). This is probably due to the fact that the end variable despite its name actually points to the last block to unmap + 1. However in the condition it is handled as the last block of the region to unmap.
The bug was not previously spotted probably due to the fact that the region was not zeroed, which has changed with commit be1dd78de5686c062bb3103f9e86d444a10ed783. With that commit we were able to corrupt the ext4 file system on 256M scsi_debug device with LBPRZ enabled using fstrim.
Since the 'end' semantic is the same in several functions there this commit just fixes the condition to use the 'end' variable correctly in that context.
--- drivers/scsi/scsi_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_debug.c +1 -1
@@ -2054,7 +2054,7 @@ static void unmap_region(sector_t lba, u block = lba + alignment; rem =do_div (block, granularity); -if (rem ==0 && lba + granularity <= end && block < map_size) { +if (rem ==0 && lba + granularity < end && block < map_size) {clear_bit (block, map_storep);if (scsi_debug_lbprz) memset(fake_storep +
Greg Kroah-Hartman
maintainerPATCH 18/62 ARM: 7541/1: Add ARM ERRATA 775420 workaround
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Horman <[email protected]>
commit 7253b85cc62d6ff84143d96fe6cd54f73736f4d7 upstream.
arm: Add ARM ERRATA 775420 workaround
Workaround for the 775420 Cortex-A9 (r2p2, r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance operation aborts with MMU exception, it might cause the processor to deadlock. This workaround puts DSB before executing ISB if an abort may occur on cache maintenance.
Based on work by Kouei Abe and feedback from Catalin Marinas.
[ [email protected]: Changed to implementation
suggested by [email protected] ]
--- arch/arm/Kconfig | 10 ++++++++++ arch/arm/mm/cache-v7.S | 3 +++ 2 files changed, 13 insertions(+)
arch/arm/Kconfig +10 -0
@@ -1405,6 +1405,16 @@ config PL310_ERRATA_769419 on systems with an outer cache, the store buffer is drained explicitly. +config ARM_ERRATA_775420 + bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock" + depends on CPU_V7 + help + This option enables the workaround for the 775420 Cortex-A9 (r2p2, + r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance + operation aborts with MMU exception, it might cause the processor + to deadlock. This workaround puts DSB before executing ISB if + an abort may occur on cache maintenance. + endmenu source "arch/arm/common/Kconfig"
arch/arm/mm/cache-v7.S +3 -0
@@ -211,6 +211,9 @@ ENTRY(v7_coherent_user_range) * isn't mapped, just try the next page. */ 9001: +#ifdef CONFIG_ARM_ERRATA_775420 + dsb +#endif mov r12, r12, lsr #12 mov r12, r12, lsl #12 add r12, r12, #4096
Greg Kroah-Hartman
maintainerPATCH 19/62 firewire: cdev: fix user memory corruption (i386 userland on amd64 kernel)
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Richter <[email protected]>
commit 790198f74c9d1b46b6a89504361b1a844670d050 upstream.
Fix two bugs of the /dev/fw* character device concerning the FW_CDEV_IOC_GET_INFO ioctl with nonzero fw_cdev_get_info.bus_reset. (Practically all /dev/fw* clients issue this ioctl right after opening the device.)
Both bugs are caused by sizeof(struct fw_cdev_event_bus_reset) being 36 without natural alignment and 40 with natural alignment.
1) Memory corruption, affecting i386 userland on amd64 kernel:
Userland reserves a 36 bytes large buffer, kernel writes 40 bytes. This has been first found and reported against libraw1394 if compiled with gcc 4.7 which happens to order libraw1394's stack such that the bug became visible as data corruption.
2) Information leak, affecting all kernel architectures except i386:
4 bytes of random kernel stack data were leaked to userspace.
Hence limit the respective copy_to_user() to the 32-bit aligned size of struct fw_cdev_event_bus_reset.
--- drivers/firewire/core-cdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firewire/core-cdev.c +2 -2
@@ -471,8 +471,8 @@ static int ioctl_get_info(struct client client->bus_reset_closure = a->bus_reset_closure;if (a->bus_reset !=0 ) {fill_bus_reset_event (&bus_reset, client); - ret =copy_to_user (u64_to_uptr (a->bus_reset), - &bus_reset,sizeof (bus_reset)); +/* unaligned size of bus_reset is 36 bytes */ + ret =copy_to_user (u64_to_uptr (a->bus_reset), &bus_reset,36 ); }if (ret ==0 &&list_empty (&client->link))list_add_tail (&client->link, &client->device->client_list);
Greg Kroah-Hartman
maintainerPATCH 20/62 SUNRPC: Ensure that the TCP socket is closed when in CLOSE_WAIT
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit a519fc7a70d1a918574bb826cc6905b87b482eb9 upstream.
Instead of doing a shutdown() call, we need to do an actual close(). Ditto if/when the server is sending us junk RPC headers.
--- net/sunrpc/xprtsock.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
net/sunrpc/xprtsock.c +16 -5
@@ -1028,6 +1028,16 @@ static void xs_udp_data_ready(struct socread_unlock_bh (&sk->sk_callback_lock); } +/* +* Helper function to force a TCP close if the server is sending +* junk and/or it has put us in CLOSE_WAIT +*/ +static void xs_tcp_force_close (struct rpc_xprt *xprt) +{ +set_bit (XPRT_CONNECTION_CLOSE , &xprt->state); +xprt_force_disconnect (xprt); +} +static inline void xs_tcp_read_fraghdr (struct rpc_xprt *xprt,struct xdr_skb_reader *desc) { struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
@@ -1054,7 +1064,7 @@ static inline void xs_tcp_read_fraghdr(s/* Sanity check of the record length */ if (unlikely (transport->tcp_reclen <8 )) {dprintk ("RPC: invalid TCP record fragment length\n" ); -xprt_force_disconnect (xprt); +xs_tcp_force_close (xprt);return ; } dprintk("RPC: reading TCP record fragment of length %d\n",
@@ -1135,7 +1145,7 @@ static inline void xs_tcp_read_calldir(sbreak ;default :dprintk ("RPC: invalid request message type\n" ); -xprt_force_disconnect (&transport->xprt); +xs_tcp_force_close (&transport->xprt); }xs_tcp_check_fraghdr (transport); }
@@ -1458,6 +1468,8 @@ static void xs_tcp_cancel_linger_timeoutstatic void xs_sock_mark_closed (struct rpc_xprt *xprt) {smp_mb__before_clear_bit (); +clear_bit (XPRT_CONNECTION_ABORT , &xprt->state); +clear_bit (XPRT_CONNECTION_CLOSE , &xprt->state);clear_bit (XPRT_CLOSE_WAIT , &xprt->state);clear_bit (XPRT_CLOSING , &xprt->state);smp_mb__after_clear_bit ();
@@ -1515,8 +1527,8 @@ static void xs_tcp_state_change(struct sbreak ;case TCP_CLOSE_WAIT :/* The server initiated a shutdown of the socket */ -xprt_force_disconnect (xprt); xprt->connect_cookie++; +xs_tcp_force_close (xprt);case TCP_CLOSING :/* * If the server closed down the connection, make sure that
@@ -2159,8 +2171,7 @@ static void xs_tcp_setup_socket(struct w/* We're probably in TIME_WAIT. Get rid of existing socket, * and retry */ -set_bit (XPRT_CONNECTION_CLOSE , &xprt->state); -xprt_force_disconnect (xprt); +xs_tcp_force_close (xprt);break ;case -ECONNREFUSED :case -ECONNRESET :
Greg Kroah-Hartman
maintainerPATCH 21/62 target: fix return code in target_core_init_configfs error path
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Senna Tschudin <[email protected]>
commit 37bb7899ca366dc212b71b150e78566d04808cc0 upstream.
This patch fixes error cases within target_core_init_configfs() to properly set ret = -ENOMEM before jumping to the out_global exception path.
This was originally discovered with the following Coccinelle semantic match information:
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
--- drivers/target/target_core_configfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/target/target_core_configfs.c +7 -1
@@ -3115,6 +3115,7 @@ static int __init target_core_init_confi GFP_KERNEL);if (!target_cg->default_groups) {pr_err ("Unable to allocate target_cg->default_groups\n" ); + ret = -ENOMEM ; goto out_global; }
@@ -3130,6 +3131,7 @@ static int __init target_core_init_confi GFP_KERNEL);if (!hba_cg->default_groups) {pr_err ("Unable to allocate hba_cg->default_groups\n" ); + ret = -ENOMEM ; goto out_global; } config_group_init_type_name(&alua_group,
@@ -3145,6 +3147,7 @@ static int __init target_core_init_confi GFP_KERNEL);if (!alua_cg->default_groups) {pr_err ("Unable to allocate alua_cg->default_groups\n" ); + ret = -ENOMEM ; goto out_global; }
@@ -3156,14 +3159,17 @@ static int __init target_core_init_confi* Add core/alua/lu_gps/default_lu_gp */ lu_gp =core_alua_allocate_lu_gp ("default_lu_gp" ,1 ); -if (IS_ERR (lu_gp)) +if (IS_ERR (lu_gp)) { + ret = -ENOMEM ; goto out_global; + } lu_gp_cg = &alua_lu_gps_group; lu_gp_cg->default_groups =kzalloc (sizeof (struct config_group ) *2 ,GFP_KERNEL );if (!lu_gp_cg->default_groups) {pr_err ("Unable to allocate lu_gp_cg->default_groups\n" ); + ret = -ENOMEM ; goto out_global; }
Greg Kroah-Hartman
maintainerPATCH 22/62 xen/bootup: allow {read|write}_cr8 pvops call.
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
commit 1a7bbda5b1ab0e02622761305a32dc38735b90b2 upstream.
We actually do not do anything about it. Just return a default value of zero and if the kernel tries to write anything but 0 we BUG_ON.
This fixes the case when an user tries to suspend the machine and it blows up in save_processor_state b/c 'read_cr8' is set to NULL and we get:
kernel BUG at /home/konrad/ssd/linux/arch/x86/include/asm/paravirt.h:100! invalid opcode: 0000 [#1] SMP
Pid: 2687, comm: init.late Tainted: G O 3.6.0upstream-00002-gac264ac-dirty #4 Bochs Bochs
RIP: e030:[<ffffffff814d5f42>] [<ffffffff814d5f42>] save_processor_state+0x212/0x270
.. snip..
Call Trace: [<ffffffff810733bf>] do_suspend_lowlevel+0xf/0xac [<ffffffff8107330c>] ? x86_acpi_suspend_lowlevel+0x10c/0x150 [<ffffffff81342ee2>] acpi_suspend_enter+0x57/0xd5
--- arch/x86/xen/enlighten.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
arch/x86/xen/enlighten.c +15 -1
@@ -942,7 +942,16 @@ static void xen_write_cr4(unsigned longnative_write_cr4 (cr4); } - +#ifdef CONFIG_X86_64 +static inline unsigned long xen_read_cr8 (void ) +{ +return 0 ; +} +static inline void xen_write_cr8 (unsigned long val) +{ +BUG_ON (val); +} +#endif static int xen_write_msr_safe (unsigned int msr,unsigned low,unsigned high) {int ret;
@@ -1111,6 +1120,11 @@ static const struct pv_cpu_ops xen_cpu_o .read_cr4_safe = native_read_cr4_safe, .write_cr4 = xen_write_cr4, +#ifdef CONFIG_X86_64 + .read_cr8 = xen_read_cr8, + .write_cr8 = xen_write_cr8, +#endif + .wbinvd = native_wbinvd, .read_msr = native_read_msr_safe,
Greg Kroah-Hartman
maintainerPATCH 23/62 xen/bootup: allow read_tscp call for Xen PV guests.
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
commit cd0608e71e9757f4dae35bcfb4e88f4d1a03a8ab upstream.
The hypervisor will trap it. However without this patch, we would crash as the .read_tscp is set to NULL. This patch fixes it and sets it to the native_read_tscp call.
--- arch/x86/xen/enlighten.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/xen/enlighten.c +2 -0
@@ -1135,6 +1135,8 @@ static const struct pv_cpu_ops xen_cpu_o .read_tsc = native_read_tsc, .read_pmc = native_read_pmc, + .read_tscp = native_read_tscp, + .iret = xen_iret, .irq_enable_sysexit = xen_sysexit,#ifdef CONFIG_X86_64
Greg Kroah-Hartman
maintainerPATCH 24/62 block: fix request_queue->flags initialization
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 60ea8226cbd5c8301f9a39edc574ddabcb8150e0 upstream.
A queue newly allocated with blk_alloc_queue_node() has only QUEUE_FLAG_BYPASS set. For request-based drivers, blk_init_allocated_queue() is called and q->queue_flags is overwritten with QUEUE_FLAG_DEFAULT which doesn't include BYPASS even though the initial bypass is still in effect.
In blk_init_allocated_queue(), or QUEUE_FLAG_DEFAULT to q->queue_flags instead of overwriting.
--- block/blk-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-core.c +1 -1
@@ -601,7 +601,7 @@ blk_init_allocated_queue(struct request_ q->request_fn = rfn; q->prep_rq_fn =NULL ; q->unprep_rq_fn =NULL ; - q->queue_flags =QUEUE_FLAG_DEFAULT ; + q->queue_flags |=QUEUE_FLAG_DEFAULT ;/* Override internal queue lock with supplied lock pointer */ if (lock)
Greg Kroah-Hartman
maintainerPATCH 25/62 autofs4 - fix reset pending flag on mount fail
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Kent <[email protected]>
commit 49999ab27eab6289a8e4f450e148bdab521361b2 upstream.
In autofs4_d_automount(), if a mount fail occurs the AUTOFS_INF_PENDING mount pending flag is not cleared.
One effect of this is when using the "browse" option, directory entry attributes show up with all "?"s due to the incorrect callback and subsequent failure return (when in fact no callback should be made).
--- fs/autofs4/root.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/autofs4/root.c +4 -2
@@ -392,10 +392,12 @@ static struct vfsmount *autofs4_d_automo ino->flags |=AUTOFS_INF_PENDING ;spin_unlock (&sbi->fs_lock); status =autofs4_mount_wait (dentry); -if (status) -return ERR_PTR (status);spin_lock (&sbi->fs_lock); ino->flags &= ~AUTOFS_INF_PENDING ; +if (status) { +spin_unlock (&sbi->fs_lock); +return ERR_PTR (status); + } } done:if (!(ino->flags &AUTOFS_INF_EXPIRING )) {
Greg Kroah-Hartman
maintainerPATCH 26/62 module: taint kernel when lve module is loaded
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Garrett <[email protected]>
commit c99af3752bb52ba3aece5315279a57a477edfaf1 upstream.
Cloudlinux have a product called lve that includes a kernel module. This was previously GPLed but is now under a proprietary license, but the module continues to declare MODULE_LICENSE("GPL") and makes use of some EXPORT_SYMBOL_GPL symbols. Forcibly taint it in order to avoid this.
--- kernel/module.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/module.c +4 -0
@@ -2729,6 +2729,10 @@ static int check_module_license_and_versif (strcmp (mod->name,"driverloader" ) ==0 )add_taint_module (mod,TAINT_PROPRIETARY_MODULE ); +/* lve claims to be GPL but upstream won't provide source */ +if (strcmp (mod->name,"lve" ) ==0 ) +add_taint_module (mod,TAINT_PROPRIETARY_MODULE ); +#ifdef CONFIG_MODVERSIONS if ((mod->num_syms && !mod->crcs) || (mod->num_gpl_syms && !mod->gpl_crcs)
Greg Kroah-Hartman
maintainerPATCH 27/62 video/udlfb: fix line counting in fb_write
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Holler <[email protected]>
commit b8c4321f3d194469007f5f5f2b34ec278c264a04 upstream.
Line 0 and 1 were both written to line 0 (on the display) and all subsequent lines had an offset of -1. The result was that the last line on the display was never overwritten by writes to /dev/fbN.
--- drivers/video/udlfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/udlfb.c +1 -1
@@ -647,7 +647,7 @@ static ssize_t dlfb_ops_write(struct fb_ result =fb_sys_write (info, buf, count, ppos);if (result >0 ) { -int start =max ((int )(offset / info->fix.line_length) -1 ,0 ); +int start =max ((int )(offset / info->fix.line_length),0 );int lines =min ((u32)((result / info->fix.line_length) +1 ), (u32 )info->var.yres);
Greg Kroah-Hartman
maintainerPATCH 28/62 viafb: dont touch clock state on OLPC XO-1.5
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Drake <[email protected]>
commit 012a1211845eab69a5488d59eb87d24cc518c627 upstream.
As detailed in the thread titled "viafb PLL/clock tweaking causes XO-1.5 instability," enabling or disabling the IGA1/IGA2 clocks causes occasional stability problems during suspend/resume cycles on this platform.
This is rather odd, as the documentation suggests that clocks have two states (on/off) and the default (stable) configuration is configured to enable the clock only when it is needed. However, explicitly enabling *or* disabling the clock triggers this system instability, suggesting that there is a 3rd state at play here.
Leaving the clock enable/disable registers alone solves this problem. This fixes spurious reboots during suspend/resume behaviour introduced by commit b692a63a.
--- drivers/video/via/via_clock.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/video/via/via_clock.c +19 -0
@@ -25,6 +25,7 @@#include <linux/kernel.h> #include <linux/via-core.h> +#include <asm/olpc.h> #include "via_clock.h" #include "global.h" #include "debug.h"
@@ -289,6 +290,10 @@ static void dummy_set_pll(struct via_pllprintk (KERN_INFO "Using undocumented set PLL.\n%s" , via_slap); } +static void noop_set_clock_state (u8 state) +{ +} +void via_clock_init (struct via_clock *clock,int gfx_chip) {switch (gfx_chip) {
@@ -346,4 +351,18 @@ void via_clock_init(struct via_clock *clbreak ; } + +if (machine_is_olpc ()) { +/* The OLPC XO-1.5 cannot suspend/resume reliably if the +* IGA1/IGA2 clocks are set as on or off (memory rot +* occasionally happens during suspend under such +* configurations). +* +* The only known stable scenario is to leave this bits as-is, +* which in their default states are documented to enable the +* clock only when it is needed. +*/ + clock->set_primary_clock_state = noop_set_clock_state; + clock->set_secondary_clock_state = noop_set_clock_state; + } }
Greg Kroah-Hartman
maintainerPATCH 29/62 timers: Fix endless looping between cascade() and internal_add_timer()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Hildner, Christian" <[email protected]>
commit 26cff4e2aa4d666dc6a120ea34336b5057e3e187 upstream.
Adding two (or more) timers with large values for "expires" (they have to reside within tv5 in the same list) leads to endless looping between cascade() and internal_add_timer() in case CONFIG_BASE_SMALL is one and jiffies are crossing the value 1 << 18. The bug was introduced between 2.6.11 and 2.6.12 (and survived for quite some time).
This patch ensures that when cascade() is called timers within tv5 are not added endlessly to their own list again, instead they are added to the next lower tv level tv4 (as expected).
--- kernel/timer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
kernel/timer.c +6 -4
@@ -63,6 +63,7 @@ EXPORT_SYMBOL(jiffies_64);#define TVR_SIZE (1 << TVR_BITS)#define TVN_MASK (TVN_SIZE - 1)#define TVR_MASK (TVR_SIZE - 1) +#define MAX_TVAL ((unsigned long)((1ULL << (TVR_BITS + 4*TVN_BITS)) - 1))struct tvec {struct list_head vec[TVN_SIZE ];
@@ -356,11 +357,12 @@ static void internal_add_timer(struct tv vec = base->tv1.vec + (base->timer_jiffies &TVR_MASK ); }else {int i; -/* If the timeout is larger than 0xffffffff on 64-bit -* architectures then we use the maximum timeout: +/* If the timeout is larger than MAX_TVAL (on 64-bit +* architectures or with CONFIG_BASE_SMALL=1) then we +* use the maximum timeout. */ -if (idx >0xffffffffUL ) { - idx =0xffffffffUL ; +if (idx >MAX_TVAL ) { + idx =MAX_TVAL ; expires = idx + base->timer_jiffies; } i = (expires >> (TVR_BITS +3 *TVN_BITS )) &TVN_MASK ;
Greg Kroah-Hartman
maintainerPATCH 30/62 ath9k: use ieee80211_free_txskb
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 249ee72249140fe5b9adc988f97298f0aa5db2fc upstream.
Using ieee80211_free_txskb for tx frames is required, since mac80211 clones skbs for which socket tx status is requested.
--- drivers/net/wireless/ath/ath9k/beacon.c | 2 - drivers/net/wireless/ath/ath9k/main.c | 2 - drivers/net/wireless/ath/ath9k/xmit.c | 53 +++++++++++++++++--------------- 3 files changed, 31 insertions(+), 26 deletions(-)
drivers/net/wireless/ath/ath9k/beacon.c +1 -1
@@ -121,7 +121,7 @@ static void ath_tx_cabq(struct ieee80211if (ath_tx_start (hw, skb, &txctl) !=0 ) {ath_dbg (common,XMIT ,"CABQ TX failed\n" ); -dev_kfree_skb_any (skb); +ieee80211_free_txskb (hw, skb); } }
drivers/net/wireless/ath/ath9k/main.c +1 -1
@@ -1147,7 +1147,7 @@ static void ath9k_tx(struct ieee80211_hwreturn ; exit: -dev_kfree_skb_any (skb); +ieee80211_free_txskb (hw, skb); }static void ath9k_stop (struct ieee80211_hw *hw)
drivers/net/wireless/ath/ath9k/xmit.c +29 -24
116 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 31/62 md/raid10: use correct limit variable
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 91502f099dfc5a1e8812898e26ee280713e1d002 upstream.
Clang complains that we are assigning a variable to itself. This should be using bad_sectors like the similar earlier check does.
Bug has been present since 3.1-rc1. It is minor but could conceivably cause corruption or other bad behaviour.
--- drivers/md/raid10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid10.c +1 -1
@@ -3019,7 +3019,7 @@ static sector_t sync_request(struct mddeelse { bad_sectors -= (sector - first_bad);if (max_sync > bad_sectors) - max_sync = max_sync; + max_sync = bad_sectors;continue ; } }
Greg Kroah-Hartman
maintainerPATCH 32/62 kdb,vt_console: Fix missed data due to pager overruns
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wessel <[email protected]>
commit 17b572e82032bc246324ce136696656b66d4e3f1 upstream.
It is possible to miss data when using the kdb pager. The kdb pager does not pay attention to the maximum column constraint of the screen or serial terminal. This result is not incrementing the shown lines correctly and the pager will print more lines that fit on the screen. Obviously that is less than useful when using a VGA console where you cannot scroll back.
The pager will now look at the kdb_buffer string to see how many characters are printed. It might not be perfect considering you can output ASCII that might move the cursor position, but it is a substantially better approximation for viewing dmesg and trace logs.
This also means that the vt screen needs to set the kdb COLUMNS variable.
--- drivers/tty/vt/vt.c | 13 +++++++++++++ kernel/debug/kdb/kdb_io.c | 33 ++++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 5 deletions(-)
drivers/tty/vt/vt.c +13 -0
@@ -3475,6 +3475,19 @@ int con_debug_enter(struct vc_data *vc) kdb_set(2, setargs); } } +if (vc->vc_cols <999 ) { +int colcount; +char cols[4 ]; +const char *setargs[3 ] = { +"set" , +"COLUMNS" , + cols, + }; +if (kdbgetintenv (setargs[0 ], &colcount)) { +snprintf (cols,4 ,"%i" , vc->vc_cols); +kdb_set (2 , setargs); + } + }#endif /* CONFIG_KGDB_KDB */ return ret; }
kernel/debug/kdb/kdb_io.c +28 -5
@@ -552,6 +552,7 @@ int vkdb_printf(const char *fmt, va_list {int diag;int linecount; +int colcount;int logging, saved_loglevel =0 ;int saved_trap_printk;int got_printf_lock =0 ;
@@ -584,6 +585,10 @@ int vkdb_printf(const char *fmt, va_listif (diag || linecount <=1 ) linecount =24 ; + diag =kdbgetintenv ("COLUMNS" , &colcount); +if (diag || colcount <=1 ) + colcount =80 ; + diag =kdbgetintenv ("LOGGING" , &logging);if (diag) logging =0 ;
@@ -690,7 +695,7 @@ kdb_printit:gdbstub_msg_write (kdb_buffer, retlen); }else {if (dbg_io_ops && !dbg_io_ops->is_console) { - len =strlen (kdb_buffer); + len = retlen; cp = kdb_buffer;while (len--) { dbg_io_ops->write_char (*cp);
@@ -709,11 +714,29 @@ kdb_printit:printk (KERN_INFO "%s" , kdb_buffer); } -if (KDB_STATE (PAGER ) &&strchr (kdb_buffer,'\n' )) - kdb_nextline++; +if (KDB_STATE (PAGER )) { +/* +* Check printed string to decide how to bump the +* kdb_nextline to control when the more prompt should +* show up. +*/ +int got =0 ; + len = retlen; +while (len--) { +if (kdb_buffer[len] =='\n' ) { + kdb_nextline++; + got =0 ; + }else if (kdb_buffer[len] =='\r' ) { + got =0 ; + }else { + got++; + } + } + kdb_nextline += got / (colcount +1 ); + }/* check for having reached the LINES number of printed lines */ -if (kdb_nextline == linecount) { +if (kdb_nextline >= linecount) {char buf1[16 ] ="" ;#if defined(CONFIG_SMP )char buf2[32 ];
@@ -776,7 +799,7 @@ kdb_printit: kdb_grepping_flag =0 ;kdb_printf ("\n" ); }else if (buf1[0 ] ==' ' ) { -kdb_printf ("\n" ); +kdb_printf ("\r" ); suspend_grep =1 ;/* for this recursion */ }else if (buf1[0 ] =='\n' ) { kdb_nextline = linecount -1 ;
Re: [ 32/62] kdb,vt_console: Fix missed data due to pager overruns
Quoted 7 lines · Greg Kroah-Hartman
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wessel <[email protected]>
commit
17b572e82032bc246324ce136696656b66d4e3f1upstream.
[...]
Quoted 2 lines
This also means that the vt screen needs to set the kdb COLUMNS variable.
[...]
Quoted 9 lines
drivers/tty/vt/vt.c +3
-0@@ -3475,6 +3475,19 @@ int con_debug_enter(struct vc_data *vc)kdb_set (2 , setargs); } } +if (vc->vc_cols <999 ) { +int colcount; +char cols[4 ];
drivers/tty/vt/vt.c int con_debug_enter(struct vc_data *vc) · line 3490
Quoted 10 lines
drivers/tty/vt/vt.c +10
-0+const char *setargs[3 ] = { +"set" , +"COLUMNS" , + cols, + }; +if (kdbgetintenv (setargs[0 ], &colcount)) { +snprintf (cols,4 ,"%i" , vc->vc_cols); +kdb_set (2 , setargs); + } + }
Presumably the idea here was to avoid overriding the 'COLUMNS' variable if it is already set, but it's actually testing whether the variable 'set' is set. (Besides which, there should be a kdbsetenv() instead of this gross hack of faking up a user command. And whyever did kdb have to make argc off-by-one from the usual C convention?)
[...]
Quoted 9 lines
drivers/tty/vt/vt.c +9
-0+if (KDB_STATE (PAGER )) { +/* +* Check printed string to decide how to bump the +* kdb_nextline to control when the more prompt should +* show up. +*/ +int got =0 ; + len = retlen; +while (len--) {
drivers/tty/vt/vt.c int con_debug_enter(struct vc_data *vc)
Quoted 10 lines
drivers/tty/vt/vt.c +10
-0+if (kdb_buffer[len] =='\n' ) { + kdb_nextline++; + got =0 ; + }else if (kdb_buffer[len] =='\r' ) { + got =0 ; + }else { + got++; + } + } + kdb_nextline += got / (colcount +1 );
What if more than one logical line is wrapped?
Why divide by colcount + 1? Shouldn't it be (got - 1) / colcount?
Ben.
Signature · 3 lines
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert CamusGreg Kroah-Hartman
maintainerPATCH 33/62 pktgen: fix crash when generating IPv6 packets
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amerigo Wang <[email protected]>
commit 5aa8b572007c4bca1e6d3dd4c4820f1ae49d6bb2 upstream.
For IPv6, sizeof(struct ipv6hdr) = 40, thus the following expression will result negative:
datalen = pkt_dev->cur_pkt_size - 14 -
sizeof(struct ipv6hdr) - sizeof(struct udphdr) -
pkt_dev->pkt_overhead;And, the check "if (datalen < sizeof(struct pktgen_hdr))" will be passed as "datalen" is promoted to unsigned, therefore will cause a crash later.
This is a quick fix by checking if "datalen" is negative. The following patch will increase the default value of 'min_pkt_size' for IPv6.
This bug should exist for a long time, so Cc -stable too.
--- net/core/pktgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/pktgen.c +1 -1
@@ -2932,7 +2932,7 @@ static struct sk_buff *fill_packet_ipv6(sizeof (struct ipv6hdr ) -sizeof (struct udphdr ) - pkt_dev->pkt_overhead; -if (datalen <sizeof (struct pktgen_hdr )) { +if (datalen <0 || datalen <sizeof (struct pktgen_hdr )) { datalen =sizeof (struct pktgen_hdr );if (net_ratelimit ())pr_info ("increased datalen to %d\n" , datalen);
Greg Kroah-Hartman
maintainerPATCH 34/62 ipvs: fix oops in ip_vs_dst_event on rmmod
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Anastasov <[email protected]>
commit 283283c4da91adc44b03519f434ee1e7e91d6fdb upstream.
After commit 39f618b4fd95ae243d940ec64c961009c74e3333 (3.4)
"ipvs: reset ipvs pointer in netns" we can oops in ip_vs_dst_event on rmmod ip_vs because ip_vs_control_cleanup is called after the ipvs_core_ops subsys is unregistered and net->ipvs is NULL. Fix it by exiting early from ip_vs_dst_event if ipvs is NULL. It is safe because all services and dests for the net are already freed.
--- net/netfilter/ipvs/ip_vs_ctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/netfilter/ipvs/ip_vs_ctl.c +3 -2
@@ -1521,11 +1521,12 @@ static int ip_vs_dst_event(struct notifi {struct net_device *dev = ptr;struct net *net =dev_net (dev); +struct netns_ipvs *ipvs =net_ipvs (net);struct ip_vs_service *svc;struct ip_vs_dest *dest;unsigned int idx; -if (event !=NETDEV_UNREGISTER ) +if (event !=NETDEV_UNREGISTER || !ipvs)return NOTIFY_DONE ;IP_VS_DBG (3 ,"%s() dev=%s\n" , __func__, dev->name);EnterFunction (2 );
@@ -1551,7 +1552,7 @@ static int ip_vs_dst_event(struct notifi } } -list_for_each_entry (dest, &net_ipvs (net)->dest_trash, n_list) { +list_for_each_entry (dest, &ipvs->dest_trash, n_list) {__ip_vs_dev_reset (dest, dev); }mutex_unlock (&__ip_vs_mutex);
Greg Kroah-Hartman
maintainerPATCH 35/62 netfilter: nf_conntrack: fix racy timer handling with reliable events
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
commit 5b423f6a40a0327f9d40bc8b97ce9be266f74368 upstream.
Existing code assumes that del_timer returns true for alive conntrack entries. However, this is not true if reliable events are enabled. In that case, del_timer may return true for entries that were just inserted in the dying list. Note that packets / ctnetlink may hold references to conntrack entries that were just inserted to such list.
This patch fixes the issue by adding an independent timer for event delivery. This increases the size of the ecache extension. Still we can revisit this later and use variable size extensions to allocate this area on demand.
--- include/net/netfilter/nf_conntrack_ecache.h | 1 + net/netfilter/nf_conntrack_core.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-)
include/net/netfilter/nf_conntrack_ecache.h +1 -0
@@ -18,6 +18,7 @@ struct nf_conntrack_ecache {u16 ctmask;/* bitmask of ct events to be delivered */ u16 expmask;/* bitmask of expect events to be delivered */ u32 pid;/* netlink pid of destroyer */ +struct timer_list timeout; }; static inline struct nf_conntrack_ecache *
net/netfilter/nf_conntrack_core.c +11 -5
@@ -249,12 +249,15 @@ static void death_by_event(unsigned long {struct nf_conn *ct = (void *)ul_conntrack;struct net *net =nf_ct_net (ct); +struct nf_conntrack_ecache *ecache =nf_ct_ecache_find (ct); + +BUG_ON (ecache ==NULL );if (nf_conntrack_event (IPCT_DESTROY , ct) <0 ) {/* bad luck, let's retry again */ - ct->timeout.expires = jiffies + + ecache->timeout.expires = jiffies + (random32 () % net->ct.sysctl_events_retry_timeout); -add_timer (&ct->timeout); +add_timer (&ecache->timeout);return ; }/* we've got the event delivered, now it's dying */
@@ -268,6 +271,9 @@ static void death_by_event(unsigned longvoid nf_ct_insert_dying_list (struct nf_conn *ct) {struct net *net =nf_ct_net (ct); +struct nf_conntrack_ecache *ecache =nf_ct_ecache_find (ct); + +BUG_ON (ecache ==NULL );/* add this conntrack to the dying list */ spin_lock_bh (&nf_conntrack_lock);
@@ -275,10 +281,10 @@ void nf_ct_insert_dying_list(struct nf_c &net->ct.dying);spin_unlock_bh (&nf_conntrack_lock);/* set a new timer to retry event delivery */ -setup_timer (&ct->timeout, death_by_event, (unsigned long )ct); - ct->timeout.expires = jiffies + +setup_timer (&ecache->timeout, death_by_event, (unsigned long )ct); + ecache->timeout.expires = jiffies + (random32 () % net->ct.sysctl_events_retry_timeout); -add_timer (&ct->timeout); +add_timer (&ecache->timeout); }EXPORT_SYMBOL_GPL (nf_ct_insert_dying_list);
Greg Kroah-Hartman
maintainerPATCH 36/62 netfilter: ipset: fix timeout value overflow bug
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jozsef Kadlecsik <[email protected]>
commit 127f559127f5175e4bec3dab725a34845d956591 upstream.
Large timeout parameters could result wrong timeout values due to an overflow at msec to jiffies conversion (reported by Andreas Herz)
[ This patch was mangled by Pablo Neira Ayuso since David Laight and
Eric Dumazet noticed that we were using hardcoded 1000 instead of MSEC_PER_SEC to calculate the timeout ]
--- include/linux/netfilter/ipset/ip_set_timeout.h | 4 ++++ net/netfilter/xt_set.c | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-)
include/linux/netfilter/ipset/ip_set_timeout.h +4 -0
@@ -30,6 +30,10 @@ ip_set_timeout_uget(struct nlattr *tb) {unsigned int timeout =ip_set_get_h32 (tb); +/* Normalize to fit into jiffies */ +if (timeout >UINT_MAX /MSEC_PER_SEC ) + timeout =UINT_MAX /MSEC_PER_SEC ; +/* Userspace supplied TIMEOUT parameter: adjust crazy size */ return timeout ==IPSET_NO_TIMEOUT ?IPSET_NO_TIMEOUT -1 : timeout; }
net/netfilter/xt_set.c +13 -2
@@ -44,6 +44,14 @@ const struct ip_set_adt_opt n = { \ .cmdflags = cfs, \ .timeout = t, \ } +#define ADT_MOPT (n, f, d, fs, cfs, t) \ +struct ip_set_adt_opt n = { \ + .family = f, \ + .dim = d, \ + .flags = fs, \ + .cmdflags = cfs, \ + .timeout = t, \ +}/* Revision 0 interface: backward compatible with netfilter/iptables */
@@ -296,11 +304,14 @@ static unsigned int set_target_v2(struct sk_buff *skb, const struct xt_action_param *par) { const struct xt_set_info_target_v2 *info = par->targinfo; -ADT_OPT (add_opt, par->family, info->add_set.dim, - info->add_set.flags, info->flags, info->timeout); +ADT_MOPT (add_opt, par->family, info->add_set.dim, + info->add_set.flags, info->flags, info->timeout);ADT_OPT (del_opt, par->family, info->del_set.dim, info->del_set.flags,0 ,UINT_MAX ); +/* Normalize to fit into jiffies */ +if (add_opt.timeout >UINT_MAX /MSEC_PER_SEC ) + add_opt.timeout =UINT_MAX /MSEC_PER_SEC ;if (info->add_set.index !=IPSET_INVALID_ID )ip_set_add (info->add_set.index, skb, par, &add_opt);if (info->del_set.index !=IPSET_INVALID_ID )
Greg Kroah-Hartman
maintainerPATCH 37/62 netfilter: ipset: timeout fixing bug broke SET target special timeout value
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jozsef Kadlecsik <[email protected]>
commit a73f89a61f92b364f0b4a3be412b5b70553afc23 upstream.
The patch "127f559 netfilter: ipset: fix timeout value overflow bug" broke the SET target when no timeout was specified.
--- net/netfilter/xt_set.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/netfilter/xt_set.c +3 -1
@@ -16,6 +16,7 @@#include <linux/netfilter/x_tables.h> #include <linux/netfilter/xt_set.h> +#include <linux/netfilter/ipset/ip_set_timeout.h> MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Jozsef Kadlecsik <[email protected]>" );
@@ -310,7 +311,8 @@ set_target_v2(struct sk_buff *skb, const info->del_set.flags, 0, UINT_MAX);/* Normalize to fit into jiffies */ -if (add_opt.timeout >UINT_MAX /MSEC_PER_SEC ) +if (add_opt.timeout !=IPSET_NO_TIMEOUT && + add_opt.timeout >UINT_MAX /MSEC_PER_SEC ) add_opt.timeout =UINT_MAX /MSEC_PER_SEC ;if (info->add_set.index !=IPSET_INVALID_ID )ip_set_add (info->add_set.index, skb, par, &add_opt);
Greg Kroah-Hartman
maintainerPATCH 38/62 ipvs: fix oops on NAT reply in br_nf context
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin Ming <[email protected]>
commit 9e33ce453f8ac8452649802bee1f410319408f4b upstream.
IPVS should not reset skb->nf_bridge in FORWARD hook by calling nf_reset for NAT replies. It triggers oops in br_nf_forward_finish.
[ 579.781508] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 [ 579.781669] IP: [<ffffffff817b1ca5>] br_nf_forward_finish+0x58/0x112 [ 579.781792] PGD 218f9067 PUD 0 [ 579.781865] Oops: 0000 [#1] SMP [ 579.781945] CPU 0 [ 579.781983] Modules linked in: [ 579.782047] [ 579.782080] [ 579.782114] Pid: 4644, comm: qemu Tainted: G W 3.5.0-rc5-00006-g95e69f9 #282 Hewlett-Packard /30E8 [ 579.782300] RIP: 0010:[<ffffffff817b1ca5>] [<ffffffff817b1ca5>] br_nf_forward_finish+0x58/0x112 [ 579.782455] RSP: 0018:ffff88007b003a98 EFLAGS: 00010287 [ 579.782541] RAX: 0000000000000008 RBX: ffff8800762ead00 RCX: 000000000001670a [ 579.782653] RDX: 0000000000000000 RSI: 000000000000000a RDI: ffff8800762ead00 [ 579.782845] RBP: ffff88007b003ac8 R08: 0000000000016630 R09: ffff88007b003a90 [ 579.782957] R10: ffff88007b0038e8 R11: ffff88002da37540 R12: ffff88002da01a02 [ 579.783066] R13: ffff88002da01a80 R14: ffff88002d83c000 R15: ffff88002d82a000 [ 579.783177] FS: 0000000000000000(0000) GS:ffff88007b000000(0063) knlGS:00000000f62d1b70 [ 579.783306] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b [ 579.783395] CR2: 0000000000000004 CR3: 00000000218fe000 CR4: 00000000000027f0 [ 579.783505] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 579.783684] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 579.783795] Process qemu (pid: 4644, threadinfo ffff880021b20000, task ffff880021aba760) [ 579.783919] Stack: [ 579.783959] ffff88007693cedc ffff8800762ead00 ffff88002da01a02 ffff8800762ead00 [ 579.784110] ffff88002da01a02 ffff88002da01a80 ffff88007b003b18 ffffffff817b26c7 [ 579.784260] ffff880080000000 ffffffff81ef59f0 ffff8800762ead00 ffffffff81ef58b0 [ 579.784477] Call Trace: [ 579.784523] <IRQ> [ 579.784562] [ 579.784603] [<ffffffff817b26c7>] br_nf_forward_ip+0x275/0x2c8 [ 579.784707] [<ffffffff81704b58>] nf_iterate+0x47/0x7d [ 579.784797] [<ffffffff817ac32e>] ? br_dev_queue_push_xmit+0xae/0xae [ 579.784906] [<ffffffff81704bfb>] nf_hook_slow+0x6d/0x102 [ 579.784995] [<ffffffff817ac32e>] ? br_dev_queue_push_xmit+0xae/0xae [ 579.785175] [<ffffffff8187fa95>] ? _raw_write_unlock_bh+0x19/0x1b [ 579.785179] [<ffffffff817ac417>] __br_forward+0x97/0xa2 [ 579.785179] [<ffffffff817ad366>] br_handle_frame_finish+0x1a6/0x257 [ 579.785179] [<ffffffff817b2386>] br_nf_pre_routing_finish+0x26d/0x2cb [ 579.785179] [<ffffffff817b2cf0>] br_nf_pre_routing+0x55d/0x5c1 [ 579.785179] [<ffffffff81704b58>] nf_iterate+0x47/0x7d [ 579.785179] [<ffffffff817ad1c0>] ? br_handle_local_finish+0x44/0x44 [ 579.785179] [<ffffffff81704bfb>] nf_hook_slow+0x6d/0x102 [ 579.785179] [<ffffffff817ad1c0>] ? br_handle_local_finish+0x44/0x44 [ 579.785179] [<ffffffff81551525>] ? sky2_poll+0xb35/0xb54 [ 579.785179] [<ffffffff817ad62a>] br_handle_frame+0x213/0x229 [ 579.785179] [<ffffffff817ad417>] ? br_handle_frame_finish+0x257/0x257 [ 579.785179] [<ffffffff816e3b47>] __netif_receive_skb+0x2b4/0x3f1 [ 579.785179] [<ffffffff816e69fc>] process_backlog+0x99/0x1e2 [ 579.785179] [<ffffffff816e6800>] net_rx_action+0xdf/0x242 [ 579.785179] [<ffffffff8107e8a8>] __do_softirq+0xc1/0x1e0 [ 579.785179] [<ffffffff8135a5ba>] ? trace_hardirqs_off_thunk+0x3a/0x6c [ 579.785179] [<ffffffff8188812c>] call_softirq+0x1c/0x30
The steps to reproduce as follow,
1. On Host1, setup brige br0(192.168.1.106)
2. Boot a kvm guest(192.168.1.105) on Host1 and start httpd
3. Start IPVS service on Host1
ipvsadm -A -t 192.168.1.106:80 -s rr
ipvsadm -a -t 192.168.1.106:80 -r 192.168.1.105:80 -m
4. Run apache benchmark on Host2(192.168.1.101)
ab -n 1000 http://192.168.1.106/
ip_vs_reply4
ip_vs_out
handle_response
ip_vs_notrack
nf_reset()
{
skb->nf_bridge = NULL;
}Actually, IPVS wants in this case just to replace nfct with untracked version. So replace the nf_reset(skb) call in ip_vs_notrack() with a nf_conntrack_put(skb->nfct) call.
--- include/net/ip_vs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/ip_vs.h +1 -1
@@ -1356,7 +1356,7 @@ static inline void ip_vs_notrack(structstruct nf_conn *ct =nf_ct_get (skb, &ctinfo);if (!ct || !nf_ct_is_untracked (ct)) { -nf_reset (skb); +nf_conntrack_put (skb->nfct); skb->nfct = &nf_ct_untracked_get ()->ct_general; skb->nfctinfo =IP_CT_NEW ;nf_conntrack_get (skb->nfct);
Greg Kroah-Hartman
maintainerPATCH 39/62 netfilter: nf_nat_sip: fix incorrect handling of EBUSY for RTCP expectation
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
commit 3f509c689a07a4aa989b426893d8491a7ffcc410 upstream.
We're hitting bug while trying to reinsert an already existing expectation:
kernel BUG at kernel/timer.c:895!
invalid opcode: 0000 [#1] SMP
[...]
Call Trace: <IRQ> [<ffffffffa0069563>] nf_ct_expect_related_report+0x4a0/0x57a [nf_conntrack] [<ffffffff812d423a>] ? in4_pton+0x72/0x131 [<ffffffffa00ca69e>] ip_nat_sdp_media+0xeb/0x185 [nf_nat_sip] [<ffffffffa00b5b9b>] set_expected_rtp_rtcp+0x32d/0x39b [nf_conntrack_sip] [<ffffffffa00b5f15>] process_sdp+0x30c/0x3ec [nf_conntrack_sip] [<ffffffff8103f1eb>] ? irq_exit+0x9a/0x9c [<ffffffffa00ca738>] ? ip_nat_sdp_media+0x185/0x185 [nf_nat_sip]
We have to remove the RTP expectation if the RTCP expectation hits EBUSY since we keep trying with other ports until we succeed.
--- net/ipv4/netfilter/nf_nat_sip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/ipv4/netfilter/nf_nat_sip.c +4 -1
@@ -501,7 +501,10 @@ static unsigned int ip_nat_sdp_media(str ret =nf_ct_expect_related (rtcp_exp);if (ret ==0 )break ; -else if (ret != -EBUSY ) { +else if (ret == -EBUSY ) { +nf_ct_unexpect_related (rtp_exp); +continue ; + }else if (ret <0 ) {nf_ct_unexpect_related (rtp_exp); port =0 ;break ;
Greg Kroah-Hartman
maintainerPATCH 40/62 netfilter: nf_nat_sip: fix via header translation with multiple parameters
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrick McHardy <[email protected]>
commit f22eb25cf5b1157b29ef88c793b71972efc47143 upstream.
Via-headers are parsed beginning at the first character after the Via-address. When the address is translated first and its length decreases, the offset to start parsing at is incorrect and header parameters might be missed.
Update the offset after translating the Via-address to fix this.
--- net/ipv4/netfilter/nf_nat_sip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/ipv4/netfilter/nf_nat_sip.c +3 -2
@@ -148,7 +148,7 @@ static unsigned int ip_nat_sip(struct skif (ct_sip_parse_header_uri (ct, *dptr,NULL , *datalen, hdr,NULL , &matchoff, &matchlen, &addr, &port) >0 ) { -unsigned int matchend, poff, plen, buflen, n; +unsigned int olen, matchend, poff, plen, buflen, n;char buffer[sizeof ("nnn.nnn.nnn.nnn:nnnnn" )];/* We're only interested in headers related to this
@@ -163,11 +163,12 @@ static unsigned int ip_nat_sip(struct sk goto next; } + olen = *datalen;if (!map_addr (skb, dataoff, dptr, datalen, matchoff, matchlen, &addr, port))return NF_DROP ; - matchend = matchoff + matchlen; + matchend = matchoff + matchlen + *datalen - olen;/* The maddr= parameter (RFC 2361) specifies where to send * the reply. */
Greg Kroah-Hartman
maintainerPATCH 41/62 netfilter: nf_ct_expect: fix possible access to uninitialized timer
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
commit 2614f86490122bf51eb7c12ec73927f1900f4e7d upstream.
In __nf_ct_expect_check, the function refresh_timer returns 1 if a matching expectation is found and its timer is successfully refreshed. This results in nf_ct_expect_related returning 0. Note that at this point:
- the passed expectation is not inserted in the expectation table and its timer was not initialized, since we have refreshed one matching/existing expectation.
- nf_ct_expect_alloc uses kmem_cache_alloc, so the expectation timer is in some undefined state just after the allocation, until it is appropriately initialized.
This can be a problem for the SIP helper during the expectation addition:
...
if (nf_ct_expect_related(rtp_exp) == 0) {
if (nf_ct_expect_related(rtcp_exp) != 0)
nf_ct_unexpect_related(rtp_exp);...
Note that nf_ct_expect_related(rtp_exp) may return 0 for the timer refresh case that is detailed above. Then, if nf_ct_unexpect_related(rtcp_exp) returns != 0, nf_ct_unexpect_related(rtp_exp) is called, which does:
spin_lock_bh(&nf_conntrack_lock);
if (del_timer(&exp->timeout)) {
nf_ct_unlink_expect(exp);
nf_ct_expect_put(exp); }
spin_unlock_bh(&nf_conntrack_lock);
Note that del_timer always returns false if the timer has been initialized. However, the timer was not initialized since setup_timer was not called, therefore, the expectation timer remains in some undefined state. If I'm not missing anything, this may lead to the removal an unexistent expectation.
To fix this, the optimization that allows refreshing an expectation is removed. Now nf_conntrack_expect_related looks more consistent to me since it always add the expectation in case that it returns success.
Thanks to Patrick McHardy for participating in the discussion of this patch.
I think this may be the source of the problem described by:
http://marc.info/?l=netfilter-devel&m=134073514719421&w=2
--- net/netfilter/nf_conntrack_expect.c | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-)
net/netfilter/nf_conntrack_expect.c +6 -23
@@ -361,23 +361,6 @@ static void evict_oldest_expect(struct n } } -static inline int refresh_timer (struct nf_conntrack_expect *i) -{ -struct nf_conn_help *master_help =nfct_help (i->master); -const struct nf_conntrack_expect_policy *p; - -if (!del_timer (&i->timeout)) -return 0 ; - - p = &rcu_dereference_protected ( - master_help->helper, -lockdep_is_held (&nf_conntrack_lock) - )->expect_policy[i->class]; - i->timeout.expires = jiffies + p->timeout *HZ ; -add_timer (&i->timeout); -return 1 ; -} -static inline int __nf_ct_expect_check (struct nf_conntrack_expect *expect) {const struct nf_conntrack_expect_policy *p;
@@ -386,7 +369,7 @@ static inline int __nf_ct_expect_check(sstruct nf_conn_help *master_help =nfct_help (master);struct nf_conntrack_helper *helper;struct net *net =nf_ct_exp_net (expect); -struct hlist_node *n; +struct hlist_node *n, *next;unsigned int h;int ret =1 ;
@@ -395,12 +378,12 @@ static inline int __nf_ct_expect_check(s goto out; } h =nf_ct_expect_dst_hash (&expect->tuple); -hlist_for_each_entry (i, n, &net->ct.expect_hash[h], hnode) { +hlist_for_each_entry_safe (i, n, next, &net->ct.expect_hash[h], hnode) {if (expect_matches (i, expect)) { -/* Refresh timer: if it's dying, ignore.. */ -if (refresh_timer (i)) { - ret =0 ; - goto out; +if (del_timer (&i->timeout)) { +nf_ct_unlink_expect (i); +nf_ct_expect_put (i); +break ; } }else if (expect_clash (i, expect)) { ret = -EBUSY ;
Greg Kroah-Hartman
maintainerPATCH 42/62 netfilter: limit, hashlimit: avoid duplicated inline
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit 7a909ac70f6b0823d9f23a43f19598d4b57ac901 upstream.
credit_cap can be set to credit, which avoids inlining user2credits twice. Also, remove inline keyword and let compiler decide.
old:
684 192 0 876 36c net/netfilter/xt_limit.o
4927 344 32 5303 14b7 net/netfilter/xt_hashlimit.o
now:
668 192 0 860 35c net/netfilter/xt_limit.o 4793 344 32 5169 1431 net/netfilter/xt_hashlimit.o
--- net/netfilter/xt_hashlimit.c | 8 +++----- net/netfilter/xt_limit.c | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-)
net/netfilter/xt_hashlimit.c +3 -5
@@ -389,8 +389,7 @@ static void htable_put(struct xt_hashlim#define CREDITS_PER_JIFFY POW2_BELOW32(MAX_CPJ)/* Precision saver. */ -static inline u_int32_t -user2credits (u_int32_t user) +static u32 user2credits (u32 user) {/* If multiplying would overflow... */ if (user >0xFFFFFFFF / (HZ *CREDITS_PER_JIFFY ))
@@ -400,7 +399,7 @@ user2credits(u_int32_t user)return (user *HZ *CREDITS_PER_JIFFY ) /XT_HASHLIMIT_SCALE ; } -static inline void rateinfo_recalc (struct dsthash_ent *dh,unsigned long now) +static void rateinfo_recalc (struct dsthash_ent *dh,unsigned long now) { dh->rateinfo.credit += (now - dh->rateinfo.prev) *CREDITS_PER_JIFFY ;if (dh->rateinfo.credit > dh->rateinfo.credit_cap)
@@ -535,8 +534,7 @@ hashlimit_mt(const struct sk_buff *skb, dh->rateinfo.prev = jiffies; dh->rateinfo.credit =user2credits (hinfo->cfg.avg * hinfo->cfg.burst); - dh->rateinfo.credit_cap =user2credits (hinfo->cfg.avg * - hinfo->cfg.burst); + dh->rateinfo.credit_cap = dh->rateinfo.credit; dh->rateinfo.cost =user2credits (hinfo->cfg.avg); }else {/* update expiration timeout */
net/netfilter/xt_limit.c +2 -3
@@ -88,8 +88,7 @@ limit_mt(const struct sk_buff *skb, stru }/* Precision saver. */ -static u_int32_t -user2credits (u_int32_t user) +static u32 user2credits (u32 user) {/* If multiplying would overflow... */ if (user >0xFFFFFFFF / (HZ *CREDITS_PER_JIFFY ))
@@ -123,7 +122,7 @@ static int limit_mt_check(const struct x128. */ priv->prev = jiffies; priv->credit =user2credits (r->avg * r->burst);/* Credits full. */ - r->credit_cap =user2credits (r->avg * r->burst);/* Credits full. */ + r->credit_cap = priv->credit;/* Credits full. */ r->cost =user2credits (r->avg); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 43/62 netfilter: xt_limit: have r->cost != 0 case work
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Engelhardt <[email protected]>
commit 82e6bfe2fbc4d48852114c4f979137cd5bf1d1a8 upstream.
Commit v2.6.19-rc1~1272^2~41 tells us that r->cost != 0 can happen when a running state is saved to userspace and then reinstated from there.
Make sure that private xt_limit area is initialized with correct values. Otherwise, random matchings due to use of uninitialized memory.
--- net/netfilter/xt_limit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/netfilter/xt_limit.c +4 -4
@@ -117,11 +117,11 @@ static int limit_mt_check(const struct x/* For SMP, we only want to use one set of state. */ r->master = priv; +/* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies * +128. */ + priv->prev = jiffies; + priv->credit =user2credits (r->avg * r->burst);/* Credits full. */ if (r->cost ==0 ) { -/* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies * -128. */ - priv->prev = jiffies; - priv->credit =user2credits (r->avg * r->burst);/* Credits full. */ r->credit_cap = priv->credit;/* Credits full. */ r->cost =user2credits (r->avg); }
Greg Kroah-Hartman
maintainerPATCH 44/62 Add CDC-ACM support for the CX93010-2x UCMxx USB Modem
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Christian de Rivaz <[email protected]>
commit e7d491a19d3e3aac544070293891a2542ae0c565 upstream.
This USB V.92/V.32bis Controllered Modem have the USB vendor ID 0x0572 and device ID 0x1340. It need the NO_UNION_NORMAL quirk to be recognized.
Reference:
http://www.conexant.com/servlets/DownloadServlet/DSH-201723-005.pdf?docid=1725&revid=5
See idVendor and idProduct in table 6-1. Device Descriptors
--- drivers/usb/class/cdc-acm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/class/cdc-acm.c +3 -0
@@ -1551,6 +1551,9 @@ static const struct usb_device_id acm_idMaybe we should define a new quirk for this. */ }, + { USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */ + .driver_info =NO_UNION_NORMAL , + }, { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ },
Greg Kroah-Hartman
maintainerPATCH 45/62 drm/radeon: Dont destroy I2C Bus Rec in radeon_ext_tmds_enc_destroy().
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Egbert Eich <[email protected]>
commit 082918471139b07964967cfe5f70230909c82ae1 upstream.
radeon_i2c_fini() walks thru the list of I2C bus recs rdev->i2c_bus[] to destroy each of them.radeon_ext_tmds_enc_destroy() however also has code to destroy it's associated I2C bus rec which has been obtained by radeon_i2c_lookup() and is therefore also in the i2c_bus[] list.
This causes a double free resulting in a kernel panic when unloading the radeon driver.
Removing destroy code from radeon_ext_tmds_enc_destroy() fixes this problem.
agd5f: fix compiler warning
--- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/radeon/radeon_legacy_encoders.c +1 -5
@@ -973,11 +973,7 @@ static void radeon_legacy_tmds_ext_mode_static void radeon_ext_tmds_enc_destroy (struct drm_encoder *encoder) {struct radeon_encoder *radeon_encoder =to_radeon_encoder (encoder); -struct radeon_encoder_ext_tmds *tmds = radeon_encoder->enc_priv; -if (tmds) { -if (tmds->i2c_bus) -radeon_i2c_destroy (tmds->i2c_bus); - } +/* don't destroy the i2c bus record here, this will be done in radeon_i2c_fini */ kfree (radeon_encoder->enc_priv);drm_encoder_cleanup (encoder);kfree (radeon_encoder);
Greg Kroah-Hartman
maintainerPATCH 46/62 drm/i915: use adjusted_mode instead of mode for checking the 6bpc force flag
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
commit 0c96c65b48fba3ffe9822a554cbc0cd610765cd5 upstream.
The dithering introduced in
commit 3b5c78a35cf7511c15e09a9b0ffab290a42d9bcf
Author: Adam Jackson <[email protected]> Date: Tue Dec 13 15:41:00 2011 -0800
drm/i915/dp: Dither down to 6bpc if it makes the mode fit
stores the INTEL_MODE_DP_FORCE_6BPC flag in the private_flags of the adjusted mode, while i9xx_crtc_mode_set() and ironlake_crtc_mode_set() use the original mode, without the flag, so it would never have any effect. However, the BPC was clamped by VBT settings, making things work by coincidence, until that part was removed in
commit 4344b813f105a19f793f1fd93ad775b784648b95
Author: Daniel Vetter <[email protected]> Date: Fri Aug 10 11:10:20 2012 +0200
Use adjusted_mode instead of mode when checking for INTEL_MODE_DP_FORCE_6BPC to make the flag have effect.
v2: Don't forget to fix this in i9xx_crtc_mode_set() also, pointed out by Daniel both before and after sending the first patch.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47621
--- drivers/gpu/drm/i915/intel_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -5318,7 +5318,7 @@ static int i9xx_crtc_mode_set(struct drm/* default to 8bpc */ pipeconf &= ~(PIPECONF_BPP_MASK |PIPECONF_DITHER_EN );if (is_dp) { -if (mode->private_flags &INTEL_MODE_DP_FORCE_6BPC ) { +if (adjusted_mode->private_flags &INTEL_MODE_DP_FORCE_6BPC ) { pipeconf |=PIPECONF_BPP_6 |PIPECONF_DITHER_EN |PIPECONF_DITHER_TYPE_SP ;
@@ -5782,7 +5782,7 @@ static int ironlake_crtc_mode_set(struct/* determine panel color depth */ temp =I915_READ (PIPECONF (pipe)); temp &= ~PIPE_BPC_MASK ; - dither =intel_choose_pipe_bpp_dither (crtc, &pipe_bpp, mode); + dither =intel_choose_pipe_bpp_dither (crtc, &pipe_bpp, adjusted_mode);switch (pipe_bpp) {case 18 : temp |=PIPE_6BPC ;
Greg Kroah-Hartman
maintainerPATCH 47/62 jbd: Fix assertion failure in commit code due to lacking transaction credits
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 09e05d4805e6c524c1af74e524e5d0528bb3fef3 upstream.
ext3 users of data=journal mode with blocksize < pagesize were occasionally hitting assertion failure in journal_commit_transaction() checking whether the transaction has at least as many credits reserved as buffers attached. The core of the problem is that when a file gets truncated, buffers that still need checkpointing or that are attached to the committing transaction are left with buffer_mapped set. When this happens to buffers beyond i_size attached to a page stradding i_size, subsequent write extending the file will see these buffers and as they are mapped (but underlying blocks were freed) things go awry from here.
The assertion failure just coincidentally (and in this case luckily as we would start corrupting filesystem) triggers due to journal_head not being properly cleaned up as well.
Under some rare circumstances this bug could even hit data=ordered mode users. There the assertion won't trigger and we would end up corrupting the filesystem.
We fix the problem by unmapping buffers if possible (in lots of cases we just need a buffer attached to a transaction as a place holder but it must not be written out anyway). And in one case, we just have to bite the bullet and wait for transaction commit to finish.
--- fs/jbd/commit.c | 45 +++++++++++++++++++++++++++-------- fs/jbd/transaction.c | 64 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 78 insertions(+), 31 deletions(-)
fs/jbd/commit.c +34 -11
@@ -86,7 +86,12 @@ nope:static void release_data_buffer (struct buffer_head *bh) {if (buffer_freed (bh)) { +WARN_ON_ONCE (buffer_dirty (bh));clear_buffer_freed (bh); +clear_buffer_mapped (bh); +clear_buffer_new (bh); +clear_buffer_req (bh); + bh->b_bdev =NULL ;release_buffer_page (bh); }else put_bh (bh);
@@ -853,17 +858,35 @@ restart_loop:* there's no point in keeping a checkpoint record for * it. */ -/* A buffer which has been freed while still being -* journaled by a previous transaction may end up still -* being dirty here, but we want to avoid writing back -* that buffer in the future after the "add to orphan" -* operation been committed, That's not only a performance -* gain, it also stops aliasing problems if the buffer is -* left behind for writeback and gets reallocated for another -* use in a different page. */ -if (buffer_freed (bh) && !jh->b_next_transaction) { -clear_buffer_freed (bh); -clear_buffer_jbddirty (bh); +/* +* A buffer which has been freed while still being journaled by +* a previous transaction. +*/ +if (buffer_freed (bh)) { +/* +* If the running transaction is the one containing +* "add to orphan" operation (b_next_transaction != +* NULL), we have to wait for that transaction to +* commit before we can really get rid of the buffer. +* So just clear b_modified to not confuse transaction +* credit accounting and refile the buffer to +* BJ_Forget of the running transaction. If the just +* committed transaction contains "add to orphan" +* operation, we can completely invalidate the buffer +* now. We are rather throughout in that since the +* buffer may be still accessible when blocksize < +* pagesize and it is attached to the last partial +* page. +*/ + jh->b_modified =0 ; +if (!jh->b_next_transaction) { +clear_buffer_freed (bh); +clear_buffer_jbddirty (bh); +clear_buffer_mapped (bh); +clear_buffer_new (bh); +clear_buffer_req (bh); + bh->b_bdev =NULL ; + } }if (buffer_jbddirty (bh)) {
fs/jbd/transaction.c +44 -20
118 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 48/62 e1000e: Change wthresh to 1 to avoid possible Tx stalls
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hiroaki SHIMODA <[email protected]>
commit 8edc0e624db3756783233e464879eb2e3b904c13 upstream.
This patch originated from Hiroaki SHIMODA but has been modified by Intel with some minor cleanups and additional commit log text.
Denys Fedoryshchenko and others reported Tx stalls on e1000e with BQL enabled. Issue was root caused to hardware delays. They were introduced because some of the e1000e hardware with transmit writeback bursting enabled, waits until the driver does an explict flush OR there are WTHRESH descriptors to write back.
Sometimes the delays in question were on the order of seconds, causing visible lag for ssh sessions and unacceptable tx completion latency, especially for BQL enabled kernels.
To avoid possible Tx stalls, change WTHRESH back to 1.
The current plan is to investigate a method for re-enabling WTHRESH while not harming BQL, but those patches will be later for net-next if they work.
please enqueue for stable since v3.3 as this bug was introduced in commit 3f0cfa3bc11e7f00c9994e0f469cbc0e7da7b00c
Author: Tom Herbert <[email protected]> Date: Mon Nov 28 16:33:16 2011 +0000
e1000e: Support for byte queue limits
Changes to e1000e to use byte queue limits.
--- drivers/net/ethernet/intel/e1000e/e1000.h | 6 +++--- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/e1000e/e1000.h +3 -3
@@ -175,13 +175,13 @@ struct e1000_info;/* * in the case of WTHRESH, it appears at least the 82571/2 hardware * writes back 4 descriptors when WTHRESH=5, and 3 descriptors when -* WTHRESH=4, and since we want 64 bytes at a time written back, set -* it to 5 +* WTHRESH=4, so a setting of 5 gives the most efficient bus +* utilization but to avoid possible Tx stalls, set it to 1 */ #define E1000_TXDCTL_DMA_BURST_ENABLE \ (E1000_TXDCTL_GRAN |/* set descriptor granularity */ \E1000_TXDCTL_COUNT_DESC | \ - (5 <<16 ) |/* wthresh must be +1 more than desired */ \ + (1 <<16 ) |/* wthresh must be +1 more than desired */ \ (1 <<8 ) |/* hthresh */ \ 0x1f) /* pthresh */
drivers/net/ethernet/intel/e1000e/netdev.c +1 -1
@@ -2806,7 +2806,7 @@ static void e1000_configure_tx(struct e1* set up some performance related parameters to encourage the * hardware to use the bus more efficiently in bursts, depends * on the tx_int_delay to be enabled, -* wthresh = 5 ==> burst write a cacheline (64 bytes) at a time +* wthresh = 1 ==> burst write is disabled to avoid Tx stalls * hthresh = 1 ==> prefetch when one or more available * pthresh = 0x1f ==> prefetch if internal cache 31 or less * BEWARE: this seems to work but should be considered first if
Greg Kroah-Hartman
maintainerPATCH 49/62 tpm: Propagate error from tpm_transmit to fix a timeout hang
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Huewe <[email protected]>
commit abce9ac292e13da367bbd22c1f7669f988d931ac upstream.
tpm_write calls tpm_transmit without checking the return value and assigns the return value unconditionally to chip->pending_data, even if it's an error value.
This causes three bugs.
So if we write to /dev/tpm0 with a tpm_param_size bigger than TPM_BUFSIZE=0x1000 (e.g. 0x100a)
and a bufsize also bigger than TPM_BUFSIZE (e.g. 0x100a) tpm_transmit returns -E2BIG which is assigned to chip->pending_data as -7, but tpm_write returns that TPM_BUFSIZE bytes have been successfully been written to the TPM, altough this is not true (bug #1).
As we did write more than than TPM_BUFSIZE bytes but tpm_write reports that only TPM_BUFSIZE bytes have been written the vfs tries to write the remaining bytes (in this case 10 bytes) to the tpm device driver via tpm_write which then blocks at
/* cannot perform a write until the read has cleared either via tpm_read or a user_read_timer timeout */ while (atomic_read(&chip->data_pending) != 0)
msleep(TPM_TIMEOUT);
for 60 seconds, since data_pending is -7 and nobody is able to read it (since tpm_read luckily checks if data_pending is greater than
0) (#bug 2).
After that the remaining bytes are written to the TPM which are interpreted by the tpm as a normal command. (bug #3) So if the last bytes of the command stream happen to be a e.g. tpm_force_clear this gets accidentally sent to the TPM.
This patch fixes all three bugs, by propagating the error code of tpm_write and returning -E2BIG if the input buffer is too big, since the response from the tpm for a truncated value is bogus anyway. Moreover it returns -EBUSY to userspace if there is a response ready to be read.
--- drivers/char/tpm/tpm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/char/tpm/tpm.c +14 -7
@@ -1186,17 +1186,20 @@ ssize_t tpm_write(struct file *file, con size_t size, loff_t *off) { struct tpm_chip *chip = file->private_data; -size_t in_size = size, out_size; +size_t in_size = size; +ssize_t out_size;/* cannot perform a write until the read has cleared -either via tpm_read or a user_read_timer timeout */ -while (atomic_read (&chip->data_pending) !=0 ) -msleep (TPM_TIMEOUT ); - -mutex_lock (&chip->buffer_mutex); +either via tpm_read or a user_read_timer timeout. +This also prevents splitted buffered writes from blocking here. +*/ +if (atomic_read (&chip->data_pending) !=0 ) +return -EBUSY ;if (in_size >TPM_BUFSIZE ) - in_size =TPM_BUFSIZE ; +return -E2BIG ; + +mutex_lock (&chip->buffer_mutex);if (copy_from_user (chip->data_buffer, (void __user *) buf, in_size)) {
@@ -1206,6 +1209,10 @@ ssize_t tpm_write(struct file *file, con/* atomic tpm command send and result receive */ out_size =tpm_transmit (chip, chip->data_buffer,TPM_BUFSIZE ); +if (out_size <0 ) { +mutex_unlock (&chip->buffer_mutex); +return out_size; + }atomic_set (&chip->data_pending, out_size);mutex_unlock (&chip->buffer_mutex);
Greg Kroah-Hartman
maintainerPATCH 50/62 eCryptfs: Unlink lower inode when ecryptfs_create() fails
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Hicks <[email protected]>
commit 8bc2d3cf612994a960c2e8eaea37f6676f67082a upstream.
ecryptfs_create() creates a lower inode, allocates an eCryptfs inode, initializes the eCryptfs inode and cryptographic metadata attached to the inode, and then writes the metadata to the header of the file.
If an error was to occur after the lower inode was created, an empty lower file would be left in the lower filesystem. This is a problem because ecryptfs_open() refuses to open any lower files which do not have the appropriate metadata in the file header.
This patch properly unlinks the lower inode when an error occurs in the later stages of ecryptfs_create(), reducing the chance that an empty lower file will be left in the lower filesystem.
https://launchpad.net/bugs/872905
--- fs/ecryptfs/inode.c | 55 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 23 deletions(-)
fs/ecryptfs/inode.c +32 -23
@@ -143,6 +143,31 @@ static int ecryptfs_interpose(struct denreturn 0 ; } +static int ecryptfs_do_unlink (struct inode *dir,struct dentry *dentry, +struct inode *inode) +{ +struct dentry *lower_dentry =ecryptfs_dentry_to_lower (dentry); +struct inode *lower_dir_inode =ecryptfs_inode_to_lower (dir); +struct dentry *lower_dir_dentry; +int rc; + +dget (lower_dentry); + lower_dir_dentry =lock_parent (lower_dentry); + rc =vfs_unlink (lower_dir_inode, lower_dentry); +if (rc) { +printk (KERN_ERR "Error in vfs_unlink; rc = [%d]\n" , rc); + goto out_unlock; + } +fsstack_copy_attr_times (dir, lower_dir_inode); +set_nlink (inode,ecryptfs_inode_to_lower (inode)->i_nlink); + inode->i_ctime = dir->i_ctime; +d_drop (dentry); +out_unlock: +unlock_dir (lower_dir_dentry); +dput (lower_dentry); +return rc; +} +/** * ecryptfs_do_create * @directory_inode: inode of the new file's dentry's parent in ecryptfs
@@ -182,8 +207,10 @@ ecryptfs_do_create(struct inode *directo } inode =__ecryptfs_get_inode (lower_dentry->d_inode, directory_inode->i_sb); -if (IS_ERR (inode)) +if (IS_ERR (inode)) { +vfs_unlink (lower_dir_dentry->d_inode, lower_dentry); goto out_lock; + }fsstack_copy_attr_times (directory_inode, lower_dir_dentry->d_inode);fsstack_copy_inode_size (directory_inode, lower_dir_dentry->d_inode); out_lock:
@@ -265,7 +292,9 @@ ecryptfs_create(struct inode *directory_* that this on disk file is prepared to be an ecryptfs file */ rc =ecryptfs_initialize_file (ecryptfs_dentry, ecryptfs_inode);if (rc) { -drop_nlink (ecryptfs_inode); +ecryptfs_do_unlink (directory_inode, ecryptfs_dentry, + ecryptfs_inode); +make_bad_inode (ecryptfs_inode);unlock_new_inode (ecryptfs_inode);iput (ecryptfs_inode); goto out;
@@ -477,27 +506,7 @@ out_lock:static int ecryptfs_unlink (struct inode *dir,struct dentry *dentry) { -int rc =0 ; -struct dentry *lower_dentry =ecryptfs_dentry_to_lower (dentry); -struct inode *lower_dir_inode =ecryptfs_inode_to_lower (dir); -struct dentry *lower_dir_dentry; - -dget (lower_dentry); - lower_dir_dentry =lock_parent (lower_dentry); - rc =vfs_unlink (lower_dir_inode, lower_dentry); -if (rc) { -printk (KERN_ERR "Error in vfs_unlink; rc = [%d]\n" , rc); - goto out_unlock; - } -fsstack_copy_attr_times (dir, lower_dir_inode); -set_nlink (dentry->d_inode, -ecryptfs_inode_to_lower (dentry->d_inode)->i_nlink); - dentry->d_inode->i_ctime = dir->i_ctime; -d_drop (dentry); -out_unlock: -unlock_dir (lower_dir_dentry); -dput (lower_dentry); -return rc; +return ecryptfs_do_unlink (dir, dentry, dentry->d_inode); } static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry,
Greg Kroah-Hartman
maintainerPATCH 51/62 eCryptfs: Initialize empty lower files when opening them
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Hicks <[email protected]>
commit e3ccaa9761200952cc269b1f4b7d7bb77a5e071b upstream.
Historically, eCryptfs has only initialized lower files in the ecryptfs_create() path. Lower file initialization is the act of writing the cryptographic metadata from the inode's crypt_stat to the header of the file. The ecryptfs_open() path already expects that metadata to be in the header of the file.
A number of users have reported empty lower files in beneath their eCryptfs mounts. Most of the causes for those empty files being left around have been addressed, but the presence of empty files causes problems due to the lack of proper cryptographic metadata.
To transparently solve this problem, this patch initializes empty lower files in the ecryptfs_open() error path. If the metadata is unreadable due to the lower inode size being 0, plaintext passthrough support is not in use, and the metadata is stored in the header of the file (as opposed to the user.ecryptfs extended attribute), the lower file will be initialized.
The number of nested conditionals in ecryptfs_open() was getting out of hand, so a helper function was created. To avoid the same nested conditional problem, the conditional logic was reversed inside of the helper function.
https://launchpad.net/bugs/911507
--- fs/ecryptfs/ecryptfs_kernel.h | 2 + fs/ecryptfs/file.c | 71 ++++++++++++++++++++++++++---------------- fs/ecryptfs/inode.c | 4 +- 3 files changed, 49 insertions(+), 28 deletions(-)
fs/ecryptfs/ecryptfs_kernel.h +2 -0
@@ -568,6 +568,8 @@ struct ecryptfs_open_req {struct inode *ecryptfs_get_inode (struct inode *lower_inode,struct super_block *sb);void ecryptfs_i_size_init (const char *page_virt,struct inode *inode); +int ecryptfs_initialize_file (struct dentry *ecryptfs_dentry, +struct inode *ecryptfs_inode); int ecryptfs_decode_and_decrypt_filename(char **decrypted_name, size_t *decrypted_name_size, struct dentry *ecryptfs_dentry,
fs/ecryptfs/file.c +45 -26
83 lines not on this page · raw message
fs/ecryptfs/inode.c +2 -2
@@ -227,8 +227,8 @@ out:* * Returns zero on success */ -static int ecryptfs_initialize_file (struct dentry *ecryptfs_dentry, -struct inode *ecryptfs_inode) +int ecryptfs_initialize_file (struct dentry *ecryptfs_dentry, +struct inode *ecryptfs_inode) {struct ecryptfs_crypt_stat *crypt_stat = &ecryptfs_inode_to_private (ecryptfs_inode)->crypt_stat;
Greg Kroah-Hartman
maintainerPATCH 52/62 eCryptfs: Revert to a writethrough cache model
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Hicks <[email protected]>
commit 821f7494a77627fb1ab539591c57b22cdca702d6 upstream.
A change was made about a year ago to get eCryptfs to better utilize its page cache during writes. The idea was to do the page encryption operations during page writeback, rather than doing them when initially writing into the page cache, to reduce the number of page encryption operations during sequential writes. This meant that the encrypted page would only be written to the lower filesystem during page writeback, which was a change from how eCryptfs had previously wrote to the lower filesystem in ecryptfs_write_end().
The change caused a few eCryptfs-internal bugs that were shook out. Unfortunately, more grave side effects have been identified that will force changes outside of eCryptfs. Because the lower filesystem isn't consulted until page writeback, eCryptfs has no way to pass lower write errors (ENOSPC, mainly) back to userspace. Additionaly, it was reported that quotas could be bypassed because of the way eCryptfs may sometimes open the lower filesystem using a privileged kthread.
It would be nice to resolve the latest issues, but it is best if the eCryptfs commits be reverted to the old behavior in the meantime.
This reverts:32001d6f "eCryptfs: Flush file in vma close"5be79de2 "eCryptfs: Flush dirty pages in setattr" 57db4e8d "ecryptfs: modify write path to encrypt page in writepage"
--- fs/ecryptfs/file.c | 33 ++------------------------------- fs/ecryptfs/inode.c | 6 ------ fs/ecryptfs/mmap.c | 39 +++++++++++++-------------------------- 3 files changed, 15 insertions(+), 63 deletions(-)
fs/ecryptfs/file.c +2 -31
@@ -138,27 +138,6 @@ out:return rc; } -static void ecryptfs_vma_close (struct vm_area_struct *vma) -{ -filemap_write_and_wait (vma->vm_file->f_mapping); -} - -static const struct vm_operations_struct ecryptfs_file_vm_ops = { - .close = ecryptfs_vma_close, - .fault = filemap_fault, -}; - -static int ecryptfs_file_mmap (struct file *file,struct vm_area_struct *vma) -{ -int rc; - - rc =generic_file_mmap (file, vma); -if (!rc) - vma->vm_ops = &ecryptfs_file_vm_ops; - -return rc; -} -struct kmem_cache *ecryptfs_file_info_cache;static int read_or_initialize_metadata (struct dentry *dentry)
@@ -311,15 +290,7 @@ static int ecryptfs_release(struct inodestatic int ecryptfs_fsync (struct file *file,loff_t start,loff_t end,int datasync) { -int rc =0 ; - - rc =generic_file_fsync (file, start, end, datasync); -if (rc) - goto out; - rc =vfs_fsync_range (ecryptfs_file_to_lower (file), start, end, - datasync); -out: -return rc; +return vfs_fsync (ecryptfs_file_to_lower (file), datasync); }static int ecryptfs_fasync (int fd,struct file *file,int flag)
@@ -388,7 +359,7 @@ const struct file_operations ecryptfs_ma#ifdef CONFIG_COMPAT .compat_ioctl = ecryptfs_compat_ioctl, #endif - .mmap = ecryptfs_file_mmap, + .mmap = generic_file_mmap, .open = ecryptfs_open, .flush = ecryptfs_flush, .release = ecryptfs_release,
fs/ecryptfs/inode.c +0 -6
@@ -1016,12 +1016,6 @@ static int ecryptfs_setattr(struct dentr goto out; } -if (S_ISREG (inode->i_mode)) { - rc =filemap_write_and_wait (inode->i_mapping); -if (rc) - goto out; -fsstack_copy_attr_all (inode, lower_inode); - }memcpy (&lower_ia, ia,sizeof (lower_ia));if (ia->ia_valid &ATTR_FILE ) lower_ia.ia_file =ecryptfs_file_to_lower (ia->ia_file);
fs/ecryptfs/mmap.c +13 -26
@@ -66,18 +66,6 @@ static int ecryptfs_writepage(struct pag {int rc; -/* -* Refuse to write the page out if we are called from reclaim context -* since our writepage() path may potentially allocate memory when -* calling into the lower fs vfs_write() which may in turn invoke -* us again. -*/ -if (current->flags &PF_MEMALLOC ) { -redirty_page_for_writepage (wbc, page); - rc =0 ; - goto out; - } - rc =ecryptfs_encrypt_page (page);if (rc) { ecryptfs_printk(KERN_WARNING, "Error encrypting "
@@ -498,7 +486,6 @@ static int ecryptfs_write_end(struct filstruct ecryptfs_crypt_stat *crypt_stat = &ecryptfs_inode_to_private (ecryptfs_inode)->crypt_stat;int rc; -int need_unlock_page =1 ;ecryptfs_printk (KERN_DEBUG ,"Calling fill_zeros_to_end_of_page" "(page w/ index = [0x%.16lx], to = [%d])\n" , index, to);
@@ -519,26 +506,26 @@ static int ecryptfs_write_end(struct fil "zeros in page with index = [0x%.16lx]\n", index); goto out; } -set_page_dirty (page); -unlock_page (page); - need_unlock_page =0 ; + rc =ecryptfs_encrypt_page (page); +if (rc) { +ecryptfs_printk (KERN_WARNING ,"Error encrypting page (upper " +"index [0x%.16lx])\n" , index); + goto out; + }if (pos + copied >i_size_read (ecryptfs_inode)) {i_size_write (ecryptfs_inode, pos + copied);ecryptfs_printk (KERN_DEBUG ,"Expanded file size to " "[0x%.16llx]\n" , (unsigned long long )i_size_read (ecryptfs_inode)); -balance_dirty_pages_ratelimited (mapping); - rc =ecryptfs_write_inode_size_to_metadata (ecryptfs_inode); -if (rc) { -printk (KERN_ERR "Error writing inode size to metadata; " -"rc = [%d]\n" , rc); - goto out; - } } - rc = copied; + rc =ecryptfs_write_inode_size_to_metadata (ecryptfs_inode); +if (rc) +printk (KERN_ERR "Error writing inode size to metadata; " +"rc = [%d]\n" , rc); +else + rc = copied; out: -if (need_unlock_page) -unlock_page (page); +unlock_page (page);page_cache_release (page);return rc; }
Greg Kroah-Hartman
maintainerPATCH 53/62 eCryptfs: Write out all dirty pages just before releasing the lower file
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Hicks <[email protected]>
commit 7149f2558d5b5b988726662fe58b1c388337805b upstream.
Fixes a regression caused by:
821f749 eCryptfs: Revert to a writethrough cache model
That patch reverted some code (specifically, 32001d6f) that was necessary to properly handle open() -> mmap() -> close() -> dirty pages -> munmap(), because the lower file could be closed before the dirty pages are written out.
Rather than reapplying 32001d6f, this approach is a better way of ensuring that the lower file is still open in order to handle writing out the dirty pages. It is called from ecryptfs_release(), while we have a lock on the lower file pointer, just before the lower file gets the final fput() and we overwrite the pointer.
https://launchpad.net/bugs/1047261
--- fs/ecryptfs/main.c | 1 + 1 file changed, 1 insertion(+)
fs/ecryptfs/main.c +1 -0
@@ -162,6 +162,7 @@ void ecryptfs_put_lower_file(struct inod inode_info =ecryptfs_inode_to_private (inode);if (atomic_dec_and_mutex_lock (&inode_info->lower_file_count, &inode_info->lower_file_mutex)) { +filemap_write_and_wait (inode->i_mapping);fput (inode_info->lower_file); inode_info->lower_file =NULL ;mutex_unlock (&inode_info->lower_file_mutex);
Greg Kroah-Hartman
maintainerPATCH 54/62 eCryptfs: Call lower ->flush() from ecryptfs_flush()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Hicks <[email protected]>
commit 64e6651dcc10e9d2cc6230208a8e6c2cfd19ae18 upstream.
Since eCryptfs only calls fput() on the lower file in ecryptfs_release(), eCryptfs should call the lower filesystem's ->flush() from ecryptfs_flush().
If the lower filesystem implements ->flush(), then eCryptfs should try to flush out any dirty pages prior to calling the lower ->flush(). If the lower filesystem does not implement ->flush(), then eCryptfs has no need to do anything in ecryptfs_flush() since dirty pages are now written out to the lower filesystem in ecryptfs_release().
--- fs/ecryptfs/file.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
fs/ecryptfs/file.c +8 -2
@@ -275,8 +275,14 @@ out:static int ecryptfs_flush (struct file *file,fl_owner_t td) { -return file->f_mode &FMODE_WRITE - ?filemap_write_and_wait (file->f_mapping) :0 ; +struct file *lower_file =ecryptfs_file_to_lower (file); + +if (lower_file->f_op && lower_file->f_op->flush) { +filemap_write_and_wait (file->f_mapping); +return lower_file->f_op->flush (lower_file, td); + } + +return 0 ; }static int ecryptfs_release (struct inode *inode,struct file *file)
Greg Kroah-Hartman
maintainerPATCH 55/62 usb: gadget: at91_udc: fix dt support
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Porcedda <[email protected]>
commit 9c6d196d5aa35e07482f23c3e37755e7a82140e0 upstream.
Don't fail the initialization check for the platform_data if there is avaiable an associated device tree node.
--- drivers/usb/gadget/at91_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/at91_udc.c +1 -1
@@ -1735,7 +1735,7 @@ static int __devinit at91udc_probe(strucint retval;struct resource *res; -if (!dev->platform_data) { +if (!dev->platform_data && !pdev->dev.of_node) {/* small (so we copy it) but critical! */ DBG ("missing platform_data\n" );return -ENODEV ;
Greg Kroah-Hartman
maintainerPATCH 56/62 ALSA: hda - Always check array bounds in alc_get_line_out_pfx
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Henningsson <[email protected]>
commit 71aa5ebe36a4e936eff281b375a4707b6a8320f2 upstream.
Even when CONFIG_SND_DEBUG is not enabled, we don't want to return an arbitrary memory location when the channel count is larger than we expected.
--- sound/pci/hda/patch_realtek.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +3 -1
@@ -2665,8 +2665,10 @@ static const char *alc_get_line_out_pfx(return "PCM" ;break ; } -if (snd_BUG_ON (ch >=ARRAY_SIZE (channel_name))) +if (ch >=ARRAY_SIZE (channel_name)) { +snd_BUG ();return "PCM" ; + }return channel_name[ch]; }
Greg Kroah-Hartman
maintainerPATCH 57/62 ASoC: fsi: dont reschedule DMA from an atomic context
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guennadi Liakhovetski <[email protected]>
commit 57451e437796548d658d03c2c4aab659eafcd799 upstream.
shdma doesn't support transfer re-scheduling or triggering from callbacks or from atomic context. The fsi driver issues DMA transfers from a tasklet context, which is a bug. To fix it convert tasklet to a work.
--- sound/soc/sh/fsi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
sound/soc/sh/fsi.c +8 -7
@@ -20,6 +20,7 @@#include <linux/sh_dma.h> #include <linux/slab.h> #include <linux/module.h> +#include <linux/workqueue.h> #include <sound/soc.h> #include <sound/sh_fsi.h>
@@ -199,7 +200,7 @@ struct fsi_stream {*/ struct dma_chan *chan;struct sh_dmae_slave slave;/* see fsi_handler_init() */ -struct tasklet_struct tasklet; +struct work_struct work;dma_addr_t dma; };
@@ -968,9 +969,9 @@ static dma_addr_t fsi_dma_get_area(strucreturn io->dma +samples_to_bytes (runtime, io->buff_sample_pos); } -static void fsi_dma_do_tasklet (unsigned long data) +static void fsi_dma_do_work (struct work_struct *work) { -struct fsi_stream *io = (struct fsi_stream *)data; + struct fsi_stream *io = container_of(work, struct fsi_stream, work);struct fsi_priv *fsi =fsi_stream_to_priv (io);struct dma_chan *chan;struct snd_soc_dai *dai;
@@ -1023,7 +1024,7 @@ static void fsi_dma_do_tasklet(unsigned* FIXME * * In DMAEngine case, codec and FSI cannot be started simultaneously -* since FSI is using tasklet. +* since FSI is using the scheduler work queue. * Therefore, in capture case, probably FSI FIFO will have got * overflow error in this point. * in that case, DMA cannot start transfer until error was cleared.
@@ -1047,7 +1048,7 @@ static bool fsi_dma_filter(struct dma_chstatic int fsi_dma_transfer (struct fsi_priv *fsi,struct fsi_stream *io) { -tasklet_schedule (&io->tasklet); +schedule_work (&io->work);return 0 ; }
@@ -1087,14 +1088,14 @@ static int fsi_dma_probe(struct fsi_privif (!io->chan)return -EIO ; -tasklet_init (&io->tasklet, fsi_dma_do_tasklet, (unsigned long )io); +INIT_WORK (&io->work, fsi_dma_do_work);return 0 ; }static int fsi_dma_remove (struct fsi_priv *fsi,struct fsi_stream *io) { -tasklet_kill (&io->tasklet); +cancel_work_sync (&io->work);fsi_stream_stop (fsi, io);
Greg Kroah-Hartman
maintainerPATCH 58/62 ASoC: wm2200: Use rev A register patches on rev B
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit 5ae9eb4cbdfd640269dbd66aa3c92ea8e11cc838 upstream.
--- sound/soc/codecs/wm2200.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/codecs/wm2200.c +1 -0
@@ -2091,6 +2091,7 @@ static __devinit int wm2200_i2c_probe(stswitch (wm2200->rev) {case 0 : +case 1 : ret =regmap_register_patch (wm2200->regmap, wm2200_reva_patch,ARRAY_SIZE (wm2200_reva_patch));if (ret !=0 ) {
Greg Kroah-Hartman
maintainerPATCH 59/62 ASoC: wm2200: Fix non-inverted OUT2 mute control
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit a1b98e12b7f8fad2f0aa3c08a3302bcac7ae1ec7 upstream.
--- sound/soc/codecs/wm2200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm2200.c +1 -1
@@ -1028,7 +1028,7 @@ SOC_DOUBLE_R_TLV("OUT2 Digital Volume", WM2200_DAC_DIGITAL_VOLUME_2R, WM2200_OUT2L_VOL_SHIFT, 0x9f, 0, digital_tlv), SOC_DOUBLE("OUT2 Switch", WM2200_PDM_1, WM2200_SPK1L_MUTE_SHIFT, - WM2200_SPK1R_MUTE_SHIFT, 1, 0), + WM2200_SPK1R_MUTE_SHIFT, 1, 1), };WM2200_MIXER_ENUMS (OUT1L ,WM2200_OUT1LMIX_INPUT_1_SOURCE );
Greg Kroah-Hartman
maintainerPATCH 60/62 ASoC: omap-abe-twl6040: Fix typo of Vibrator
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
commit 034940a6b3afbe79022ab6922dd9d2982b78e6d5 upstream.
It is not Vinrator but Vibrator.
--- sound/soc/omap/omap-abe-twl6040.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/omap/omap-abe-twl6040.c +1 -1
@@ -181,7 +181,7 @@ static int omap_abe_twl6040_init(structtwl6040_disconnect_pin (dapm, pdata->has_hf,"Ext Spk" );twl6040_disconnect_pin (dapm, pdata->has_ep,"Earphone Spk" );twl6040_disconnect_pin (dapm, pdata->has_aux,"Line Out" ); -twl6040_disconnect_pin (dapm, pdata->has_vibra,"Vinrator" ); +twl6040_disconnect_pin (dapm, pdata->has_vibra,"Vibrator" );twl6040_disconnect_pin (dapm, pdata->has_hsmic,"Headset Mic" );twl6040_disconnect_pin (dapm, pdata->has_mainmic,"Main Handset Mic" );twl6040_disconnect_pin (dapm, pdata->has_submic,"Sub Handset Mic" );
Greg Kroah-Hartman
maintainerPATCH 61/62 ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 733a48e5ae5bf28b046fad984d458c747cbb8c21 upstream.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=44721
--- sound/pci/ac97/ac97_codec.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/ac97/ac97_codec.c +2 -0
@@ -1271,6 +1271,8 @@ static int snd_ac97_cvol_new(struct snd_ tmp.index = ac97->num; kctl =snd_ctl_new1 (&tmp, ac97); } +if (!kctl) +return -ENOMEM ;if (reg >=AC97_PHONE && reg <=AC97_PCM )set_tlv_db_scale (kctl, db_scale_5bit_12db_max);else
Greg Kroah-Hartman
maintainerPATCH 62/62 ALSA: emu10k1: add chip details for E-mu 1010 PCIe card
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxim Kachur <[email protected]>
commit 10f571d09106c3eb85951896522c9650596eff2e upstream.
Add chip details for E-mu 1010 PCIe card. It has the same chip as found in E-mu 1010b but it uses different PCI id.
--- sound/pci/emu10k1/emu10k1_main.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/pci/emu10k1/emu10k1_main.c +9 -0
@@ -1416,6 +1416,15 @@ static struct snd_emu_chip_details emu_c .ca0108_chip = 1, .spk71 = 1, .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 new revision */ +/* Tested by Maxim Kachur <[email protected]> 17th Oct 2012. */ +/* This is MAEM8986, 0202 is MAEM8980 */ + {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40071102, + .driver = "Audigy2", .name = "E-mu 1010 PCIe [MAEM8986]", + .id = "EMU1010", + .emu10k2_chip = 1, + .ca0108_chip = 1, + .spk71 = 1, + .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 PCIe */ /* Tested by [email protected] 8th July 2005. */ /* This is MAEM8810, 0202 is MAEM8820 */ {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102,