Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 05dbb1e557 | |||
| 0721a681c6 | |||
| c255cda2af | |||
| cf43ea0341 | |||
| 76739be851 | |||
| e381a0a116 | |||
| a49567a4db | |||
| 2811d271ee | |||
| 5163b0a323 | |||
| 7a8ad840d8 | |||
| 6532533a28 |
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 13
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = .1
|
||||
NAME=Woozy Numbat
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
@ -165,7 +165,6 @@ static int __init pcibios_init(void)
|
||||
if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT))
|
||||
pcibios_sort();
|
||||
#endif
|
||||
pci_assign_unassigned_resources();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -170,43 +170,26 @@ static void __init pcibios_allocate_resources(int pass)
|
||||
static int __init pcibios_assign_resources(void)
|
||||
{
|
||||
struct pci_dev *dev = NULL;
|
||||
int idx;
|
||||
struct resource *r;
|
||||
struct resource *r, *pr;
|
||||
|
||||
for_each_pci_dev(dev) {
|
||||
int class = dev->class >> 8;
|
||||
|
||||
/* Don't touch classless devices and host bridges */
|
||||
if (!class || class == PCI_CLASS_BRIDGE_HOST)
|
||||
continue;
|
||||
|
||||
for(idx=0; idx<6; idx++) {
|
||||
r = &dev->resource[idx];
|
||||
|
||||
/*
|
||||
* Don't touch IDE controllers and I/O ports of video cards!
|
||||
*/
|
||||
if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) ||
|
||||
(class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO)))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* We shall assign a new address to this resource, either because
|
||||
* the BIOS forgot to do so or because we have decided the old
|
||||
* address was unusable for some reason.
|
||||
*/
|
||||
if (!r->start && r->end)
|
||||
pci_assign_resource(dev, idx);
|
||||
}
|
||||
|
||||
if (pci_probe & PCI_ASSIGN_ROMS) {
|
||||
if (!(pci_probe & PCI_ASSIGN_ROMS)) {
|
||||
/* Try to use BIOS settings for ROMs, otherwise let
|
||||
pci_assign_unassigned_resources() allocate the new
|
||||
addresses. */
|
||||
for_each_pci_dev(dev) {
|
||||
r = &dev->resource[PCI_ROM_RESOURCE];
|
||||
r->end -= r->start;
|
||||
r->start = 0;
|
||||
if (r->end)
|
||||
pci_assign_resource(dev, PCI_ROM_RESOURCE);
|
||||
if (!r->flags || !r->start)
|
||||
continue;
|
||||
pr = pci_find_parent_resource(dev, r);
|
||||
if (!pr || request_resource(pr, r) < 0) {
|
||||
r->end -= r->start;
|
||||
r->start = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pci_assign_unassigned_resources();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -191,6 +191,8 @@ static unsigned int cbc_process_encrypt(const struct cipher_desc *desc,
|
||||
u8 *iv = desc->info;
|
||||
unsigned int done = 0;
|
||||
|
||||
nbytes -= bsize;
|
||||
|
||||
do {
|
||||
xor(iv, src);
|
||||
fn(crypto_tfm_ctx(tfm), dst, iv);
|
||||
@ -198,7 +200,7 @@ static unsigned int cbc_process_encrypt(const struct cipher_desc *desc,
|
||||
|
||||
src += bsize;
|
||||
dst += bsize;
|
||||
} while ((done += bsize) < nbytes);
|
||||
} while ((done += bsize) <= nbytes);
|
||||
|
||||
return done;
|
||||
}
|
||||
@ -219,6 +221,8 @@ static unsigned int cbc_process_decrypt(const struct cipher_desc *desc,
|
||||
u8 *iv = desc->info;
|
||||
unsigned int done = 0;
|
||||
|
||||
nbytes -= bsize;
|
||||
|
||||
do {
|
||||
u8 *tmp_dst = *dst_p;
|
||||
|
||||
@ -230,7 +234,7 @@ static unsigned int cbc_process_decrypt(const struct cipher_desc *desc,
|
||||
|
||||
src += bsize;
|
||||
dst += bsize;
|
||||
} while ((done += bsize) < nbytes);
|
||||
} while ((done += bsize) <= nbytes);
|
||||
|
||||
return done;
|
||||
}
|
||||
@ -243,12 +247,14 @@ static unsigned int ecb_process(const struct cipher_desc *desc, u8 *dst,
|
||||
void (*fn)(void *, u8 *, const u8 *) = desc->crfn;
|
||||
unsigned int done = 0;
|
||||
|
||||
nbytes -= bsize;
|
||||
|
||||
do {
|
||||
fn(crypto_tfm_ctx(tfm), dst, src);
|
||||
|
||||
src += bsize;
|
||||
dst += bsize;
|
||||
} while ((done += bsize) < nbytes);
|
||||
} while ((done += bsize) <= nbytes);
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
@ -938,10 +938,9 @@ found:
|
||||
|
||||
/*
|
||||
* XXX Interrupt pin #7 in Espresso is shared between RTC and
|
||||
* PCI Slot 2 INTA# (and some INTx# in Slot 1). SA_INTERRUPT here
|
||||
* is asking for trouble with add-on boards. Change to SA_SHIRQ.
|
||||
* PCI Slot 2 INTA# (and some INTx# in Slot 1).
|
||||
*/
|
||||
if (request_irq(rtc_irq, rtc_interrupt, SA_INTERRUPT, "rtc", (void *)&rtc_port)) {
|
||||
if (request_irq(rtc_irq, rtc_interrupt, SA_SHIRQ, "rtc", (void *)&rtc_port)) {
|
||||
/*
|
||||
* Standard way for sparc to print irq's is to use
|
||||
* __irq_itoa(). I think for EBus it's ok to use %d.
|
||||
|
||||
@ -254,6 +254,7 @@ config VIDEO_SAA7134_DVB
|
||||
select VIDEO_BUF_DVB
|
||||
select DVB_MT352
|
||||
select DVB_CX22702
|
||||
select DVB_TDA1004X
|
||||
---help---
|
||||
This adds support for DVB cards based on the
|
||||
Philips saa7134 chip.
|
||||
|
||||
@ -21,13 +21,21 @@
|
||||
* between the ROM and other resources, so enabling it may disable access
|
||||
* to MMIO registers or other card memory.
|
||||
*/
|
||||
static void pci_enable_rom(struct pci_dev *pdev)
|
||||
static int pci_enable_rom(struct pci_dev *pdev)
|
||||
{
|
||||
struct resource *res = pdev->resource + PCI_ROM_RESOURCE;
|
||||
struct pci_bus_region region;
|
||||
u32 rom_addr;
|
||||
|
||||
if (!res->flags)
|
||||
return -1;
|
||||
|
||||
pcibios_resource_to_bus(pdev, ®ion, res);
|
||||
pci_read_config_dword(pdev, pdev->rom_base_reg, &rom_addr);
|
||||
rom_addr |= PCI_ROM_ADDRESS_ENABLE;
|
||||
rom_addr &= ~PCI_ROM_ADDRESS_MASK;
|
||||
rom_addr |= region.start | PCI_ROM_ADDRESS_ENABLE;
|
||||
pci_write_config_dword(pdev, pdev->rom_base_reg, rom_addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,19 +79,21 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
|
||||
} else {
|
||||
if (res->flags & IORESOURCE_ROM_COPY) {
|
||||
*size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
|
||||
return (void __iomem *)pci_resource_start(pdev, PCI_ROM_RESOURCE);
|
||||
return (void __iomem *)pci_resource_start(pdev,
|
||||
PCI_ROM_RESOURCE);
|
||||
} else {
|
||||
/* assign the ROM an address if it doesn't have one */
|
||||
if (res->parent == NULL)
|
||||
pci_assign_resource(pdev, PCI_ROM_RESOURCE);
|
||||
|
||||
if (res->parent == NULL &&
|
||||
pci_assign_resource(pdev,PCI_ROM_RESOURCE))
|
||||
return NULL;
|
||||
start = pci_resource_start(pdev, PCI_ROM_RESOURCE);
|
||||
*size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
|
||||
if (*size == 0)
|
||||
return NULL;
|
||||
|
||||
/* Enable ROM space decodes */
|
||||
pci_enable_rom(pdev);
|
||||
if (pci_enable_rom(pdev))
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
* FIXME: IO should be max 256 bytes. However, since we may
|
||||
* have a P2P bridge below a cardbus bridge, we need 4K.
|
||||
*/
|
||||
#define CARDBUS_IO_SIZE (256)
|
||||
#define CARDBUS_IO_SIZE (4*1024)
|
||||
#define CARDBUS_MEM_SIZE (32*1024*1024)
|
||||
|
||||
static void __devinit
|
||||
|
||||
@ -968,7 +968,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
|
||||
fibsize = sizeof(struct aac_read64) +
|
||||
((le32_to_cpu(readcmd->sg.count) - 1) *
|
||||
sizeof (struct sgentry64));
|
||||
BUG_ON (fibsize > (sizeof(struct hw_fib) -
|
||||
BUG_ON (fibsize > (dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr)));
|
||||
/*
|
||||
* Now send the Fib to the adapter
|
||||
|
||||
@ -33,7 +33,8 @@ extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsi
|
||||
extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
|
||||
extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
|
||||
extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
|
||||
extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, unsigned char *,
|
||||
int);
|
||||
|
||||
struct sock;
|
||||
extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int);
|
||||
|
||||
#endif /* NET_COMPAT_H */
|
||||
|
||||
44
net/compat.c
44
net/compat.c
@ -135,13 +135,14 @@ static inline struct compat_cmsghdr __user *cmsg_compat_nxthdr(struct msghdr *ms
|
||||
* thus placement) of cmsg headers and length are different for
|
||||
* 32-bit apps. -DaveM
|
||||
*/
|
||||
int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
|
||||
int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
|
||||
unsigned char *stackbuf, int stackbuf_size)
|
||||
{
|
||||
struct compat_cmsghdr __user *ucmsg;
|
||||
struct cmsghdr *kcmsg, *kcmsg_base;
|
||||
compat_size_t ucmlen;
|
||||
__kernel_size_t kcmlen, tmp;
|
||||
int err = -EFAULT;
|
||||
|
||||
kcmlen = 0;
|
||||
kcmsg_base = kcmsg = (struct cmsghdr *)stackbuf;
|
||||
@ -156,6 +157,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
|
||||
|
||||
tmp = ((ucmlen - CMSG_COMPAT_ALIGN(sizeof(*ucmsg))) +
|
||||
CMSG_ALIGN(sizeof(struct cmsghdr)));
|
||||
tmp = CMSG_ALIGN(tmp);
|
||||
kcmlen += tmp;
|
||||
ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen);
|
||||
}
|
||||
@ -167,30 +169,34 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
|
||||
* until we have successfully copied over all of the data
|
||||
* from the user.
|
||||
*/
|
||||
if(kcmlen > stackbuf_size)
|
||||
kcmsg_base = kcmsg = kmalloc(kcmlen, GFP_KERNEL);
|
||||
if(kcmsg == NULL)
|
||||
if (kcmlen > stackbuf_size)
|
||||
kcmsg_base = kcmsg = sock_kmalloc(sk, kcmlen, GFP_KERNEL);
|
||||
if (kcmsg == NULL)
|
||||
return -ENOBUFS;
|
||||
|
||||
/* Now copy them over neatly. */
|
||||
memset(kcmsg, 0, kcmlen);
|
||||
ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg);
|
||||
while(ucmsg != NULL) {
|
||||
__get_user(ucmlen, &ucmsg->cmsg_len);
|
||||
if (__get_user(ucmlen, &ucmsg->cmsg_len))
|
||||
goto Efault;
|
||||
if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg))
|
||||
goto Einval;
|
||||
tmp = ((ucmlen - CMSG_COMPAT_ALIGN(sizeof(*ucmsg))) +
|
||||
CMSG_ALIGN(sizeof(struct cmsghdr)));
|
||||
if ((char *)kcmsg_base + kcmlen - (char *)kcmsg < CMSG_ALIGN(tmp))
|
||||
goto Einval;
|
||||
kcmsg->cmsg_len = tmp;
|
||||
__get_user(kcmsg->cmsg_level, &ucmsg->cmsg_level);
|
||||
__get_user(kcmsg->cmsg_type, &ucmsg->cmsg_type);
|
||||
|
||||
/* Copy over the data. */
|
||||
if(copy_from_user(CMSG_DATA(kcmsg),
|
||||
CMSG_COMPAT_DATA(ucmsg),
|
||||
(ucmlen - CMSG_COMPAT_ALIGN(sizeof(*ucmsg)))))
|
||||
goto out_free_efault;
|
||||
tmp = CMSG_ALIGN(tmp);
|
||||
if (__get_user(kcmsg->cmsg_level, &ucmsg->cmsg_level) ||
|
||||
__get_user(kcmsg->cmsg_type, &ucmsg->cmsg_type) ||
|
||||
copy_from_user(CMSG_DATA(kcmsg),
|
||||
CMSG_COMPAT_DATA(ucmsg),
|
||||
(ucmlen - CMSG_COMPAT_ALIGN(sizeof(*ucmsg)))))
|
||||
goto Efault;
|
||||
|
||||
/* Advance. */
|
||||
kcmsg = (struct cmsghdr *)((char *)kcmsg + CMSG_ALIGN(tmp));
|
||||
kcmsg = (struct cmsghdr *)((char *)kcmsg + tmp);
|
||||
ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen);
|
||||
}
|
||||
|
||||
@ -199,10 +205,12 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
|
||||
kmsg->msg_controllen = kcmlen;
|
||||
return 0;
|
||||
|
||||
out_free_efault:
|
||||
if(kcmsg_base != (struct cmsghdr *)stackbuf)
|
||||
kfree(kcmsg_base);
|
||||
return -EFAULT;
|
||||
Einval:
|
||||
err = -EINVAL;
|
||||
Efault:
|
||||
if (kcmsg_base != (struct cmsghdr *)stackbuf)
|
||||
sock_kfree_s(sk, kcmsg_base, kcmlen);
|
||||
return err;
|
||||
}
|
||||
|
||||
int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data)
|
||||
|
||||
@ -182,7 +182,7 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
|
||||
A = ntohl(*(u32 *)ptr);
|
||||
continue;
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case BPF_LD|BPF_H|BPF_ABS:
|
||||
k = fentry->k;
|
||||
load_h:
|
||||
@ -191,7 +191,7 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
|
||||
A = ntohs(*(u16 *)ptr);
|
||||
continue;
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case BPF_LD|BPF_B|BPF_ABS:
|
||||
k = fentry->k;
|
||||
load_b:
|
||||
@ -200,7 +200,7 @@ load_b:
|
||||
A = *(u8 *)ptr;
|
||||
continue;
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case BPF_LD|BPF_W|BPF_LEN:
|
||||
A = skb->len;
|
||||
continue;
|
||||
|
||||
@ -457,7 +457,7 @@ static void ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
|
||||
|
||||
if (pskb_pull(skb, ihl) == NULL)
|
||||
goto err;
|
||||
if (pskb_trim(skb, end-offset))
|
||||
if (pskb_trim_rcsum(skb, end-offset))
|
||||
goto err;
|
||||
|
||||
/* Find out which fragments are in front and at the back of us
|
||||
|
||||
@ -358,7 +358,7 @@ static void raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
|
||||
|
||||
if (type && code) {
|
||||
get_user(fl->fl_icmp_type, type);
|
||||
__get_user(fl->fl_icmp_code, code);
|
||||
get_user(fl->fl_icmp_code, code);
|
||||
probed = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -619,7 +619,7 @@ static void rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
|
||||
|
||||
if (type && code) {
|
||||
get_user(fl->fl_icmp_type, type);
|
||||
__get_user(fl->fl_icmp_code, code);
|
||||
get_user(fl->fl_icmp_code, code);
|
||||
probed = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1739,10 +1739,11 @@ asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags)
|
||||
goto out_freeiov;
|
||||
ctl_len = msg_sys.msg_controllen;
|
||||
if ((MSG_CMSG_COMPAT & flags) && ctl_len) {
|
||||
err = cmsghdr_from_user_compat_to_kern(&msg_sys, ctl, sizeof(ctl));
|
||||
err = cmsghdr_from_user_compat_to_kern(&msg_sys, sock->sk, ctl, sizeof(ctl));
|
||||
if (err)
|
||||
goto out_freeiov;
|
||||
ctl_buf = msg_sys.msg_control;
|
||||
ctl_len = msg_sys.msg_controllen;
|
||||
} else if (ctl_len) {
|
||||
if (ctl_len > sizeof(ctl))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user