Project

General

Profile

Actions

Bug #2110

closed

Bug #1450: Illumos should be buildable with GCC4

liblvm should avoid extending pointers

Added by Rich Lowe over 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2012-02-11
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Yet another bug where someone casts a pointer to a larger sized integer and risks sign extension!
Are we having fun yet?

In a struct mdnm_params, as generally given to metaioctl, we have a devname field that's conceptually a pointer but is actually uint64_t rather than uintptr_t. As such, when 32bit, there's a risk the actual pointer assigned to it will be sign-extended, it needs to be cast to uintptr_t first to make sure that doesn't occur.

I'm not going to get into the rathole of why this is a fixed 64bit type rather than something the size of a native pointer, I can see how we'd get here, and changing it is prohibitively costly in test/time.

Actions #1

Updated by Rich Lowe about 10 years ago

  • Status changed from New to Resolved
  • % Done changed from 80 to 100

Resolved in r13606 commit:3720d427d9fa

Actions

Also available in: Atom PDF