[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/kernel/FC-3 linux-2.6.12-serial-of.patch, NONE, 1.1 kernel-2.6.spec, 1.863, 1.864 linux-2.6.13-rc3-audit-git.patch, 1.1, 1.2



Author: davej

Update of /cvs/dist/rpms/kernel/FC-3
In directory cvs.devel.redhat.com:/tmp/cvs-serv22597

Modified Files:
	kernel-2.6.spec linux-2.6.13-rc3-audit-git.patch 
Added Files:
	linux-2.6.12-serial-of.patch 
Log Message:
sync with FC4


linux-2.6.12-serial-of.patch:
 arch/ppc64/kernel/setup.c   |  180 ----------------------------------------
 drivers/serial/8250_of.c    |  197 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/serial/Kconfig      |    5 +
 drivers/serial/Makefile     |    1 
 include/asm-ppc/pc_serial.h |  100 ----------------------
 5 files changed, 204 insertions(+), 279 deletions(-)

--- NEW FILE linux-2.6.12-serial-of.patch ---
--- linux-2.6.12/drivers/serial/Makefile.sof	2005-08-18 08:24:49.000000000 +0100
+++ linux-2.6.12/drivers/serial/Makefile	2005-08-18 08:25:33.000000000 +0100
@@ -17,6 +17,7 @@ obj-$(CONFIG_SERIAL_8250) += 8250.o $(se
 obj-$(CONFIG_SERIAL_8250_CS) += serial_cs.o
 obj-$(CONFIG_SERIAL_8250_ACORN) += 8250_acorn.o
 obj-$(CONFIG_SERIAL_8250_CONSOLE) += 8250_early.o
+obj-$(CONFIG_SERIAL_8250_OF) += 8250_of.o
 obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
 obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
 obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o
--- linux-2.6.12/drivers/serial/8250_of.c.sof	2005-08-18 08:24:49.000000000 +0100
+++ linux-2.6.12/drivers/serial/8250_of.c	2005-08-18 08:25:02.000000000 +0100
@@ -0,0 +1,197 @@
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <asm/serial.h>
+#include <asm/prom.h>
+
+#if 0
+#define DBG(fmt...) printk(KERN_DEBUG fmt)
+#else
+#define DBG(fmt...) do { } while (0)
+#endif
+
+/*
+ * This function can be used by platforms to "find" legacy serial ports.
+ * It works for "serial" nodes under an "isa" node, and will try to
+ * respect the "ibm,aix-loc" property if any. It works with up to 8
+ * ports.
+ */
+
+#define MAX_LEGACY_SERIAL_PORTS	8
+static int ports_probed = 0;
+
+static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
+static unsigned int old_serial_count;
+
+void __init generic_find_legacy_serial_ports(u64 *physport,
+		unsigned int *default_speed)
+{
+	struct device_node *np;
+	u32 *sizeprop;
+
+	struct isa_reg_property {
+		u32 space;
+		u32 address;
+		u32 size;
+	};
+
+	DBG(" -> generic_find_legacy_serial_port()\n");
+	ports_probed = 1;
+
+	*physport = 0;
+	if (default_speed)
+		*default_speed = 0;
+
+	np = of_find_node_by_path("/");
+	if (!np)
+		return;
+
+	/* First fill our array */
+	for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
+		struct device_node *isa, *pci;
+		struct isa_reg_property *reg;
+		unsigned long phys_size, addr_size;
+		u64 io_base;
+		u32 *rangesp;
+		u32 *interrupts, *clk, *spd;
+		char *typep;
+		int index, rlen, rentsize;
+
+		/* Ok, first check if it's under an "isa" parent */
+		isa = of_get_parent(np);
+		if (!isa || strcmp(isa->name, "isa")) {
+			DBG("%s: no isa parent found\n", np->full_name);
+			continue;
+		}
+
+		/* Now look for an "ibm,aix-loc" property that gives us ordering
+		 * if any...
+		 */
+	 	typep = (char *)get_property(np, "ibm,aix-loc", NULL);
+
+		/* Get the ISA port number */
+		reg = (struct isa_reg_property *)get_property(np, "reg", NULL);
+		if (reg == NULL)
+			goto next_port;
+		/* We assume the interrupt number isn't translated ... */
+		interrupts = (u32 *)get_property(np, "interrupts", NULL);
+		/* get clock freq. if present */
+		clk = (u32 *)get_property(np, "clock-frequency", NULL);
+		/* get default speed if present */
+		spd = (u32 *)get_property(np, "current-speed", NULL);
+		/* Default to locate at end of array */
+		index = old_serial_count; /* end of the array by default */
+
+		/* If we have a location index, then use it */
+		if (typep && *typep == 'S') {
+			index = simple_strtol(typep+1, NULL, 0) - 1;
+			/* if index is out of range, use end of array instead */
+			if (index >= MAX_LEGACY_SERIAL_PORTS)
+				index = old_serial_count;
+			/* if our index is still out of range, that mean that
+			 * array is full, we could scan for a free slot but that
+			 * make little sense to bother, just skip the port
+			 */
+			if (index >= MAX_LEGACY_SERIAL_PORTS)
+				goto next_port;
+			if (index >= old_serial_count)
+				old_serial_count = index + 1;
+			/* Check if there is a port who already claimed our slot */
+			if (serial_ports[index].iobase != 0) {
+				/* if we still have some room, move it, else override */
+				if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) {
+					DBG("Moved legacy port %d -> %d\n", index,
+					    old_serial_count);
+					serial_ports[old_serial_count++] =
+						serial_ports[index];
+				} else {
+					DBG("Replacing legacy port %d\n", index);
+				}
+			}
+		}
+		if (index >= MAX_LEGACY_SERIAL_PORTS)
+			goto next_port;
+		if (index >= old_serial_count)
+			old_serial_count = index + 1;
+
+		/* Now fill the entry */
+		memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port));
+		serial_ports[index].uartclk = (clk && *clk) ? *clk : BASE_BAUD * 16;
+		serial_ports[index].iobase = reg->address;
+		serial_ports[index].irq = interrupts ? interrupts[0] : 0;
+		serial_ports[index].flags = ASYNC_BOOT_AUTOCONF;
+
+		DBG("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n",
+		    index,
+		    serial_ports[index].iobase,
+		    serial_ports[index].irq,
+		    serial_ports[index].uartclk);
+
+		/* Get phys address of IO reg for port 1 */
+		if (index != 0)
+			goto next_port;
+
+		pci = of_get_parent(isa);
+		if (!pci) {
+			DBG("%s: no pci parent found\n", np->full_name);
+			goto next_port;
+		}
+
+		rangesp = (u32 *)get_property(pci, "ranges", &rlen);
+		if (rangesp == NULL) {
+			of_node_put(pci);
+			goto next_port;
+		}
+		rlen /= 4;
+
+		/* we need the #size-cells of the PCI bridge node itself */
+		phys_size = 1;
+		sizeprop = (u32 *)get_property(pci, "#size-cells", NULL);
+		if (sizeprop != NULL)
+			phys_size = *sizeprop;
+		/* we need the parent #addr-cells */
+		addr_size = prom_n_addr_cells(pci);
+		rentsize = 3 + addr_size + phys_size;
+		io_base = 0;
+		for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) {
+			if (((rangesp[0] >> 24) & 0x3) != 1)
+				continue; /* not IO space */
+			io_base = rangesp[3];
+			if (addr_size == 2)
+				io_base = (io_base << 32) | rangesp[4];
+		}
+		if (io_base != 0) {
+			*physport = io_base + reg->address;
+			if (default_speed && spd)
+				*default_speed = *spd;
+		}
+		of_node_put(pci);
+	next_port:
+		of_node_put(isa);
+	}
+
+	DBG(" <- generic_find_legacy_serial_port()\n");
+}
+
+static struct platform_device serial_device = {
+	.name	= "serial8250",
+	.id	= 0,
+	.dev	= {
+		.platform_data = serial_ports,
+	},
+};
+
+static int __init serial_dev_init(void)
+{
+	u64 phys;
+	unsigned int spd;
+
+	if (!ports_probed)
+		generic_find_legacy_serial_ports(&phys, &spd);
+	return platform_device_register(&serial_device);
+}
+arch_initcall(serial_dev_init);
--- linux-2.6.12/drivers/serial/Kconfig.sof	2005-08-18 08:24:49.000000000 +0100
+++ linux-2.6.12/drivers/serial/Kconfig	2005-08-18 08:25:02.000000000 +0100
@@ -77,6 +77,11 @@ config SERIAL_8250_CS
 
 	  If unsure, say N.
 
+config SERIAL_8250_OF
+       bool
+       default y
+       depends on PPC_OF && SERIAL_8250
+
 config SERIAL_8250_ACPI
 	bool "8250/16550 device discovery via ACPI namespace"
 	default y if IA64
--- linux-2.6.12/arch/ppc64/kernel/setup.c.sof	2005-08-18 08:24:49.000000000 +0100
+++ linux-2.6.12/arch/ppc64/kernel/setup.c	2005-08-18 08:25:02.000000000 +0100
@@ -1124,186 +1124,6 @@ void setup_default_decr(void)
 	lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
 }
 
-#ifndef CONFIG_PPC_ISERIES
-/*
- * This function can be used by platforms to "find" legacy serial ports.
- * It works for "serial" nodes under an "isa" node, and will try to
- * respect the "ibm,aix-loc" property if any. It works with up to 8
- * ports.
- */
-
-#define MAX_LEGACY_SERIAL_PORTS	8
-static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
-static unsigned int old_serial_count;
-
-void __init generic_find_legacy_serial_ports(u64 *physport,
-		unsigned int *default_speed)
-{
-	struct device_node *np;
-	u32 *sizeprop;
-
-	struct isa_reg_property {
-		u32 space;
-		u32 address;
-		u32 size;
-	};
-	struct pci_reg_property {
-		struct pci_address addr;
-		u32 size_hi;
-		u32 size_lo;
-	};                                                                        
-
-	DBG(" -> generic_find_legacy_serial_port()\n");
-
-	*physport = 0;
-	if (default_speed)
-		*default_speed = 0;
-
-	np = of_find_node_by_path("/");
-	if (!np)
-		return;
-
-	/* First fill our array */
-	for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
-		struct device_node *isa, *pci;
-		struct isa_reg_property *reg;
-		unsigned long phys_size, addr_size, io_base;
-		u32 *rangesp;
-		u32 *interrupts, *clk, *spd;
-		char *typep;
-		int index, rlen, rentsize;
-
-		/* Ok, first check if it's under an "isa" parent */
-		isa = of_get_parent(np);
-		if (!isa || strcmp(isa->name, "isa")) {
-			DBG("%s: no isa parent found\n", np->full_name);
-			continue;
-		}
-		
-		/* Now look for an "ibm,aix-loc" property that gives us ordering
-		 * if any...
-		 */
-	 	typep = (char *)get_property(np, "ibm,aix-loc", NULL);
-
-		/* Get the ISA port number */
-		reg = (struct isa_reg_property *)get_property(np, "reg", NULL);	
-		if (reg == NULL)
-			goto next_port;
-		/* We assume the interrupt number isn't translated ... */
-		interrupts = (u32 *)get_property(np, "interrupts", NULL);
-		/* get clock freq. if present */
-		clk = (u32 *)get_property(np, "clock-frequency", NULL);
-		/* get default speed if present */
-		spd = (u32 *)get_property(np, "current-speed", NULL);
-		/* Default to locate at end of array */
-		index = old_serial_count; /* end of the array by default */
-
-		/* If we have a location index, then use it */
-		if (typep && *typep == 'S') {
-			index = simple_strtol(typep+1, NULL, 0) - 1;
-			/* if index is out of range, use end of array instead */
-			if (index >= MAX_LEGACY_SERIAL_PORTS)
-				index = old_serial_count;
-			/* if our index is still out of range, that mean that
-			 * array is full, we could scan for a free slot but that
-			 * make little sense to bother, just skip the port
-			 */
-			if (index >= MAX_LEGACY_SERIAL_PORTS)
-				goto next_port;
-			if (index >= old_serial_count)
-				old_serial_count = index + 1;
-			/* Check if there is a port who already claimed our slot */
-			if (serial_ports[index].iobase != 0) {
-				/* if we still have some room, move it, else override */
-				if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) {
-					DBG("Moved legacy port %d -> %d\n", index,
-					    old_serial_count);
-					serial_ports[old_serial_count++] =
-						serial_ports[index];
-				} else {
-					DBG("Replacing legacy port %d\n", index);
-				}
-			}
-		}
-		if (index >= MAX_LEGACY_SERIAL_PORTS)
-			goto next_port;
-		if (index >= old_serial_count)
-			old_serial_count = index + 1;
-
-		/* Now fill the entry */
-		memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port));
-		serial_ports[index].uartclk = clk ? *clk : BASE_BAUD * 16;
-		serial_ports[index].iobase = reg->address;
-		serial_ports[index].irq = interrupts ? interrupts[0] : 0;
-		serial_ports[index].flags = ASYNC_BOOT_AUTOCONF;
-
-		DBG("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n",
-		    index,
-		    serial_ports[index].iobase,
-		    serial_ports[index].irq,
-		    serial_ports[index].uartclk);
-
-		/* Get phys address of IO reg for port 1 */
-		if (index != 0)
-			goto next_port;
-
-		pci = of_get_parent(isa);
-		if (!pci) {
-			DBG("%s: no pci parent found\n", np->full_name);
-			goto next_port;
-		}
-
-		rangesp = (u32 *)get_property(pci, "ranges", &rlen);
-		if (rangesp == NULL) {
-			of_node_put(pci);
-			goto next_port;
-		}
-		rlen /= 4;
-
-		/* we need the #size-cells of the PCI bridge node itself */
-		phys_size = 1;
-		sizeprop = (u32 *)get_property(pci, "#size-cells", NULL);
-		if (sizeprop != NULL)
-			phys_size = *sizeprop;
-		/* we need the parent #addr-cells */
-		addr_size = prom_n_addr_cells(pci);
-		rentsize = 3 + addr_size + phys_size;
-		io_base = 0;
-		for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) {
-			if (((rangesp[0] >> 24) & 0x3) != 1)
-				continue; /* not IO space */
-			io_base = rangesp[3];
-			if (addr_size == 2)
-				io_base = (io_base << 32) | rangesp[4];
-		}
-		if (io_base != 0) {
-			*physport = io_base + reg->address;
-			if (default_speed && spd)
-				*default_speed = *spd;
-		}
-		of_node_put(pci);
-	next_port:
-		of_node_put(isa);
-	}
-
-	DBG(" <- generic_find_legacy_serial_port()\n");
-}
-
-static struct platform_device serial_device = {
-	.name	= "serial8250",
-	.id	= 0,
-	.dev	= {
-		.platform_data = serial_ports,
-	},
-};
-
-static int __init serial_dev_init(void)
-{
-	return platform_device_register(&serial_device);
-}
-arch_initcall(serial_dev_init);
-
-#endif /* CONFIG_PPC_ISERIES */
 
 int check_legacy_ioport(unsigned long base_port)
 {
--- linux-2.6.12/include/asm-ppc/pc_serial.h.sof	2005-08-18 08:24:49.000000000 +0100
+++ linux-2.6.12/include/asm-ppc/pc_serial.h	2005-08-18 08:26:43.000000000 +0100
@@ -26,102 +26,4 @@
 #define RS_TABLE_SIZE  4
 #endif
 
-/* Standard COM flags (except for COM4, because of the 8514 problem) */
-#ifdef CONFIG_SERIAL_DETECT_IRQ
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
-#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
-#else
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
-#endif
-
-#ifdef CONFIG_SERIAL_MANY_PORTS
-#define FOURPORT_FLAGS ASYNC_FOURPORT
-#define ACCENT_FLAGS 0
-#define BOCA_FLAGS 0
-#define HUB6_FLAGS 0
-#endif
-	
-/*
- * The following define the access methods for the HUB6 card. All
- * access is through two ports for all 24 possible chips. The card is
- * selected through the high 2 bits, the port on that card with the
- * "middle" 3 bits, and the register on that port with the bottom
- * 3 bits.
- *
- * While the access port and interrupt is configurable, the default
- * port locations are 0x302 for the port control register, and 0x303
- * for the data read/write register. Normally, the interrupt is at irq3
- * but can be anything from 3 to 7 inclusive. Note that using 3 will
- * require disabling com2.
- */
-
-#define C_P(card,port) (((card)<<6|(port)<<3) + 1)
-
-#define STD_SERIAL_PORT_DEFNS			\
-	/* UART CLK   PORT IRQ     FLAGS        */			\
-	{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },	/* ttyS0 */	\
-	{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },	/* ttyS1 */	\
-	{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },	/* ttyS2 */	\
-	{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },	/* ttyS3 */
-
-
-#ifdef CONFIG_SERIAL_MANY_PORTS
-#define EXTRA_SERIAL_PORT_DEFNS			\
-	{ 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, 	/* ttyS4 */	\
-	{ 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS },	/* ttyS5 */	\
-	{ 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS },	/* ttyS6 */	\
-	{ 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS },	/* ttyS7 */	\
-	{ 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS },	/* ttyS8 */	\
-	{ 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS },	/* ttyS9 */	\
-	{ 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS },	/* ttyS10 */	\
-	{ 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS },	/* ttyS11 */	\
-	{ 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS },	/* ttyS12 */	\
-	{ 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS },	/* ttyS13 */	\
-	{ 0, BASE_BAUD, 0x000, 0, 0 },	/* ttyS14 (spare) */		\
-	{ 0, BASE_BAUD, 0x000, 0, 0 },	/* ttyS15 (spare) */		\
-	{ 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS },	/* ttyS16 */	\
-	{ 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS },	/* ttyS17 */	\
-	{ 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS },	/* ttyS18 */	\
-	{ 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS },	/* ttyS19 */	\
-	{ 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS },	/* ttyS20 */	\
-	{ 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS },	/* ttyS21 */	\
-	{ 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS },	/* ttyS22 */	\
-	{ 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS },	/* ttyS23 */	\
-	{ 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS },	/* ttyS24 */	\
-	{ 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS },	/* ttyS25 */	\
-	{ 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS },	/* ttyS26 */	\
-	{ 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS },	/* ttyS27 */	\
-	{ 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS },	/* ttyS28 */	\
-	{ 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS },	/* ttyS29 */	\
-	{ 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS },	/* ttyS30 */	\
-	{ 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS },	/* ttyS31 */
-#else
-#define EXTRA_SERIAL_PORT_DEFNS
-#endif
-
-/* You can have up to four HUB6's in the system, but I've only
- * included two cards here for a total of twelve ports.
- */
-#if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
-#define HUB6_SERIAL_PORT_DFNS		\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) },  /* ttyS32 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) },  /* ttyS33 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) },  /* ttyS34 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) },  /* ttyS35 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) },  /* ttyS36 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) },  /* ttyS37 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) },  /* ttyS38 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) },  /* ttyS39 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) },  /* ttyS40 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) },  /* ttyS41 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) },  /* ttyS42 */	\
-	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) },  /* ttyS43 */
-#else
-#define HUB6_SERIAL_PORT_DFNS
-#endif
-
-#define SERIAL_PORT_DFNS		\
-	STD_SERIAL_PORT_DEFNS		\
-	EXTRA_SERIAL_PORT_DEFNS		\
-	HUB6_SERIAL_PORT_DFNS
+#define SERIAL_PORT_DFNS /* */


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-3/kernel-2.6.spec,v
retrieving revision 1.863
retrieving revision 1.864
diff -u -r1.863 -r1.864
--- kernel-2.6.spec	18 Aug 2005 07:19:12 -0000	1.863
+++ kernel-2.6.spec	20 Aug 2005 06:44:06 -0000	1.864
@@ -203,18 +203,9 @@
 
 # 300 - 399   ppc(64)
 Patch300: linux-2.6.2-ppc64-build.patch
-Patch301: linux-2.6.8-ppc64-netboot.patch
+Patch301: linux-2.6.12-serial-of.patch
 Patch302: linux-2.6.10-ppc-headerabuse.patch
-Patch303: linux-2.6.11-ppc32-pmac-sleep-fix.patch
-Patch304: linux-2.6.11-cpufreq-add-suspend.patch
-Patch305: linux-2.6.11-ppc32-750-erratum-fix.patch
-Patch306: linux-2.6.11-ppc32-pbook-clock-spreading.patch
-Patch307: linux-2.6.11-mac-mini-sound.patch
-Patch308: linux-2.6.11-pmac-volume-save.patch
-Patch309: linux-2.6.11-pmac-ide-sleep.patch
-Patch310: linux-2.6.11-kallsyms-extra-text.patch
-Patch311: linux-2.6.12rc-ppc32-clockspreading-fix.patch
-Patch312: linux-2.6-windtunnel-printk.patch
+Patch303: linux-2.6-windtunnel-printk.patch
 
 # 400 - 499   ia64
 Patch400: linux-2.6.3-ia64-build.patch
@@ -320,7 +311,6 @@
 Patch1900: linux-2.6.12-pwc-warning.patch
 Patch1910: linux-2.6.12-ns558-nodev-rmmod.patch
 Patch1930: linux-2.6-appletouch-update.patch
-Patch1940: linux-2.6.9-audit-speedup.patch
 Patch1950: linux-2.6-selinux-addrlen-checks.patch
 Patch1960: linux-2.6-net-restrict-socket-policy-loading.patch
 
@@ -438,18 +428,9 @@
 
 # Patch for Kconfig and Makefile build issues
 %patch300 -p1
-#%patch301 -p1
+%patch301 -p1
 %patch302 -p1
-#%patch303 -p1
-#%patch304 -p1
-#%patch305 -p1
-#%patch306 -p1
-#%patch307 -p1
-#%patch308 -p1
-#%patch309 -p1
-#%patch310 -p1
-#%patch311 -p1
-%patch312 -p1
+%patch303 -p1
 
 #
 # ia64
@@ -653,8 +634,6 @@
 %patch1910 -p1
 # Fix Appletouch tapping.
 %patch1930 -p1
-# Audit speedup in syscall path.
-%patch1940 -p1
 # Fix addrlen checks in selinux_socket_connect
 %patch1950 -p1
 # Restrict socket policy loading to CAP_NET_ADMIN.
@@ -993,6 +972,11 @@
 %endif
 
 %changelog
+* Thu Aug 18 2005 David Woodhouse <dwmw2 redhat com>
+- Don't probe 8250 ports on ppc32 unless they're in the device tree
+- Enable ISDN, 8250 console, i8042 keyboard controller on ppc32
+- Audit updates from git tree
+
 * Tue Aug 16 2005 Dave Jones <davej redhat com> [2.6.12-1.1374_FC3]
 - Restrict ipsec socket policy loading to CAP_NET_ADMIN. (CAN-2005-2555)
 

linux-2.6.13-rc3-audit-git.patch:
 MAINTAINERS                    |    8 +
 fs/namei.c                     |    2 
 include/linux/audit.h          |   36 ++--
 kernel/audit.c                 |  128 ++++++++++------
 kernel/auditsc.c               |  321 ++++++++++++++++++++++++++++-------------
 security/selinux/avc.c         |    4 
 security/selinux/hooks.c       |    2 
 security/selinux/ss/services.c |    4 
 8 files changed, 340 insertions(+), 165 deletions(-)

Index: linux-2.6.13-rc3-audit-git.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-3/linux-2.6.13-rc3-audit-git.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6.13-rc3-audit-git.patch	5 Aug 2005 23:17:02 -0000	1.1
+++ linux-2.6.13-rc3-audit-git.patch	20 Aug 2005 06:44:06 -0000	1.2
@@ -168,7 +168,19 @@
  };
  
  static void audit_set_pid(struct audit_buffer *ab, pid_t pid)
-@@ -233,7 +230,7 @@ static int audit_set_rate_limit(int limi
+@@ -145,11 +142,6 @@ static void audit_set_pid(struct audit_b
+ 	nlh->nlmsg_pid = pid;
+ }
+ 
+-struct audit_entry {
+-	struct list_head  list;
+-	struct audit_rule rule;
+-};
+-
+ static void audit_panic(const char *message)
+ {
+ 	switch (audit_failure)
+@@ -233,7 +225,7 @@ static int audit_set_rate_limit(int limi
  {
  	int old		 = audit_rate_limit;
  	audit_rate_limit = limit;
@@ -177,7 +189,7 @@
  			"audit_rate_limit=%d old=%d by auid=%u",
  			audit_rate_limit, old, loginuid);
  	return old;
-@@ -243,7 +240,7 @@ static int audit_set_backlog_limit(int l
+@@ -243,7 +235,7 @@ static int audit_set_backlog_limit(int l
  {
  	int old		 = audit_backlog_limit;
  	audit_backlog_limit = limit;
@@ -186,7 +198,7 @@
  			"audit_backlog_limit=%d old=%d by auid=%u",
  			audit_backlog_limit, old, loginuid);
  	return old;
-@@ -255,7 +252,7 @@ static int audit_set_enabled(int state, 
+@@ -255,7 +247,7 @@ static int audit_set_enabled(int state, 
  	if (state != 0 && state != 1)
  		return -EINVAL;
  	audit_enabled = state;
@@ -195,7 +207,7 @@
  			"audit_enabled=%d old=%d by auid=%u",
  			audit_enabled, old, loginuid);
  	return old;
-@@ -269,7 +266,7 @@ static int audit_set_failure(int state, 
+@@ -269,7 +261,7 @@ static int audit_set_failure(int state, 
  	    && state != AUDIT_FAIL_PANIC)
  		return -EINVAL;
  	audit_failure = state;
@@ -204,7 +216,7 @@
  			"audit_failure=%d old=%d by auid=%u",
  			audit_failure, old, loginuid);
  	return old;
-@@ -281,6 +278,7 @@ int kauditd_thread(void *dummy)
+@@ -281,6 +273,7 @@ int kauditd_thread(void *dummy)
  
  	while (1) {
  		skb = skb_dequeue(&audit_skb_queue);
@@ -212,7 +224,7 @@
  		if (skb) {
  			if (audit_pid) {
  				int err = netlink_unicast(audit_sock, skb, audit_pid, 0);
-@@ -290,7 +288,7 @@ int kauditd_thread(void *dummy)
+@@ -290,7 +283,7 @@ int kauditd_thread(void *dummy)
  					audit_pid = 0;
  				}
  			} else {
@@ -221,7 +233,7 @@
  				kfree_skb(skb);
  			}
  		} else {
-@@ -423,7 +421,7 @@ static int audit_receive_msg(struct sk_b
+@@ -423,7 +416,7 @@ static int audit_receive_msg(struct sk_b
  		if (status_get->mask & AUDIT_STATUS_PID) {
  			int old   = audit_pid;
  			audit_pid = status_get->pid;
@@ -230,7 +242,7 @@
  				"audit_pid=%d old=%d by auid=%u",
  				  audit_pid, old, loginuid);
  		}
-@@ -435,15 +433,21 @@ static int audit_receive_msg(struct sk_b
+@@ -435,15 +428,21 @@ static int audit_receive_msg(struct sk_b
  		break;
  	case AUDIT_USER:
  	case AUDIT_FIRST_USER_MSG...AUDIT_LAST_USER_MSG:
@@ -261,7 +273,7 @@
  		break;
  	case AUDIT_ADD:
  	case AUDIT_DEL:
-@@ -522,7 +526,7 @@ static int __init audit_init(void)
+@@ -522,7 +521,7 @@ static int __init audit_init(void)
  	skb_queue_head_init(&audit_skb_queue);
  	audit_initialized = 1;
  	audit_enabled = audit_default;
@@ -270,7 +282,7 @@
  	return 0;
  }
  __initcall(audit_init);
-@@ -560,7 +564,7 @@ static void audit_buffer_free(struct aud
+@@ -560,7 +559,7 @@ static void audit_buffer_free(struct aud
  }
  
  static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
@@ -279,7 +291,7 @@
  {
  	unsigned long flags;
  	struct audit_buffer *ab = NULL;
-@@ -586,6 +590,7 @@ static struct audit_buffer * audit_buffe
+@@ -586,6 +585,7 @@ static struct audit_buffer * audit_buffe
  		goto err;
  
  	ab->ctx = ctx;
@@ -287,7 +299,7 @@
  	nlh = (struct nlmsghdr *)skb_put(ab->skb, NLMSG_SPACE(0));
  	nlh->nlmsg_type = type;
  	nlh->nlmsg_flags = 0;
-@@ -605,26 +610,27 @@ err:
+@@ -605,26 +605,27 @@ err:
   * (timestamp,serial) tuple is unique for each syscall and is live from
   * syscall entry to syscall exit.
   *
@@ -325,7 +337,7 @@
  }
  
  static inline void audit_get_stamp(struct audit_context *ctx, 
-@@ -644,17 +650,43 @@ static inline void audit_get_stamp(struc
+@@ -644,17 +645,43 @@ static inline void audit_get_stamp(struc
   * syscall, then the syscall is marked as auditable and an audit record
   * will be written at syscall exit.  If there is no associated task, tsk
   * should be NULL. */
@@ -372,7 +384,7 @@
  		if (audit_rate_check())
  			printk(KERN_WARNING
  			       "audit: audit_backlog=%d > "
-@@ -662,10 +694,12 @@ struct audit_buffer *audit_log_start(str
+@@ -662,10 +689,12 @@ struct audit_buffer *audit_log_start(str
  			       skb_queue_len(&audit_skb_queue),
  			       audit_backlog_limit);
  		audit_log_lost("backlog limit exceeded");
@@ -386,7 +398,7 @@
  	if (!ab) {
  		audit_log_lost("out of memory in audit_log_start");
  		return NULL;
-@@ -689,7 +723,7 @@ static inline int audit_expand(struct au
+@@ -689,7 +718,7 @@ static inline int audit_expand(struct au
  {
  	struct sk_buff *skb = ab->skb;
  	int ret = pskb_expand_head(skb, skb_headroom(skb), extra,
@@ -395,7 +407,7 @@
  	if (ret < 0) {
  		audit_log_lost("out of memory in audit_expand");
  		return 0;
-@@ -808,7 +842,7 @@ void audit_log_d_path(struct audit_buffe
+@@ -808,7 +837,7 @@ void audit_log_d_path(struct audit_buffe
  		audit_log_format(ab, " %s", prefix);
  
  	/* We will allow 11 spaces for ' (deleted)' to be appended */
@@ -404,7 +416,7 @@
  	if (!path) {
  		audit_log_format(ab, "<no memory>");
  		return;
-@@ -840,7 +874,7 @@ void audit_log_end(struct audit_buffer *
+@@ -840,7 +869,7 @@ void audit_log_end(struct audit_buffer *
  			ab->skb = NULL;
  			wake_up_interruptible(&kauditd_wait);
  		} else {
@@ -413,7 +425,7 @@
  		}
  	}
  	audit_buffer_free(ab);
-@@ -849,12 +883,13 @@ void audit_log_end(struct audit_buffer *
+@@ -849,12 +878,13 @@ void audit_log_end(struct audit_buffer *
  /* Log an audit record.  This is a convenience function that calls
   * audit_log_start, audit_log_vformat, and audit_log_end.  It may be
   * called in any context. */
@@ -470,28 +482,88 @@
  
  struct audit_entry {
  	struct list_head  list;
-@@ -210,16 +221,15 @@ static int audit_compare_rule(struct aud
+@@ -179,9 +190,36 @@ struct audit_entry {
+ 
+ extern int audit_pid;
+ 
++/* Copy rule from user-space to kernel-space.  Called from 
++ * audit_add_rule during AUDIT_ADD. */
++static inline int audit_copy_rule(struct audit_rule *d, struct audit_rule *s)
++{
++	int i;
++
++	if (s->action != AUDIT_NEVER
++	    && s->action != AUDIT_POSSIBLE
++	    && s->action != AUDIT_ALWAYS)
++		return -1;
++	if (s->field_count < 0 || s->field_count > AUDIT_MAX_FIELDS)
++		return -1;
++	if ((s->flags & ~AUDIT_FILTER_PREPEND) >= AUDIT_NR_FILTERS)
++		return -1;
++
++	d->flags	= s->flags;
++	d->action	= s->action;
++	d->field_count	= s->field_count;
++	for (i = 0; i < d->field_count; i++) {
++		d->fields[i] = s->fields[i];
++		d->values[i] = s->values[i];
++	}
++	for (i = 0; i < AUDIT_BITMASK_SIZE; i++) d->mask[i] = s->mask[i];
++	return 0;
++}
++
+ /* Check to see if two rules are identical.  It is called from
++ * audit_add_rule during AUDIT_ADD and 
+  * audit_del_rule during AUDIT_DEL. */
+-static int audit_compare_rule(struct audit_rule *a, struct audit_rule *b)
++static inline int audit_compare_rule(struct audit_rule *a, struct audit_rule *b)
+ {
+ 	int i;
+ 
+@@ -210,19 +248,37 @@ static int audit_compare_rule(struct aud
  /* Note that audit_add_rule and audit_del_rule are called via
   * audit_receive() in audit.c, and are protected by
   * audit_netlink_sem. */
 -static inline int audit_add_rule(struct audit_entry *entry,
 -				 struct list_head *list)
-+static inline void audit_add_rule(struct audit_entry *entry,
++static inline int audit_add_rule(struct audit_rule *rule,
 +				  struct list_head *list)
  {
 -	if (entry->rule.flags & AUDIT_PREPEND) {
 -		entry->rule.flags &= ~AUDIT_PREPEND;
++	struct audit_entry  *entry;
++
++	/* Do not use the _rcu iterator here, since this is the only
++	 * addition routine. */
++	list_for_each_entry(entry, list, list) {
++		if (!audit_compare_rule(rule, &entry->rule)) {
++			return -EEXIST;
++		}
++	}
++
++	if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL)))
++		return -ENOMEM;
++	if (audit_copy_rule(&entry->rule, rule)) {
++		kfree(entry);
++		return -EINVAL;
++	}
++
 +	if (entry->rule.flags & AUDIT_FILTER_PREPEND) {
 +		entry->rule.flags &= ~AUDIT_FILTER_PREPEND;
  		list_add_rcu(&entry->list, list);
  	} else {
  		list_add_tail_rcu(&entry->list, list);
  	}
--	return 0;
++
+ 	return 0;
  }
  
- static void audit_free_rule(struct rcu_head *head)
-@@ -245,7 +255,7 @@ static inline int audit_del_rule(struct 
+-static void audit_free_rule(struct rcu_head *head)
++static inline void audit_free_rule(struct rcu_head *head)
+ {
+ 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
+ 	kfree(e);
+@@ -245,82 +301,82 @@ static inline int audit_del_rule(struct 
  			return 0;
  		}
  	}
@@ -499,27 +571,29 @@
 +	return -ENOENT;		/* No matching rule */
  }
  
- /* Copy rule from user-space to kernel-space.  Called during
-@@ -260,6 +270,8 @@ static int audit_copy_rule(struct audit_
- 		return -1;
- 	if (s->field_count < 0 || s->field_count > AUDIT_MAX_FIELDS)
- 		return -1;
-+	if ((s->flags & ~AUDIT_FILTER_PREPEND) >= AUDIT_NR_FILTERS)
-+		return -1;
- 
- 	d->flags	= s->flags;
- 	d->action	= s->action;
-@@ -272,27 +284,60 @@ static int audit_copy_rule(struct audit_
- 	return 0;
- }
- 
+-/* Copy rule from user-space to kernel-space.  Called during
+- * AUDIT_ADD. */
+-static int audit_copy_rule(struct audit_rule *d, struct audit_rule *s)
 +static int audit_list_rules(void *_dest)
-+{
+ {
 +	int pid, seq;
 +	int *dest = _dest;
 +	struct audit_entry *entry;
-+	int i;
-+
+ 	int i;
+ 
+-	if (s->action != AUDIT_NEVER
+-	    && s->action != AUDIT_POSSIBLE
+-	    && s->action != AUDIT_ALWAYS)
+-		return -1;
+-	if (s->field_count < 0 || s->field_count > AUDIT_MAX_FIELDS)
+-		return -1;
+-
+-	d->flags	= s->flags;
+-	d->action	= s->action;
+-	d->field_count	= s->field_count;
+-	for (i = 0; i < d->field_count; i++) {
+-		d->fields[i] = s->fields[i];
+-		d->values[i] = s->values[i];
 +	pid = dest[0];
 +	seq = dest[1];
 +	kfree(dest);
@@ -532,18 +606,19 @@
 +		list_for_each_entry(entry, &audit_filter_list[i], list)
 +			audit_send_reply(pid, seq, AUDIT_LIST, 0, 1,
 +					 &entry->rule, sizeof(entry->rule));
-+	}
+ 	}
+-	for (i = 0; i < AUDIT_BITMASK_SIZE; i++) d->mask[i] = s->mask[i];
 +	audit_send_reply(pid, seq, AUDIT_LIST, 1, 1, NULL, 0);
 +	
 +	up(&audit_netlink_sem);
-+	return 0;
-+}
-+
+ 	return 0;
+ }
+ 
  int audit_receive_filter(int type, int pid, int uid, int seq, void *data,
  							uid_t loginuid)
  {
 -	u32		   flags;
- 	struct audit_entry *entry;
+-	struct audit_entry *entry;
 +	struct task_struct *tsk;
 +	int *dest;
  	int		   err = 0;
@@ -582,11 +657,14 @@
 +		}
  		break;
  	case AUDIT_ADD:
- 		if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL)))
-@@ -301,26 +346,20 @@ int audit_receive_filter(int type, int p
- 			kfree(entry);
+-		if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL)))
+-			return -ENOMEM;
+-		if (audit_copy_rule(&entry->rule, data)) {
+-			kfree(entry);
++		listnr =((struct audit_rule *)data)->flags & ~AUDIT_FILTER_PREPEND;
++		if (listnr >= AUDIT_NR_FILTERS)
  			return -EINVAL;
- 		}
+-		}
 -		flags = entry->rule.flags;
 -		if (!err && (flags & AUDIT_PER_TASK))
 -			err = audit_add_rule(entry, &audit_tsklist);
@@ -595,10 +673,12 @@
 -		if (!err && (flags & AUDIT_AT_EXIT))
 -			err = audit_add_rule(entry, &audit_extlist);
 -		audit_log(NULL, AUDIT_CONFIG_CHANGE, 
-+		listnr = entry->rule.flags & ~AUDIT_FILTER_PREPEND;
-+		audit_add_rule(entry, &audit_filter_list[listnr]);
-+		audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, 
- 				"auid=%u added an audit rule\n", loginuid);
+-				"auid=%u added an audit rule\n", loginuid);
++
++		err = audit_add_rule(data, &audit_filter_list[listnr]);
++		if (!err)
++			audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
++				  "auid=%u added an audit rule\n", loginuid);
  		break;
  	case AUDIT_DEL:
 -		flags =((struct audit_rule *)data)->flags;
@@ -621,7 +701,7 @@
  		break;
  	default:
  		return -EINVAL;
-@@ -454,7 +493,7 @@ static enum audit_state audit_filter_tas
+@@ -454,7 +510,7 @@ static enum audit_state audit_filter_tas
  	enum audit_state   state;
  
  	rcu_read_lock();
@@ -630,20 +710,32 @@
  		if (audit_filter_rules(tsk, &e->rule, NULL, &state)) {
  			rcu_read_unlock();
  			return state;
-@@ -478,6 +517,9 @@ static enum audit_state audit_filter_sys
- 	int		   word = AUDIT_WORD(ctx->major);
- 	int		   bit  = AUDIT_BIT(ctx->major);
- 
+@@ -474,20 +530,84 @@ static enum audit_state audit_filter_sys
+ 					     struct list_head *list)
+ {
+ 	struct audit_entry *e;
++	enum audit_state state;
++
 +	if (audit_pid && tsk->tgid == audit_pid)
 +		return AUDIT_DISABLED;
 +
- 	rcu_read_lock();
- 	list_for_each_entry_rcu(e, list, list) {
- 		if ((e->rule.mask[word] & bit) == bit
-@@ -490,6 +532,64 @@ static enum audit_state audit_filter_sys
- 	return AUDIT_BUILD_CONTEXT;
- }
- 
++	rcu_read_lock();
++	if (!list_empty(list)) {
++		    int word = AUDIT_WORD(ctx->major);
++		    int bit  = AUDIT_BIT(ctx->major);
++
++		    list_for_each_entry_rcu(e, list, list) {
++			    if ((e->rule.mask[word] & bit) == bit
++				&& audit_filter_rules(tsk, &e->rule, ctx, &state)) {
++				    rcu_read_unlock();
++				    return state;
++			    }
++		    }
++	}
++	rcu_read_unlock();
++	return AUDIT_BUILD_CONTEXT;
++}
++
 +static int audit_filter_user_rules(struct netlink_skb_parms *cb,
 +			      struct audit_rule *rule,
 +			      enum audit_state *state)
@@ -686,26 +778,32 @@
 +int audit_filter_user(struct netlink_skb_parms *cb, int type)
 +{
 +	struct audit_entry *e;
-+	enum audit_state   state;
+ 	enum audit_state   state;
+-	int		   word = AUDIT_WORD(ctx->major);
+-	int		   bit  = AUDIT_BIT(ctx->major);
 +	int ret = 1;
-+
-+	rcu_read_lock();
+ 
+ 	rcu_read_lock();
+-	list_for_each_entry_rcu(e, list, list) {
+-		if ((e->rule.mask[word] & bit) == bit
+- 		    && audit_filter_rules(tsk, &e->rule, ctx, &state)) {
+-			rcu_read_unlock();
+-			return state;
 +	list_for_each_entry_rcu(e, &audit_filter_list[AUDIT_FILTER_USER], list) {
 +		if (audit_filter_user_rules(cb, &e->rule, &state)) {
 +			if (state == AUDIT_DISABLED)
 +				ret = 0;
 +			break;
-+		}
-+	}
-+	rcu_read_unlock();
+ 		}
+ 	}
+ 	rcu_read_unlock();
+-	return AUDIT_BUILD_CONTEXT;
 +
 +	return ret; /* Audit by default */
-+}
-+
+ }
+ 
  /* This should be called with task_lock() held. */
- static inline struct audit_context *audit_get_context(struct task_struct *tsk,
- 						      int return_valid,
-@@ -504,7 +604,7 @@ static inline struct audit_context *audi
+@@ -504,7 +624,7 @@ static inline struct audit_context *audi
  
  	if (context->in_syscall && !context->auditable) {
  		enum audit_state state;
@@ -714,7 +812,7 @@
  		if (state == AUDIT_RECORD_CONTEXT)
  			context->auditable = 1;
  	}
-@@ -679,13 +779,13 @@ static void audit_log_task_info(struct a
+@@ -679,13 +799,13 @@ static void audit_log_task_info(struct a
  	up_read(&mm->mmap_sem);
  }
  
@@ -730,7 +828,7 @@
  	if (!ab)
  		return;		/* audit_panic has been called */
  	audit_log_format(ab, "arch=%x syscall=%d",
-@@ -717,7 +817,7 @@ static void audit_log_exit(struct audit_
+@@ -717,7 +837,7 @@ static void audit_log_exit(struct audit_
  
  	for (aux = context->aux; aux; aux = aux->next) {
  
@@ -739,7 +837,7 @@
  		if (!ab)
  			continue; /* audit_panic has been called */
  
-@@ -754,14 +854,14 @@ static void audit_log_exit(struct audit_
+@@ -754,14 +874,14 @@ static void audit_log_exit(struct audit_
  	}
  
  	if (context->pwd && context->pwdmnt) {
@@ -756,7 +854,7 @@
  		if (!ab)
  			continue; /* audit_panic has been called */
  
-@@ -770,6 +870,8 @@ static void audit_log_exit(struct audit_
+@@ -770,6 +890,8 @@ static void audit_log_exit(struct audit_
  			audit_log_format(ab, " name=");
  			audit_log_untrustedstring(ab, context->names[i].name);
  		}
@@ -765,7 +863,7 @@
  		if (context->names[i].ino != (unsigned long)-1)
  			audit_log_format(ab, " inode=%lu dev=%02x:%02x mode=%#o"
  					     " ouid=%u ogid=%u rdev=%02x:%02x",
-@@ -799,9 +901,11 @@ void audit_free(struct task_struct *tsk)
+@@ -799,9 +921,11 @@ void audit_free(struct task_struct *tsk)
  		return;
  
  	/* Check for system calls that do not go through the exit
@@ -780,7 +878,7 @@
  
  	audit_free_context(context);
  }
-@@ -876,11 +980,11 @@ void audit_syscall_entry(struct task_str
+@@ -876,11 +1000,11 @@ void audit_syscall_entry(struct task_str
  
  	state = context->state;
  	if (state == AUDIT_SETUP_CONTEXT || state == AUDIT_BUILD_CONTEXT)
@@ -794,9 +892,12 @@
  	context->ctime      = CURRENT_TIME;
  	context->in_syscall = 1;
  	context->auditable  = !!(state == AUDIT_RECORD_CONTEXT);
-@@ -905,8 +1009,8 @@ void audit_syscall_exit(struct task_stru
+@@ -903,10 +1027,10 @@ void audit_syscall_exit(struct task_stru
+ 	/* Not having a context here is ok, since the parent may have
+ 	 * called __put_task_struct. */
  	if (likely(!context))
- 		return;
+-		return;
++		goto out;
  
 -	if (context->in_syscall && context->auditable && context->pid != audit_pid)
 -		audit_log_exit(context);
@@ -805,7 +906,18 @@
  
  	context->in_syscall = 0;
  	context->auditable  = 0;
-@@ -996,7 +1100,7 @@ void audit_putname(const char *name)
+@@ -919,9 +1043,9 @@ void audit_syscall_exit(struct task_stru
+ 	} else {
+ 		audit_free_names(context);
+ 		audit_free_aux(context);
+-		audit_zero_context(context, context->state);
+ 		tsk->audit_context = context;
+ 	}
++ out:
+ 	put_task_struct(tsk);
+ }
+ 
+@@ -996,7 +1120,7 @@ void audit_putname(const char *name)
  
  /* Store the inode and device from a lookup.  Called from
   * fs/namei.c:path_lookup(). */
@@ -814,7 +926,7 @@
  {
  	int idx;
  	struct audit_context *context = current->audit_context;
-@@ -1022,17 +1126,20 @@ void audit_inode(const char *name, const
+@@ -1022,17 +1146,20 @@ void audit_inode(const char *name, const
  		++context->ino_count;
  #endif
  	}
@@ -841,7 +953,7 @@
  	t->tv_sec  = ctx->ctime.tv_sec;
  	t->tv_nsec = ctx->ctime.tv_nsec;
  	*serial    = ctx->serial;
-@@ -1044,7 +1151,7 @@ int audit_set_loginuid(struct task_struc
+@@ -1044,7 +1171,7 @@ int audit_set_loginuid(struct task_struc
  	if (task->audit_context) {
  		struct audit_buffer *ab;
  
@@ -850,7 +962,7 @@
  		if (ab) {
  			audit_log_format(ab, "login pid=%d uid=%u "
  				"old auid=%u new auid=%u",
-@@ -1153,7 +1260,7 @@ void audit_signal_info(int sig, struct t
+@@ -1153,7 +1280,7 @@ void audit_signal_info(int sig, struct t
  	extern pid_t audit_sig_pid;
  	extern uid_t audit_sig_uid;
  
@@ -883,7 +995,7 @@
 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
 --- a/security/selinux/hooks.c
 +++ b/security/selinux/hooks.c
-@@ -3441,7 +3441,7 @@ static int selinux_nlmsg_perm(struct soc
+@@ -3442,7 +3442,7 @@ static int selinux_nlmsg_perm(struct soc
  	err = selinux_nlmsg_lookup(isec->sclass, nlh->nlmsg_type, &perm);
  	if (err) {
  		if (err == -EINVAL) {
@@ -904,7 +1016,7 @@
  	          "security_validate_transition:  denied for"
  	          " oldcontext=%s newcontext=%s taskcontext=%s tclass=%s",
  	          o, n, t, policydb.p_class_val_to_name[tclass-1]);
-@@ -742,7 +742,7 @@ static int compute_sid_handle_invalid_co
+@@ -771,7 +771,7 @@ static int compute_sid_handle_invalid_co
  		goto out;
  	if (context_struct_to_string(newcontext, &n, &nlen) < 0)
  		goto out;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]