-
Notifications
You must be signed in to change notification settings - Fork 122
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
RHEL 8.9 nullptr dereference #377
Closed
AlexScherba16
wants to merge
7
commits into
datto:main
from
AlexScherba16:rhel8_9_nullptr_dereference
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
65a13d8
Use dattobd_blkdev_by_path wrapper
AlexScherba16 ce54bad
Use dattobd_get/drop_super wrapper
AlexScherba16 2e0f0c2
Use dattobd_blkdev_put wrapper
AlexScherba16 6afcdc8
Use snap_open/release with gendisk and blk_mode type
AlexScherba16 2491b75
Use has_submit_bio in block device
AlexScherba16 b64bfac
Use non-idmapped mount idmap
AlexScherba16 3ef2367
Use snap device in cow manager initialization
AlexScherba16 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
/* | ||
* Copyright (C) 2024 Datto Inc. | ||
*/ | ||
|
||
#include "includes.h" | ||
|
||
MODULE_LICENSE("GPL"); | ||
|
||
static inline void dummy(void){ | ||
struct block_device* bd; | ||
bd->bd_has_submit_bio=false; | ||
} |
30 changes: 30 additions & 0 deletions
30
src/configure-tests/feature-tests/bdops_open_with_blk_mode.c
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
/* | ||
* Copyright (C) 2024 Datto Inc. | ||
*/ | ||
|
||
#include "includes.h" | ||
|
||
MODULE_LICENSE("GPL"); | ||
|
||
static int snap_open(struct gendisk *gd, blk_mode_t mode){ | ||
(void)gd; | ||
(void)mode; | ||
return 0; | ||
} | ||
|
||
static void snap_release(struct gendisk *gd){ | ||
(void)gd; | ||
} | ||
|
||
static inline void dummy(void){ | ||
struct gendisk gd; | ||
struct block_device_operations bdo = { | ||
.open = snap_open, | ||
.release = snap_release, | ||
}; | ||
|
||
bdo.open(&gd, FMODE_READ); | ||
bdo.release(&gd); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
/* | ||
* Copyright (C) 2024 Datto Inc. | ||
*/ | ||
|
||
#include "includes.h" | ||
|
||
MODULE_LICENSE("GPL"); | ||
|
||
static inline void dummy(void){ | ||
struct block_device *bd = blkdev_get_by_path("path", FMODE_READ, NULL, NULL); | ||
bd = NULL; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
/* | ||
* Copyright (C) 2024 Datto Inc. | ||
*/ | ||
|
||
#include "includes.h" | ||
|
||
MODULE_LICENSE("GPL"); | ||
|
||
static inline void dummy(void){ | ||
struct block_device dev; | ||
void* info; | ||
blkdev_put(&dev,info); | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
/* | ||
* Copyright (C) 2024 Datto Inc. | ||
*/ | ||
|
||
#include "includes.h" | ||
|
||
MODULE_LICENSE("GPL"); | ||
|
||
static inline void dummy(void){ | ||
struct block_device bdev; | ||
get_super(&bdev); | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls simplify to #if defined HAVE_GET_SUPER return drop_super(sb) #endif return;