--- /dev/null
+From nobody Mon Sep 17 00:00:00 2001
+From: Steve French <sfrench@us.ibm.com>
+Date: Fri Mar 31 21:22:00 2006 +0000
+Subject: [PATCH] [CIFS] Incorrect signature sent on SMB Read
+
+Fixes Samba bug 3621 and kernel.org bug 6147
+
+For servers which require SMB/CIFS packet signing, we were sending the
+wrong signature (all zeros) on SMB Read request. The new cifs routine
+to do signatures across an iovec was not complete - and SMB Read, unlike
+the new SMBWrite2, did not fall back to the older routine (ie use
+SendReceive vs. the more efficient SendReceive2 ie used the older
+cifs_sign_smb vs. the disabled cifs_sign_smb2) for calculating signatures.
+
+This finishes up cifs_sign_smb2/cifs_calc_signature2 so that the callers
+of SendReceive2 can get SMB/CIFS packet signatures.
+
+Now that cifs_sign_smb2 is supported, we could start using it in
+the write path but this smaller fix does not include the change
+to use SMBWrite2 when signatures are required (which when enabled
+will make more Writes more efficient and alloc less memory).
+Currently Write2 is only used when signatures are not
+required at the moment but after more testing we will enable
+that as well).
+
+Thanks to James Slepicka and Sam Flory for initial investigation.
+
+Signed-off-by: Steve French <sfrench@us.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/cifs/cifsencrypt.c | 36 +++++++++++++++++++++++-------------
+ 1 file changed, 23 insertions(+), 13 deletions(-)
+
+--- linux-2.6.16.5.orig/fs/cifs/cifsencrypt.c
++++ linux-2.6.16.5/fs/cifs/cifsencrypt.c
+@@ -56,9 +56,6 @@ int cifs_sign_smb(struct smb_hdr * cifs_
+ int rc = 0;
+ char smb_signature[20];
+
+- /* BB remember to initialize sequence number elsewhere and initialize mac_signing key elsewhere BB */
+- /* BB remember to add code to save expected sequence number in midQ entry BB */
+-
+ if((cifs_pdu == NULL) || (server == NULL))
+ return -EINVAL;
+
+@@ -85,20 +82,33 @@ int cifs_sign_smb(struct smb_hdr * cifs_
+ static int cifs_calc_signature2(const struct kvec * iov, int n_vec,
+ const char * key, char * signature)
+ {
+- struct MD5Context context;
+-
+- if((iov == NULL) || (signature == NULL))
+- return -EINVAL;
++ struct MD5Context context;
++ int i;
+
+- MD5Init(&context);
+- MD5Update(&context,key,CIFS_SESSION_KEY_SIZE+16);
++ if((iov == NULL) || (signature == NULL))
++ return -EINVAL;
+
+-/* MD5Update(&context,cifs_pdu->Protocol,cifs_pdu->smb_buf_length); */ /* BB FIXME BB */
++ MD5Init(&context);
++ MD5Update(&context,key,CIFS_SESSION_KEY_SIZE+16);
++ for(i=0;i<n_vec;i++) {
++ if(iov[i].iov_base == NULL) {
++ cERROR(1,("null iovec entry"));
++ return -EIO;
++ } else if(iov[i].iov_len == 0)
++ break; /* bail out if we are sent nothing to sign */
++ /* The first entry includes a length field (which does not get
++ signed that occupies the first 4 bytes before the header */
++ if(i==0) {
++ if (iov[0].iov_len <= 8 ) /* cmd field at offset 9 */
++ break; /* nothing to sign or corrupt header */
++ MD5Update(&context,iov[0].iov_base+4, iov[0].iov_len-4);
++ } else
++ MD5Update(&context,iov[i].iov_base, iov[i].iov_len);
++ }
+
+- MD5Final(signature,&context);
++ MD5Final(signature,&context);
+
+- return -EOPNOTSUPP;
+-/* return 0; */
++ return 0;
+ }
+
+
--- /dev/null
+From nobody Mon Sep 17 00:00:00 2001
+From: Pavel Machek <pavel@suse.cz>
+Date: Fri Mar 31 02:30:06 2006 -0800
+Subject: [PATCH] Fix suspend with traced tasks
+
+strace /bin/bash misbehaves after resume; this fixes it.
+
+(akpm: it's scary calling refrigerator() in state TASK_TRACED, but it seems to
+do the right thing).
+
+Signed-off-by: Pavel Machek <pavel@suse.cz>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/power/process.c | 3 +--
+ kernel/signal.c | 1 +
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- linux-2.6.16.5.orig/kernel/power/process.c
++++ linux-2.6.16.5/kernel/power/process.c
+@@ -25,8 +25,7 @@ static inline int freezeable(struct task
+ (p->flags & PF_NOFREEZE) ||
+ (p->exit_state == EXIT_ZOMBIE) ||
+ (p->exit_state == EXIT_DEAD) ||
+- (p->state == TASK_STOPPED) ||
+- (p->state == TASK_TRACED))
++ (p->state == TASK_STOPPED))
+ return 0;
+ return 1;
+ }
+--- linux-2.6.16.5.orig/kernel/signal.c
++++ linux-2.6.16.5/kernel/signal.c
+@@ -1688,6 +1688,7 @@ static void ptrace_stop(int exit_code, i
+ /* Let the debugger run. */
+ set_current_state(TASK_TRACED);
+ spin_unlock_irq(¤t->sighand->siglock);
++ try_to_freeze();
+ read_lock(&tasklist_lock);
+ if (likely(current->ptrace & PT_PTRACED) &&
+ likely(current->parent != current->real_parent ||
1 file changed, 13 insertions(+), 1 deletion(-)
e0661111e5441995f7a69dc4336c9f131cb9bc58
---- linux-2.6.16.4.orig/kernel/sys.c
-+++ linux-2.6.16.4/kernel/sys.c
+--- linux-2.6.16.5.orig/kernel/sys.c
++++ linux-2.6.16.5/kernel/sys.c
@@ -1657,7 +1657,19 @@ asmlinkage long sys_setrlimit(unsigned i
(cputime_eq(current->signal->it_prof_expires, cputime_zero) ||
new_rlim.rlim_cur <= cputime_to_secs(
1 file changed, 1 insertion(+), 2 deletions(-)
8c0b5113a55c698f3190ec85925815640f1c2049
---- linux-2.6.16.4.orig/fs/xfs/linux-2.6/xfs_iops.c
-+++ linux-2.6.16.4/fs/xfs/linux-2.6/xfs_iops.c
+--- linux-2.6.16.5.orig/fs/xfs/linux-2.6/xfs_iops.c
++++ linux-2.6.16.5/fs/xfs/linux-2.6/xfs_iops.c
@@ -673,8 +673,7 @@ linvfs_setattr(
if (ia_valid & ATTR_ATIME) {
vattr.va_mask |= XFS_AT_ATIME;
arch/alpha/kernel/smp.c | 8 +++-----
2 files changed, 20 insertions(+), 5 deletions(-)
---- linux-2.6.16.4.orig/arch/alpha/kernel/setup.c
-+++ linux-2.6.16.4/arch/alpha/kernel/setup.c
+--- linux-2.6.16.5.orig/arch/alpha/kernel/setup.c
++++ linux-2.6.16.5/arch/alpha/kernel/setup.c
@@ -24,6 +24,7 @@
#include <linux/config.h> /* CONFIG_ALPHA_LCA etc */
#include <linux/mc146818rtc.h>
void __init
setup_arch(char **cmdline_p)
{
---- linux-2.6.16.4.orig/arch/alpha/kernel/smp.c
-+++ linux-2.6.16.4/arch/alpha/kernel/smp.c
+--- linux-2.6.16.5.orig/arch/alpha/kernel/smp.c
++++ linux-2.6.16.5/arch/alpha/kernel/smp.c
@@ -439,7 +439,7 @@ setup_smp(void)
if ((cpu->flags & 0x1cc) == 0x1cc) {
smp_num_probed++;
drivers/block/cciss.c | 96 +++++++++++++++++++++++++-------------------------
1 file changed, 49 insertions(+), 47 deletions(-)
---- linux-2.6.16.4.orig/drivers/block/cciss.c
-+++ linux-2.6.16.4/drivers/block/cciss.c
+--- linux-2.6.16.5.orig/drivers/block/cciss.c
++++ linux-2.6.16.5/drivers/block/cciss.c
@@ -1181,6 +1181,53 @@ static int revalidate_allvol(ctlr_info_t
return 0;
}
drivers/edac/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---- linux-2.6.16.4.orig/drivers/edac/Kconfig
-+++ linux-2.6.16.4/drivers/edac/Kconfig
+--- linux-2.6.16.5.orig/drivers/edac/Kconfig
++++ linux-2.6.16.5/drivers/edac/Kconfig
@@ -71,7 +71,7 @@ config EDAC_E7XXX
config EDAC_E752X
fs/ext3/resize.c | 1 +
1 file changed, 1 insertion(+)
---- linux-2.6.16.4.orig/fs/ext3/resize.c
-+++ linux-2.6.16.4/fs/ext3/resize.c
+--- linux-2.6.16.5.orig/fs/ext3/resize.c
++++ linux-2.6.16.5/fs/ext3/resize.c
@@ -974,6 +974,7 @@ int ext3_group_extend(struct super_block
if (o_blocks_count != le32_to_cpu(es->s_blocks_count)) {
ext3_warning(sb, __FUNCTION__,
fs/partitions/check.c | 5 +++++
1 file changed, 5 insertions(+)
---- linux-2.6.16.4.orig/fs/partitions/check.c
-+++ linux-2.6.16.4/fs/partitions/check.c
+--- linux-2.6.16.5.orig/fs/partitions/check.c
++++ linux-2.6.16.5/fs/partitions/check.c
@@ -345,6 +345,7 @@ static char *make_block_name(struct gend
char *name;
static char *block_str = "block:";
mm/page_alloc.c | 31 ++++++++++++++++++-------------
3 files changed, 27 insertions(+), 17 deletions(-)
---- linux-2.6.16.4.orig/include/linux/mm.h
-+++ linux-2.6.16.4/include/linux/mm.h
+--- linux-2.6.16.5.orig/include/linux/mm.h
++++ linux-2.6.16.5/include/linux/mm.h
@@ -229,10 +229,9 @@ struct page {
unsigned long private; /* Mapping-private opaque data:
* usually used for buffer_heads
*/
struct address_space *mapping; /* If low bit clear, points to
* inode address_space, or NULL.
---- linux-2.6.16.4.orig/include/linux/page-flags.h
-+++ linux-2.6.16.4/include/linux/page-flags.h
+--- linux-2.6.16.5.orig/include/linux/page-flags.h
++++ linux-2.6.16.5/include/linux/page-flags.h
@@ -74,7 +74,9 @@
#define PG_mappedtodisk 16 /* Has blocks allocated on-disk */
#define PG_reclaim 17 /* To be reclaimed asap */
#define PageMappedToDisk(page) test_bit(PG_mappedtodisk, &(page)->flags)
#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags)
#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags)
---- linux-2.6.16.4.orig/mm/page_alloc.c
-+++ linux-2.6.16.4/mm/page_alloc.c
+--- linux-2.6.16.5.orig/mm/page_alloc.c
++++ linux-2.6.16.5/mm/page_alloc.c
@@ -153,7 +153,8 @@ static void bad_page(struct page *page)
1 << PG_reclaim |
1 << PG_slab |
fs/fuse/file.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---- linux-2.6.16.4.orig/fs/fuse/file.c
-+++ linux-2.6.16.4/fs/fuse/file.c
+--- linux-2.6.16.5.orig/fs/fuse/file.c
++++ linux-2.6.16.5/fs/fuse/file.c
@@ -397,8 +397,12 @@ static int fuse_readpages(struct file *f
return -EINTR;
drivers/usb/storage/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---- linux-2.6.16.4.orig/drivers/usb/storage/Kconfig
-+++ linux-2.6.16.4/drivers/usb/storage/Kconfig
+--- linux-2.6.16.5.orig/drivers/usb/storage/Kconfig
++++ linux-2.6.16.5/drivers/usb/storage/Kconfig
@@ -48,7 +48,8 @@ config USB_STORAGE_FREECOM
config USB_STORAGE_ISD200
include/asm-m32r/smp.h | 3 ++-
3 files changed, 17 insertions(+), 17 deletions(-)
---- linux-2.6.16.4.orig/arch/m32r/kernel/setup.c
-+++ linux-2.6.16.4/arch/m32r/kernel/setup.c
+--- linux-2.6.16.5.orig/arch/m32r/kernel/setup.c
++++ linux-2.6.16.5/arch/m32r/kernel/setup.c
@@ -9,6 +9,7 @@
#include <linux/config.h>
return 0;
}
---- linux-2.6.16.4.orig/arch/m32r/kernel/smpboot.c
-+++ linux-2.6.16.4/arch/m32r/kernel/smpboot.c
+--- linux-2.6.16.5.orig/arch/m32r/kernel/smpboot.c
++++ linux-2.6.16.5/arch/m32r/kernel/smpboot.c
@@ -39,8 +39,10 @@
* Martin J. Bligh : Added support for multi-quad systems
*/
cpu_2_physid[cpu_id] = -1;
}
-
---- linux-2.6.16.4.orig/include/asm-m32r/smp.h
-+++ linux-2.6.16.4/include/asm-m32r/smp.h
+--- linux-2.6.16.5.orig/include/asm-m32r/smp.h
++++ linux-2.6.16.5/include/asm-m32r/smp.h
@@ -67,7 +67,8 @@ extern volatile int cpu_2_physid[NR_CPUS
#define raw_smp_processor_id() (current_thread_info()->cpu)
include/asm-m32r/uaccess.h | 266 ++++++++++++++++++------------------------
5 files changed, 117 insertions(+), 329 deletions(-)
---- linux-2.6.16.4.orig/arch/m32r/kernel/m32r_ksyms.c
-+++ linux-2.6.16.4/arch/m32r/kernel/m32r_ksyms.c
+--- linux-2.6.16.5.orig/arch/m32r/kernel/m32r_ksyms.c
++++ linux-2.6.16.5/arch/m32r/kernel/m32r_ksyms.c
@@ -38,10 +38,6 @@ EXPORT_SYMBOL(__udelay);
EXPORT_SYMBOL(__delay);
EXPORT_SYMBOL(__const_udelay);
EXPORT_SYMBOL(strpbrk);
EXPORT_SYMBOL(strstr);
---- linux-2.6.16.4.orig/arch/m32r/lib/Makefile
-+++ linux-2.6.16.4/arch/m32r/lib/Makefile
+--- linux-2.6.16.5.orig/arch/m32r/lib/Makefile
++++ linux-2.6.16.5/arch/m32r/lib/Makefile
@@ -2,6 +2,6 @@
# Makefile for M32R-specific library files..
#
+lib-y := checksum.o ashxdi3.o memset.o memcpy.o \
+ delay.o strlen.o usercopy.o csum_partial_copy.o
---- linux-2.6.16.4.orig/arch/m32r/lib/getuser.S
+--- linux-2.6.16.5.orig/arch/m32r/lib/getuser.S
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-.previous
-
- .end
---- linux-2.6.16.4.orig/arch/m32r/lib/putuser.S
+--- linux-2.6.16.5.orig/arch/m32r/lib/putuser.S
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- .long 2b,bad_put_user
- .long 3b,bad_put_user
-.previous
---- linux-2.6.16.4.orig/include/asm-m32r/uaccess.h
-+++ linux-2.6.16.4/include/asm-m32r/uaccess.h
+--- linux-2.6.16.5.orig/include/asm-m32r/uaccess.h
++++ linux-2.6.16.5/include/asm-m32r/uaccess.h
@@ -5,17 +5,9 @@
* linux/include/asm-m32r/uaccess.h
*
drivers/char/tlclk.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
---- linux-2.6.16.4.orig/drivers/char/tlclk.c
-+++ linux-2.6.16.4/drivers/char/tlclk.c
+--- linux-2.6.16.5.orig/drivers/char/tlclk.c
++++ linux-2.6.16.5/drivers/char/tlclk.c
@@ -327,7 +327,7 @@ static ssize_t store_received_ref_clk3a(
return strnlen(buf, count);
}
net/ipv4/ip_output.c | 6 +++---
3 files changed, 15 insertions(+), 5 deletions(-)
---- linux-2.6.16.4.orig/include/net/ip.h
-+++ linux-2.6.16.4/include/net/ip.h
+--- linux-2.6.16.5.orig/include/net/ip.h
++++ linux-2.6.16.5/include/net/ip.h
@@ -95,6 +95,7 @@ extern int ip_local_deliver(struct sk_b
extern int ip_mr_input(struct sk_buff *skb);
extern int ip_output(struct sk_buff *skb);
extern int ip_do_nat(struct sk_buff *skb);
extern void ip_send_check(struct iphdr *ip);
extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok);
---- linux-2.6.16.4.orig/net/bridge/br_netfilter.c
-+++ linux-2.6.16.4/net/bridge/br_netfilter.c
+--- linux-2.6.16.5.orig/net/bridge/br_netfilter.c
++++ linux-2.6.16.5/net/bridge/br_netfilter.c
@@ -739,6 +739,15 @@ out:
return NF_STOLEN;
}
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
|| ((out->priv_flags & IFF_802_1Q_VLAN) &&
VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit)
---- linux-2.6.16.4.orig/net/ipv4/ip_output.c
-+++ linux-2.6.16.4/net/ipv4/ip_output.c
+--- linux-2.6.16.5.orig/net/ipv4/ip_output.c
++++ linux-2.6.16.5/net/ipv4/ip_output.c
@@ -86,8 +86,6 @@
int sysctl_ip_default_ttl = IPDEFTTL;
arch/powerpc/kernel/signal_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---- linux-2.6.16.4.orig/arch/powerpc/kernel/signal_64.c
-+++ linux-2.6.16.4/arch/powerpc/kernel/signal_64.c
+--- linux-2.6.16.5.orig/arch/powerpc/kernel/signal_64.c
++++ linux-2.6.16.5/arch/powerpc/kernel/signal_64.c
@@ -213,7 +213,7 @@ static inline void __user * get_sigframe
/* Default to using normal stack */
newsp = regs->gpr[1];
arch/powerpc/kernel/setup_64.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---- linux-2.6.16.4.orig/arch/powerpc/kernel/setup_64.c
-+++ linux-2.6.16.4/arch/powerpc/kernel/setup_64.c
+--- linux-2.6.16.5.orig/arch/powerpc/kernel/setup_64.c
++++ linux-2.6.16.5/arch/powerpc/kernel/setup_64.c
@@ -256,12 +256,10 @@ void __init early_setup(unsigned long dt
/*
* Initialize stab / SLB management except on iSeries
alpha-smp-boot-fixes.patch
XFS-Fix-utime-2-in-the-case-that-no-times-parameter-was-passed-in.patch
RLIMIT_CPU-fix-handling-of-a-zero-limit.patch
+CIFS-Incorrect-signature-sent-on-SMB-Read.patch
+Fix-suspend-with-traced-tasks.patch
drivers/net/sky2.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
---- linux-2.6.16.4.orig/drivers/net/sky2.c
-+++ linux-2.6.16.4/drivers/net/sky2.c
+--- linux-2.6.16.5.orig/drivers/net/sky2.c
++++ linux-2.6.16.5/drivers/net/sky2.c
@@ -579,8 +579,8 @@ static void sky2_mac_init(struct sky2_hw
reg = gma_read16(hw, port, GM_PHY_ADDR);
gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR);
gma_write16(hw, port, GM_PHY_ADDR, reg);
/* transmit control */
---- linux-2.6.16.4.orig/drivers/net/sky2.h
-+++ linux-2.6.16.4/drivers/net/sky2.h
+--- linux-2.6.16.5.orig/drivers/net/sky2.h
++++ linux-2.6.16.5/drivers/net/sky2.h
@@ -1380,6 +1380,7 @@ enum {
/* MIB Counters */
#define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */