summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-10-20 11:54:39 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2015-10-20 11:54:39 +0000
commit02c7f563c4b8524795f570372f240e7d94d1e4aa (patch)
tree06d80c11784906cd4dac4cd28f7d5f8b37223982 /usr/src
parentbf4e36204b30585f000823d7db32998886c08543 (diff)
parentf2f1e74250739faac0cdf175c8a7ae4480770789 (diff)
downloadillumos-joyent-02c7f563c4b8524795f570372f240e7d94d1e4aa.tar.gz
[illumos-gate merge]
commit f2f1e74250739faac0cdf175c8a7ae4480770789 5780 Truncated coredumps (fix lint) commit 7232236b5511ebe9b3343a5e1ab57a898e709218 6165 grub incorrectly interprets result of INT 15h, AX=EC00h commit 33d794d10eebfa2727ac1fc98fe0dd6c68f627dc 5780 Truncated coredumps
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/grub/grub-0.97/stage2/expand.c12
-rw-r--r--usr/src/uts/common/exec/elf/elf_notes.c22
2 files changed, 25 insertions, 9 deletions
diff --git a/usr/src/grub/grub-0.97/stage2/expand.c b/usr/src/grub/grub-0.97/stage2/expand.c
index 43f8b1f0d7..ead71c6e6b 100644
--- a/usr/src/grub/grub-0.97/stage2/expand.c
+++ b/usr/src/grub/grub-0.97/stage2/expand.c
@@ -108,18 +108,18 @@ detect_target_operating_mode(void)
* call left CF clear, nonzero otherwise.
*/
ret = get_target_operating_mode();
- ah = ret & 0xff;
- ret >>= 8;
+ ah = ret >> 8;
+ ret &= 0xff;
if (ah == 0x86 && ret != 0) {
grub_printf("[BIOS 'Detect Target Operating Mode' "
"callback unsupported on this platform]\n");
- return (1); /* unsupported, ignore */
+ return (1); /* unsupported, ignore */
}
if (ah == 0 && ret == 0) {
grub_printf("[BIOS accepted mixed-mode target setting!]\n");
- return (1); /* told the bios what we're up to */
+ return (1); /* told the bios what we're up to */
}
if (ah == 0 && ret != 0) {
@@ -190,7 +190,7 @@ amd64_config_cpu(void)
}
if (maxeax < 1)
- return (0); /* no additional functions, not an AMD64 */
+ return (0); /* no additional functions, not an AMD64 */
else {
uint_t family, model, step;
@@ -232,7 +232,7 @@ amd64_config_cpu(void)
}
}
- if (BITX(xtdfeatures, 29, 29)) /* long mode */
+ if (BITX(xtdfeatures, 29, 29)) /* long mode */
isamd64++;
else
grub_printf("amd64: CPU does NOT support long mode\n");
diff --git a/usr/src/uts/common/exec/elf/elf_notes.c b/usr/src/uts/common/exec/elf/elf_notes.c
index 81ce155db0..4b9c93c6ae 100644
--- a/usr/src/uts/common/exec/elf/elf_notes.c
+++ b/usr/src/uts/common/exec/elf/elf_notes.c
@@ -376,11 +376,27 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset,
(void) vnodetopath(vroot, fvp, fdinfo.pr_path,
sizeof (fdinfo.pr_path), credp);
- error = VOP_GETATTR(fvp, &vattr, 0, credp, NULL);
- if (error != 0) {
+ if (VOP_GETATTR(fvp, &vattr, 0, credp, NULL) != 0) {
+ /*
+ * Try to write at least a subset of information
+ */
+ fdinfo.pr_major = 0;
+ fdinfo.pr_minor = 0;
+ fdinfo.pr_ino = 0;
+ fdinfo.pr_mode = 0;
+ fdinfo.pr_uid = (uid_t)-1;
+ fdinfo.pr_gid = (gid_t)-1;
+ fdinfo.pr_rmajor = 0;
+ fdinfo.pr_rminor = 0;
+ fdinfo.pr_size = -1;
+
+ error = elfnote(vp, &offset, NT_FDINFO,
+ sizeof (fdinfo), &fdinfo, rlimit, credp);
VN_RELE(fvp);
VN_RELE(vroot);
- goto done;
+ if (error)
+ goto done;
+ continue;
}
if (fvp->v_type == VSOCK)