Kir, all -

We've briefly tested the -194.8.1.el5.028stab070.2 "RHEL5 testing" kernel -
works well so far.

Moreover, we have a patch on top of it, which is now part of the kernel
package on Owl-current (yes, it is built on top of this kernel version):

http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/kernel/

and we even have test Owl-current ISOs with this kernel:

lftp mirrors.kernel.org:/openwall/Owl/current/iso> ls | fgrep 0721
-rw-r--r--         455M  2010-07-21 20:33  Owl-current-20100721-i686.iso.gz
-rw-r--r--         460M  2010-07-21 20:39  Owl-current-20100721-x86_64.iso.gz

I've extracted the changes that I think are potentially upstream'able by
you (and some might be upstream'able by Red Hat), and attached the
resulting smaller patch to this message.  From diffstat, with my comments:

 arch/i386/kernel/cpu/amd.c             |    3 +
 arch/i386/kernel/cpu/intel_cacheinfo.c |    5 ++
 arch/x86_64/Kconfig                    |    1 
 fs/Kconfig                             |    1 
 include/linux/dmar.h                   |    4 --

These are build fixes for certain reasonable .config settings other
than your defaults.  The build would fail without the above changes.

 drivers/dca/Kconfig                    |    2 -

Bug fix to allow CONFIG_DCA=y to be set.  Without this change, when the
kernel is built with module support, only CONFIG_DCA=m would be possible
(and the setting would not appear in e.g. menuconfig at all).

 drivers/ata/Kconfig                    |    6 ++-
 drivers/ata/ahci.c                     |   20 ++++++++++
 drivers/ata/pata_marvell.c             |   61 +++++++++++++++++++++++----------

AHCI vs. Marvell PATA driver co-existence fixes backported from 2.6.34.1,
with the corresponding messages made more verbose (by me).  I have a
specific machine that benefits from this (tested).

 fs/proc/base.c                         |    8 ++--

The procfs entry perms changes I proposed in here.

--- The changes above this line might be upstream'able by Red Hat. ---

 drivers/parisc/eisa_eeprom.c           |    2 -
 net/llc/af_llc.c                       |    4 ++

Security fixes to subsystems that Red Hat does not support (so they
deliberately don't include such fixes).  I don't care much either, but
these were part of a larger set of fixes I was dealing with (most are
replaced by Red Hat's revisions by now).  Feel free to include or
disregard (if you, like Red Hat, support builds with your configs only).

 kernel/panic.c                         |    2 -

Reverting Red Hat's change of default for panic_on_oops from 1 (Red
Hat's setting) to 0 (kernel.org).  Since Red Hat won't provide support
for OpenVZ kernels and since your support procedures might not benefit
from panic_on_oops, you could want to keep it at the k.o default.

The security implications of this are non-trivial.  Either setting has
its pros and cons from a security standpoint.

 13 files changed, 88 insertions(+), 31 deletions(-)

Very minor changes overall, as you can see. :-)

Alexander
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/arch/i386/kernel/cpu/amd.c 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/arch/i386/kernel/cpu/amd.c
--- linux-2.6.18-194.8.1.el5.028stab070.2/arch/i386/kernel/cpu/amd.c    
2010-07-08 16:01:49 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/arch/i386/kernel/cpu/amd.c        
2010-07-15 11:13:30 +0000
@@ -45,11 +45,14 @@ static void __cpuinit amd_fixup_dcm(stru
        if (cpu_has(c, X86_FEATURE_AMD_DCM))
                return;
 
+#if 0
+/* early_is_k8_nb() is only defined under arch/x86_64/ */
        /* proceed only if there is a valid AMD northbridge
         * (not in virtualized environments!)
         */
        if (!early_is_k8_nb(read_pci_config(0, 24, 3, 0x00)))
                return;
+#endif
 
        rdmsrl(0xc001100c, value);
 
diff -urp 
linux-2.6.18-194.8.1.el5.028stab070.2/arch/i386/kernel/cpu/intel_cacheinfo.c 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/arch/i386/kernel/cpu/intel_cacheinfo.c
--- 
linux-2.6.18-194.8.1.el5.028stab070.2/arch/i386/kernel/cpu/intel_cacheinfo.c    
    2010-07-08 16:01:51 +0000
+++ 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/arch/i386/kernel/cpu/intel_cacheinfo.c
    2010-07-15 16:27:01 +0000
@@ -47,10 +47,12 @@ static void wbinvd_on_cpu(int cpu)
        smp_call_function_single(cpu, __wbinvd, NULL, 0, 1);
 }
 
+#if 0
 static int wbinvd_on_all_cpus(void)
 {
        return on_each_cpu(__wbinvd, NULL, 0, 1);
 }
+#endif
 
 /* from arch/x86/kernel/cpu/amd.c upstream */
 static int amd_get_nb_id(int cpu)
@@ -331,9 +333,12 @@ amd_check_l3_disable(int index, struct _
             (boot_cpu_data.x86_mask  < 0x1)))
                return;
 
+#if 0
+/* num_k8_northbridges is only defined under arch/x86_64/ */
        /* not in virtualized environments */
        if (num_k8_northbridges == 0)
                return;
+#endif
 
        this_leaf->can_disable = true;
        this_leaf->l3_indices  = amd_calc_l3_indices();
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/arch/x86_64/Kconfig 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/arch/x86_64/Kconfig
--- linux-2.6.18-194.8.1.el5.028stab070.2/arch/x86_64/Kconfig   2010-07-08 
16:01:51 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/arch/x86_64/Kconfig       
2010-07-15 11:07:35 +0000
@@ -476,6 +476,7 @@ config IOMMU
        default y
        select SWIOTLB
        select AGP
+       select IOMMU_HELPER
        depends on PCI && !X86_64_XEN
        help
          Support for full DMA access of devices with 32bit memory access only
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/drivers/ata/Kconfig 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/ata/Kconfig
--- linux-2.6.18-194.8.1.el5.028stab070.2/drivers/ata/Kconfig   2010-07-08 
16:01:25 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/ata/Kconfig       
2010-07-21 17:48:59 +0000
@@ -445,8 +445,10 @@ config PATA_MARVELL
        tristate "Marvell PATA support via legacy mode"
        depends on PCI
        help
-         This option enables limited support for the Marvell 88SE6145 ATA
-         controller.
+         This option enables limited support for the Marvell 88SE61xx ATA
+         controllers. If you wish to use only the SATA ports then select
+         the AHCI driver alone. If you wish to use the PATA port or both
+         SATA and PATA include this driver.
 
          If unsure, say N.
 
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/drivers/ata/ahci.c 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/ata/ahci.c
--- linux-2.6.18-194.8.1.el5.028stab070.2/drivers/ata/ahci.c    2010-07-08 
16:01:42 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/ata/ahci.c        
2010-07-21 17:47:07 +0000
@@ -616,6 +616,15 @@ module_param(ahci_em_messages, int, 0444
 MODULE_PARM_DESC(ahci_em_messages,
        "Set AHCI Enclosure Management Message type (0 = disabled, 1 = LED");
 
+#if defined(CONFIG_PATA_MARVELL) || defined(CONFIG_PATA_MARVELL_MODULE)
+static int marvell_enable;
+#else
+static int marvell_enable = 1;
+#endif
+module_param(marvell_enable, int, 0644);
+MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)");
+
+
 static inline int ahci_nr_ports(u32 cap)
 {
        return (cap & 0x1f) + 1;
@@ -735,6 +744,8 @@ static void ahci_save_initial_config(str
                           "MV_AHCI HACK: port_map %x -> %x\n",
                           port_map,
                           port_map & mv);
+               dev_printk(KERN_ERR, &pdev->dev,
+                         "Disabling your PATA port on the Marvell SATA/PATA 
controller, which is unsupported by the AHCI driver. Use the boot option 
'ahci.marvell_enable=0' to avoid this and let the likely slower Marvell PATA 
driver take over, supporting both SATA and PATA ports.\n");
 
                port_map &= mv;
        }
@@ -2568,6 +2579,15 @@ static int ahci_init_one(struct pci_dev 
        if (!printed_version++)
                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
 
+       /* The AHCI driver can only drive the SATA ports, the PATA driver
+          can drive them all so if both drivers are selected make sure
+          AHCI stays out of the way */
+       if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable) {
+               dev_printk(KERN_ERR, &pdev->dev,
+                         "Skipping the Marvell SATA/PATA controller in order 
to let the Marvell PATA driver take over. Use the boot option 
'ahci.marvell_enable=1' to avoid this, likely gaining a bit of performance but 
losing support for your PATA port.\n");
+               return -ENODEV;
+       }
+
        /* acquire resources */
        rc = pcim_enable_device(pdev);
        if (rc)
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/drivers/ata/pata_marvell.c 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/ata/pata_marvell.c
--- linux-2.6.18-194.8.1.el5.028stab070.2/drivers/ata/pata_marvell.c    
2010-07-08 16:01:25 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/ata/pata_marvell.c        
2010-07-21 17:44:34 +0000
@@ -5,7 +5,7 @@
  *     isn't making full use of the device functionality but it is
  *     easy to get working.
  *
- *     (c) 2006 Red Hat  <[email protected]>
+ *     (c) 2006 Red Hat
  */
 
 #include <linux/kernel.h>
@@ -20,29 +20,30 @@
 #include <linux/ata.h>
 
 #define DRV_NAME       "pata_marvell"
-#define DRV_VERSION    "0.1.4"
+#define DRV_VERSION    "0.1.6"
 
 /**
- *     marvell_pre_reset       -       check for 40/80 pin
- *     @link: link
- *     @deadline: deadline jiffies for the operation
+ *     marvell_pata_active     -       check if PATA is active
+ *     @pdev: PCI device
  *
- *     Perform the PATA port setup we need.
+ *     Returns 1 if the PATA port may be active. We know how to check this
+ *     for the 6145 but not the other devices
  */
 
-static int marvell_pre_reset(struct ata_link *link, unsigned long deadline)
+static int marvell_pata_active(struct pci_dev *pdev)
 {
-       struct ata_port *ap = link->ap;
-       struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+       int i;
        u32 devices;
        void __iomem *barp;
-       int i;
 
-       /* Check if our port is enabled */
+       /* We don't yet know how to do this for other devices */
+       if (pdev->device != 0x6145)
+               return 1;       
 
        barp = pci_iomap(pdev, 5, 0x10);
        if (barp == NULL)
                return -ENOMEM;
+
        printk("BAR5:");
        for(i = 0; i <= 0x0F; i++)
                printk("%02X:%02X ", i, ioread8(barp + i));
@@ -51,9 +52,27 @@ static int marvell_pre_reset(struct ata_
        devices = ioread32(barp + 0x0C);
        pci_iounmap(pdev, barp);
 
-       if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
-           (!(devices & 0x10)))        /* PATA enable ? */
-               return -ENOENT;
+       if (devices & 0x10)
+               return 1;
+       return 0;
+}
+
+/**
+ *     marvell_pre_reset       -       probe begin
+ *     @link: link
+ *     @deadline: deadline jiffies for the operation
+ *
+ *     Perform the PATA port setup we need.
+ */
+
+static int marvell_pre_reset(struct ata_link *link, unsigned long deadline)
+{
+       struct ata_port *ap = link->ap;
+       struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+
+       if (pdev->device == 0x6145 && ap->port_no == 0 &&
+               !marvell_pata_active(pdev))     /* PATA enable ? */
+                       return -ENOENT;
 
        return ata_sff_prereset(link, deadline);
 }
@@ -107,8 +126,8 @@ static int marvell_init_one (struct pci_
        static const struct ata_port_info info = {
                .flags          = ATA_FLAG_SLAVE_POSS,
 
-               .pio_mask       = 0x1f,
-               .mwdma_mask     = 0x07,
+               .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
                .udma_mask      = ATA_UDMA5,
 
                .port_ops       = &marvell_ops,
@@ -117,8 +136,8 @@ static int marvell_init_one (struct pci_
                /* Slave possible as its magically mapped not real */
                .flags          = ATA_FLAG_SLAVE_POSS,
 
-               .pio_mask       = 0x1f,
-               .mwdma_mask     = 0x07,
+               .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
                .udma_mask      = ATA_UDMA6,
 
                .port_ops       = &marvell_ops,
@@ -128,6 +147,12 @@ static int marvell_init_one (struct pci_
        if (pdev->device == 0x6101)
                ppi[1] = &ata_dummy_port_info;
 
+#if defined(CONFIG_SATA_AHCI) || defined(CONFIG_SATA_AHCI_MODULE)
+       if (!marvell_pata_active(pdev)) {
+               printk(KERN_INFO DRV_NAME ": PATA port not active, deferring to 
AHCI driver.\n");
+               return -ENODEV;
+       }
+#endif
        return ata_pci_sff_init_one(pdev, ppi, &marvell_sht, NULL);
 }
 
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/drivers/dca/Kconfig 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/dca/Kconfig
--- linux-2.6.18-194.8.1.el5.028stab070.2/drivers/dca/Kconfig   2010-07-08 
16:01:32 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/dca/Kconfig       
2010-07-20 13:33:13 +0000
@@ -3,7 +3,7 @@
 #
 
 config DCA
-       tristate
+       tristate "DCA server configuration"
        depends on DMA_ENGINE_V3 && PCI
        default m
        ---help---
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/drivers/parisc/eisa_eeprom.c 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/parisc/eisa_eeprom.c
--- linux-2.6.18-194.8.1.el5.028stab070.2/drivers/parisc/eisa_eeprom.c  
2006-09-20 03:42:06 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/drivers/parisc/eisa_eeprom.c      
2009-08-10 06:51:35 +0000
@@ -54,7 +54,7 @@ static ssize_t eisa_eeprom_read(struct f
        ssize_t ret;
        int i;
        
-       if (*ppos >= HPEE_MAX_LENGTH)
+       if (*ppos < 0 || *ppos >= HPEE_MAX_LENGTH)
                return 0;
        
        count = *ppos + count < HPEE_MAX_LENGTH ? count : HPEE_MAX_LENGTH - 
*ppos;
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/fs/Kconfig 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/fs/Kconfig
--- linux-2.6.18-194.8.1.el5.028stab070.2/fs/Kconfig    2010-07-08 16:01:52 
+0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/fs/Kconfig        2010-07-15 
11:43:05 +0000
@@ -473,6 +473,7 @@ config QFMT_V2
 config SIM_FS
        tristate "VPS filesystem"
        depends on VZ_QUOTA
+       select EXPORTFS
        default m
        help
          This file system is a part of Virtuozzo. It intoduces a fake
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/fs/proc/base.c 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/fs/proc/base.c
--- linux-2.6.18-194.8.1.el5.028stab070.2/fs/proc/base.c        2010-07-08 
16:01:52 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/fs/proc/base.c    2010-07-15 
11:30:25 +0000
@@ -260,10 +260,10 @@ static struct pid_entry tgid_base_stuff[
          S_IFREG|S_IRUGO|S_IWUSR),
 #endif
 #ifdef CONFIG_TASK_IO_ACCOUNTING
-       E(PROC_TGID_IO,             "io",  S_IFREG|S_IRUGO),
+       E(PROC_TGID_IO,             "io",  S_IFREG|S_IRUSR),
 #endif
 #ifdef CONFIG_STACKTRACE_PROC
-       E(PROC_TGID_STACK,     "stack",   S_IFREG|S_IRUGO),
+       E(PROC_TGID_STACK,     "stack",   S_IFREG|S_IRUSR),
 #endif
 
        {0,0,NULL,0}
@@ -310,10 +310,10 @@ static struct pid_entry tid_base_stuff[]
 #endif
        E(PROC_TID_LIMITS, "limits", S_IFREG|S_IRUSR),
 #ifdef CONFIG_TASK_IO_ACCOUNTING
-       E(PROC_TID_IO,         "io",      S_IFREG|S_IRUGO),
+       E(PROC_TID_IO,         "io",      S_IFREG|S_IRUSR),
 #endif
 #ifdef CONFIG_STACKTRACE_PROC
-       E(PROC_TID_STACK,      "stack",   S_IFREG|S_IRUGO),
+       E(PROC_TID_STACK,      "stack",   S_IFREG|S_IRUSR),
 #endif
 
        {0,0,NULL,0}
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/include/linux/dmar.h 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/include/linux/dmar.h
--- linux-2.6.18-194.8.1.el5.028stab070.2/include/linux/dmar.h  2010-07-08 
16:01:47 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/include/linux/dmar.h      
2010-07-15 11:07:35 +0000
@@ -125,10 +125,6 @@ extern int irq_remapped(int irq);
 extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev);
 extern struct intel_iommu *map_ioapic_to_ir(int apic);
 #else
-static inline int enable_drhd_fault_handling(void)
-{
-       return -1;
-}
 static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
 {
        return -1;
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/kernel/panic.c 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/kernel/panic.c
--- linux-2.6.18-194.8.1.el5.028stab070.2/kernel/panic.c        2010-07-08 
16:01:52 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/kernel/panic.c    2010-07-15 
11:07:35 +0000
@@ -20,7 +20,7 @@
 #include <linux/kexec.h>
 #include <linux/debug_locks.h>
 
-int panic_on_oops = 1;
+int panic_on_oops;
 int tainted = 1;
 static int pause_on_oops;
 static int pause_on_oops_flag;
diff -urp linux-2.6.18-194.8.1.el5.028stab070.2/net/llc/af_llc.c 
linux-2.6.18-194.8.1.el5.028stab070.2-owl/net/llc/af_llc.c
--- linux-2.6.18-194.8.1.el5.028stab070.2/net/llc/af_llc.c      2006-09-20 
03:42:06 +0000
+++ linux-2.6.18-194.8.1.el5.028stab070.2-owl/net/llc/af_llc.c  2009-08-26 
10:16:29 +0000
@@ -155,6 +155,9 @@ static int llc_ui_create(struct socket *
        struct sock *sk;
        int rc = -ESOCKTNOSUPPORT;
 
+       if (!capable(CAP_NET_RAW))
+               return -EPERM;
+
        if (likely(sock->type == SOCK_DGRAM || sock->type == SOCK_STREAM)) {
                rc = -ENOMEM;
                sk = llc_sk_alloc(PF_LLC, GFP_KERNEL, &llc_proto);
@@ -911,6 +914,7 @@ static int llc_ui_getname(struct socket 
        struct llc_sock *llc = llc_sk(sk);
        int rc = 0;
 
+       memset(&sllc, 0, sizeof(sllc));
        lock_sock(sk);
        if (sock_flag(sk, SOCK_ZAPPED))
                goto out;
_______________________________________________
Users mailing list
[email protected]
https://openvz.org/mailman/listinfo/users

Reply via email to