-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use flexible array members #3411
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for dynamically sized trailing elements in a structure. See [here](https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays) for more information on this. Closes: #3366 Signed-off-by: black-dragon74 <niryadav@redhat.com>
Note: This code was a part of initial DHT commit (5dc7cbf), a bit of history there :) Signed-off-by: black-dragon74 <niryadav@redhat.com>
/run regression |
1 similar comment
/run regression |
Can we please merge this PR? |
mohit84
approved these changes
Apr 28, 2022
jengelh
added a commit
to jengelh/glusterfs
that referenced
this pull request
Jul 5, 2023
==4418==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x613000000190 at pc 0x7f028cd2341c bp 0x7ffd9c5ba7e0 sp 0x7ffd9c5ba7d8 WRITE of size 8 at 0x613000000190 thread T0 f0 in mem_get_pool_list ~/libglusterfs/src/mem-pool.c:786 0x613000000190 is located 0 bytes after 336-byte region [0x613000000040,0x613000000190) allocated by thread T0 here: f0 in malloc (/usr/lib64/libasan.so.8+0xdc04f) (BuildId: 44194dcf14c212b57346030492309d59d5379ae1) f1 in __gf_default_malloc glusterfs/mem-pool.h:112 f2 in mem_get_pool_list ~/libglusterfs/src/mem-pool.c:778 ``NPOOLS-1`` is just wrong. ``per_thread_pool_list_t`` does not include one free ``per_thread_pool_t``. Fixes: gluster#4192 Fixes: v11dev-211-g1cfff6e6ec ("Use flexible array members (gluster#3411)") Signed-off-by: Jan Engelhardt <jengelh@inai.de>
jengelh
added a commit
to jengelh/glusterfs
that referenced
this pull request
Mar 20, 2024
==4418==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x613000000190 at pc 0x7f028cd2341c bp 0x7ffd9c5ba7e0 sp 0x7ffd9c5ba7d8 WRITE of size 8 at 0x613000000190 thread T0 f0 in mem_get_pool_list ~/libglusterfs/src/mem-pool.c:786 0x613000000190 is located 0 bytes after 336-byte region [0x613000000040,0x613000000190) allocated by thread T0 here: f0 in malloc (/usr/lib64/libasan.so.8+0xdc04f) (BuildId: 44194dcf14c212b57346030492309d59d5379ae1) f1 in __gf_default_malloc glusterfs/mem-pool.h:112 f2 in mem_get_pool_list ~/libglusterfs/src/mem-pool.c:778 ``NPOOLS-1`` is just wrong. ``per_thread_pool_list_t`` does not include one free ``per_thread_pool_t``. Fixes: gluster#4192 Fixes: v11dev-211-g1cfff6e6ec ("Use flexible array members (gluster#3411)") Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
for dynamically sized trailing elements in a structure. See here for more information on this.
Closes: #3366
Signed-off-by: black-dragon74 niryadav@redhat.com