search for: uint_max

Displaying 20 results from an estimated 219 matches for "uint_max".

2018 Apr 27
4
[PATCH] allow indefinite ForwardX11Timeout by setting it to 0
...-git a/clientloop.c b/clientloop.c index 7bcf22e3..99dcec89 100644 --- a/clientloop.c +++ b/clientloop.c @@ -342,11 +342,17 @@ client_x11_get_proto(struct ssh *ssh, const char *display, rmdir(xauthdir); return -1; } - - if (timeout >= UINT_MAX - X11_TIMEOUT_SLACK) + /* add (at most) X11_TIMEOUT_SLACK to timeout to get + * x11_timeout_real, but do not adjust a timeout of 0 or + * overflow integers. + */ + if (timeout == 0) + x11_timeout_real = 0; + else if...
2010 Oct 11
2
[patch 1/2] vhost: potential integer overflows
...ff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index dd3d6f7..c2aa12c 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -429,6 +429,14 @@ static int vq_access_ok(unsigned int num, struct vring_avail __user *avail, struct vring_used __user *used) { + + if (num > UINT_MAX / sizeof *desc) + return 0; + if (num > UINT_MAX / sizeof *avail->ring - sizeof *avail) + return 0; + if (num > UINT_MAX / sizeof *used->ring - sizeof *used) + return 0; + return access_ok(VERIFY_READ, desc, num * sizeof *desc) && access_ok(VERIFY_READ, avail,...
2010 Oct 11
2
[patch 1/2] vhost: potential integer overflows
...ff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index dd3d6f7..c2aa12c 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -429,6 +429,14 @@ static int vq_access_ok(unsigned int num, struct vring_avail __user *avail, struct vring_used __user *used) { + + if (num > UINT_MAX / sizeof *desc) + return 0; + if (num > UINT_MAX / sizeof *avail->ring - sizeof *avail) + return 0; + if (num > UINT_MAX / sizeof *used->ring - sizeof *used) + return 0; + return access_ok(VERIFY_READ, desc, num * sizeof *desc) && access_ok(VERIFY_READ, avail,...
2008 Aug 13
4
MinGW Patch
...compile Flac on MinGW/Msys but got an error stating SIZE_T_MAX is undefined. To fix this error I edited the file "flac-1.2.1/include/share/alloc.h" and made the following change: Starting at line #36 I changed: #ifndef SIZE_MAX # ifndef SIZE_T_MAX # ifdef _MSC_VER # define SIZE_T_MAX UINT_MAX # else # error # endif # endif # define SIZE_MAX SIZE_T_MAX #endif To: #ifndef SIZE_MAX # ifndef SIZE_T_MAX # ifdef _MSC_VER # define SIZE_T_MAX UINT_MAX # elif defined(__MINGW_H) # define SIZE_T_MAX UINT_MAX # else # error # endif # endif # define SIZE_MAX SIZE_T_MAX #endif Hope I...
2014 Aug 25
7
[Bug 2264] New: RekeyLimit option does not allow '4G' value when UINT_MAX is 0xffffffff
https://bugzilla.mindrot.org/show_bug.cgi?id=2264 Bug ID: 2264 Summary: RekeyLimit option does not allow '4G' value when UINT_MAX is 0xffffffff Product: Portable OpenSSH Version: 6.6p1 Hardware: Other OS: Linux Status: NEW Severity: normal Priority: P5 Component: sshd Assignee: unassigned-bugs at mindrot.org Reporter:...
2015 Feb 04
2
[LLVMdev] Is this a bug with loop unrolling and TargetTransformInfo ?
Hi, I ran into this issue recently and wanted to know if it was a bug or expected behavior. In the R600 backend's TargetTransformInfo implementation, we were setting UnrollingPreferences::Count = UINT_MAX. This was a mistake as we should have been setting UnrollingPreferences::MaxCount instead. However, as a result of setting Count to UINT_MAX, this loop would be unrolled 15 times: if (b + 4 > a) { for (int i = 0; i < 4; i++, b++) { if (b + 1 <= a) *(dst + c + b) = 0; el...
2015 Feb 05
1
[patch] vhost/scsi: potential memory corruption
This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt" to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16. I looked at the context and it turns out that in vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so anything higher than 255...
2015 Feb 05
1
[patch] vhost/scsi: potential memory corruption
This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt" to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16. I looked at the context and it turns out that in vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so anything higher than 255...
2011 Feb 08
1
Build issues and fixes
...- I'm taking a "shortest path to functionality" approach - but with a little work could probably be turned into general patches. First, I'm occasionally building under MingW, via the Windows headers. LibFlac makes use of a constant SIZE_T_MAX, which, under MSVC, is defined as UINT_MAX. Unfortunately MSVC isn't the determining factor here, the Windows headers are, and so MingW results in an error. My simple fix was to remove the MSVC check - if SIZE_T_MAX doesn't exist, it *always* defines it as UINT_MAX. That's line 38 in include/share/alloc.h. Second, I'm oc...
2007 Nov 10
3
ring.h notification hold-off question
...RING_IDX)(__new - __old)); \ } while (0) questions are regarding wrapping the ring indexes. a) to make sure: ring idx integer-wraps do happen, right? asking because the only mask operations i can find are those in the GET_REQUEST/RESPONSE macros. b) if __old were UINT_MAX, then the consumer side might/would set req_event to 0 after catching up right? (req_cons(== req_prod)+1) now assume __new == __old + 2 then we had req_event [0] < __new [1] < __old [INT_MAX] i.e. __new - req_event [1] > __new - __old [-1] i.e. _notify=false, which i be...
2011 Sep 28
1
Compiling - Win - GNU Compiler
Hi, I went in big trouble compiling Flac (Windows). With configure (msys and mingw32-make 4.5.2) I didn't have success to compile. Makefile.lite the same. I used also the patches for SIZE_T_MAX UINT_MAX . Then I could compile every (!) project in flac with MSVC 2008 and I got all libraries, *.dll and *.exe. The libraries are passing all test-programs. With my own tools I see the *.dlls inside are working. So I tried to compile "examples\cpp\decode\file\main.cpp" and "examples\...
2017 Aug 10
3
[PATCH v2 0/2] virtio_scsi: Set can_queue based on size of virtqueue.
v1 was here: https://lkml.org/lkml/2017/8/10/689 v1 -> v2: Remove .can_queue field from the templates. Rich.
2017 Aug 10
3
[PATCH v2 0/2] virtio_scsi: Set can_queue based on size of virtqueue.
v1 was here: https://lkml.org/lkml/2017/8/10/689 v1 -> v2: Remove .can_queue field from the templates. Rich.
2013 Apr 06
2
Circular preprocessor define with MSVC
...if So, if we are on MSVC and have neither SIZE_MAX nor SIZE_T_MAX, we'll define SIZE_T_MAX to mean SIZE_MAX and SIZE_MAX to mean SIZE_T_MAX. I'm afraid this won't work ... It is like this since commit a4c321e, before that it used to say: ... # ifdef _MSC_VER # define SIZE_T_MAX UINT_MAX /* What happens on 64 bit windows? */ ... I can't offer a patch because I don't know much about MSVC or Windows 64 bit, but some kind of fix is obviously needed. Additional random issue I happened to notice: There is no git tag for 1.3.0pre3, the latest is 1.3.0pre2. Ulrich
2010 Mar 06
1
ssh-keyscan bug (not really exploitable)
...bably impossible to exploit, though, if only because ssh-keyscan is not usually run on very large untrusted input files. ssh-keyscan uses an fgets() wrapper that uses an unsigned int to keep track of the length of a buffer holding the current line. On machines with sufficient address space to hold UINT_MAX / 2 bytes, e.g. amd64, one can fill those bytes. The next call will be realloc(buf, 0), which free()s the buffer and returns a non-NULL zero-size chunk of memory. The program will then try to write to some point in memory about UINT_MAX / 2 past this newly-returned chunk. Test case: $ while true;...
2017 Apr 20
2
Unsigned Bitwise Shift for Bit-field Structure
...ith zeros. If E1 has an unsigned type, the value of the result is E1 × 2^E2, reduced modulo one more than the maximum value representable in the result type. So if unsigned b = 0x80000000; unsigned a = b << 1; a will equal to 0 because a = (b << 1) mod (1<<32); (1<< 32) is UINT_MAX+1 For the bit-field structure defined as struct foo { unsigned long long b:40; } x; According to C99 6.7.2.1 A bit-field is interpreted as a signed or unsigned integer type consisting of the specified number of bits. So the x.b will treat as 40 bit unsigned integer and it should follow 6.5.7.4....
2017 Jan 02
2
Indices for extractvalue and insertvalue
Hi Can someone explain to me why we cant use uint64_t for extractvalue and insertvalue indices, while GEP on arrays can have indices of any integer type. Basically if I load an array with UINT_MAX+O (O>=2) elements, I can not extract its last element. Given this restriction I feel we have a bug here (uint64_t is passed as a unsigned). This cant happen because of the if (NumElements > 1024) guard, but its a bug anyways. https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/In...
2017 May 10
4
-speculative-execution moving load before store
...that read memory; /// for such instructions, moving them may change the resulting value. And that is indeed the case in PR32964. How is this supposed to work? I started seeing this after the commit SpeculativeExecution: Stop using whitelist for costs Before that, e.g. a load got the cost UINT_MAX which I suppose disabled hoisting, but since the commit TTI.getUserCost(I) is used for all instructions. Regards, Mikael
2017 Jul 12
2
[PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG
...> --- a/include/linux/virtio.h > +++ b/include/linux/virtio.h > @@ -57,8 +57,28 @@ int virtqueue_add_sgs(struct virtqueue *vq, > void *data, > gfp_t gfp); > > +/* A desc with this init id is treated as an invalid desc */ > +#define VIRTQUEUE_DESC_ID_INIT UINT_MAX > +int virtqueue_add_chain_desc(struct virtqueue *_vq, > + uint64_t addr, > + uint32_t len, > + unsigned int *head_id, > + unsigned int *prev_id, > + bool in); > + > +int virtqueue_add_chain(struct virtqueue *_vq, > + unsigned int head...
2017 Jul 12
2
[PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG
...> --- a/include/linux/virtio.h > +++ b/include/linux/virtio.h > @@ -57,8 +57,28 @@ int virtqueue_add_sgs(struct virtqueue *vq, > void *data, > gfp_t gfp); > > +/* A desc with this init id is treated as an invalid desc */ > +#define VIRTQUEUE_DESC_ID_INIT UINT_MAX > +int virtqueue_add_chain_desc(struct virtqueue *_vq, > + uint64_t addr, > + uint32_t len, > + unsigned int *head_id, > + unsigned int *prev_id, > + bool in); > + > +int virtqueue_add_chain(struct virtqueue *_vq, > + unsigned int head...