FreeBSD: upgrad to FreeBSD-releng-11.0 for some bugs.

dev
fengbojiang(姜凤波) 2019-11-20 20:41:29 +08:00
parent 8de6a6c5a4
commit e7145e3651
11 changed files with 54 additions and 28 deletions

View File

@ -608,6 +608,8 @@ amd64_set_ldt(td, uap, descs)
largest_ld = uap->start + uap->num;
if (largest_ld > max_ldt_segment)
largest_ld = max_ldt_segment;
if (largest_ld < uap->start)
return (EINVAL);
i = largest_ld - uap->start;
mtx_lock(&dt_lock);
bzero(&((struct user_segment_descriptor *)(pldt->ldt_base))
@ -620,7 +622,8 @@ amd64_set_ldt(td, uap, descs)
/* verify range of descriptors to modify */
largest_ld = uap->start + uap->num;
if (uap->start >= max_ldt_segment ||
largest_ld > max_ldt_segment)
largest_ld > max_ldt_segment ||
largest_ld < uap->start)
return (EINVAL);
}

View File

@ -474,7 +474,7 @@ ipfr_frag_new(softc, softf, fin, pass, table
IPFR_CMPSZ)) {
RWLOCK_EXIT(lock);
FBUMPD(ifs_exists);
KFREE(fra);
KFREE(fran);
return NULL;
}

View File

@ -1201,7 +1201,7 @@ out:
int
sys_kldstat(struct thread *td, struct kldstat_args *uap)
{
struct kld_file_stat stat;
struct kld_file_stat *stat;
int error, version;
/*
@ -1214,10 +1214,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *uap)
version != sizeof(struct kld_file_stat))
return (EINVAL);
error = kern_kldstat(td, uap->fileid, &stat);
if (error != 0)
stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
error = kern_kldstat(td, uap->fileid, stat);
if (error == 0)
error = copyout(stat, uap->stat, version);
free(stat, M_TEMP);
return (error);
return (copyout(&stat, uap->stat, version));
}
int

View File

@ -518,6 +518,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl,
struct ptrace_lwpinfo32 *pl32)
{
bzero(pl32, sizeof(*pl32));
pl32->pl_lwpid = pl->pl_lwpid;
pl32->pl_event = pl->pl_event;
pl32->pl_flags = pl->pl_flags;
@ -1229,6 +1230,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
} else
#endif
pl = addr;
bzero(pl, sizeof(*pl));
pl->pl_lwpid = td2->td_tid;
pl->pl_event = PL_EVENT_NONE;
pl->pl_flags = 0;
@ -1249,8 +1251,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
pl->pl_siginfo = td2->td_dbgksi.ksi_info;
}
}
if ((pl->pl_flags & PL_FLAG_SI) == 0)
bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo));
if (td2->td_dbgflags & TDB_SCE)
pl->pl_flags |= PL_FLAG_SCE;
else if (td2->td_dbgflags & TDB_SCX)

View File

@ -678,6 +678,7 @@ soaio_process_sb(struct socket *so, struct sockbuf *sb)
{
struct kaiocb *job;
CURVNET_SET(so->so_vnet);
SOCKBUF_LOCK(sb);
while (!TAILQ_EMPTY(&sb->sb_aiojobq) && soaio_ready(so, sb)) {
job = TAILQ_FIRST(&sb->sb_aiojobq);
@ -701,6 +702,7 @@ soaio_process_sb(struct socket *so, struct sockbuf *sb)
ACCEPT_LOCK();
SOCK_LOCK(so);
sorele(so);
CURVNET_RESTORE();
}
void

View File

@ -204,8 +204,8 @@ in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset)
offset += m->m_pkthdr.csum_data; /* checksum offset */
if (offset + sizeof(u_short) > m->m_len) {
#ifdef FSTACK
printf("%s: delayed m_pullup, m->len: %d plen %u off %u "
#ifdef FSTACK
"csum_flags=%lu\n", __func__, m->m_len, plen, offset,
m->m_pkthdr.csum_flags);
#else

View File

@ -270,4 +270,11 @@ typedef void (*unregister_framebuffer_fn)(void *, struct fb_info *);
EVENTHANDLER_DECLARE(register_framebuffer, register_framebuffer_fn);
EVENTHANDLER_DECLARE(unregister_framebuffer, unregister_framebuffer_fn);
/* Veto ada attachment */
struct cam_path;
struct ata_params;
typedef void (*ada_probe_veto_fn)(void *, struct cam_path *,
struct ata_params *, int *);
EVENTHANDLER_DECLARE(ada_probe_veto, ada_probe_veto_fn);
#endif /* _SYS_EVENTHANDLER_H_ */

View File

@ -411,6 +411,18 @@ ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id)
u_int old_vector, new_vector;
u_int old_id;
/*
* On Hyper-V:
* - Stick to the first cpu for all I/O APIC pins.
* - And don't allow destination cpu changes.
*/
if (vm_guest == VM_GUEST_HV) {
if (intpin->io_vector)
return (EINVAL);
else
apic_id = 0;
}
/*
* keep 1st core as the destination for NMI
*/