Most of this patch series has already been pushed upstream, this is just
the second half of the patch series that has not been pushed yet + some
additional changes which were required to implement changes requested by
the mailing list. This patch series is originally from Asahi, previously
posted by Daniel Almeida.
The previous version of the patch series can be found here:
https://patchwork.freedesktop.org/series/164580/
Branch with patches applied available here:
https://gitlab.freedesktop.org/lyudess/linux/-/commits/rust/gem-shmem
This patch series applies on top of drm-rust-next
Patch-series wide changes since V15:
* Fix some major rebasing errors I somehow didn't notice :(
* Drop the dependency on LazyInit, use the trick that Alice suggested
instead.
* Fix dependency ordering so that Tyr can get the vmap stuff first
without the other bits.
Patch-series wide changes since V16:
* Fix ordering one more time (SetOnce::reset() doesn't need to come
before adding vmap functions)
* Rebase against the latest DeviceContext changes from me that got
pushed.
Lyude Paul (6):
rust: drm: gem: shmem: Fix Default implementation for ObjectConfig
rust: drm: gem: shmem: Add DmaResvGuard helper
rust: drm: gem: shmem: Add vmap functions
rust: faux: Allow retrieving a bound Device
rust: sync: Add SetOnce::reset()
rust: drm: gem: Introduce shmem::Object::sg_table()
rust/kernel/drm/gem/shmem.rs | 518 ++++++++++++++++++++++++++++++++++-
rust/kernel/faux.rs | 7 +-
rust/kernel/sync/set_once.rs | 60 +++-
3 files changed, 563 insertions(+), 22 deletions(-)
base-commit: 723bd79ca9e492cc91850094a2892bde0345c51a
--
2.54.0
Hi,
On Mon, Oct 23, 2023 at 10:25:50AM -0700, Doug Anderson wrote:
> On Mon, Oct 23, 2023 at 9:31 AM Yuran Pereira <yuran.pereira(a)hotmail.com> wrote:
> >
> > Since "Clean up checks for already prepared/enabled in panels" has
> > already been done and merged [1], I think there is no longer a need
> > for this item to be in the gpu TODO.
> >
> > [1] https://patchwork.freedesktop.org/patch/551421/
> >
> > Signed-off-by: Yuran Pereira <yuran.pereira(a)hotmail.com>
> > ---
> > Documentation/gpu/todo.rst | 25 -------------------------
> > 1 file changed, 25 deletions(-)
>
> It's not actually all done. It's in a bit of a limbo state right now,
> unfortunately. I landed all of the "simple" cases where panels were
> needlessly tracking prepare/enable, but the less simple cases are
> still outstanding.
>
> Specifically the issue is that many panels have code to properly power
> cycle themselves off at shutdown time and in order to do that they
> need to keep track of the prepare/enable state. After a big, long
> discussion [1] it was decided that we could get rid of all the panel
> code handling shutdown if only all relevant DRM KMS drivers would
> properly call drm_atomic_helper_shutdown().
>
> I made an attempt to get DRM KMS drivers to call
> drm_atomic_helper_shutdown() [2] [3] [4]. I was able to land the
> patches that went through drm-misc, but currently many of the
> non-drm-misc ones are blocked waiting for attention.
>
> ...so things that could be done to help out:
>
> a) Could review patches that haven't landed in [4]. Maybe adding a
> Reviewed-by tag would help wake up maintainers?
>
> b) Could see if you can identify panels that are exclusively used w/
> DRM drivers that have already been converted and then we could post
> patches for just those panels. I have no idea how easy this task would
> be. Is it enough to look at upstream dts files by "compatible" string?
I think it is, yes.
Maxime
Feeling the need for speed and a bit of winter fun, even when the weather outside is frightful? Then maybe it’s time to check out Snow Rider 3D. This simple but surprisingly addictive game offers a thrill of downhill skiing and snowboarding right from your browser, no downloads required. Let’s break down how to jump in and start enjoying this surprisingly engaging title.
https://snowriderfree.com/
Gameplay: Simple Controls, Endless Possibilities
The core gameplay of Snow Rider 3D is deceptively straightforward. You control your character's direction using the left and right arrow keys (or A and D). Your objective? Navigate through a series of procedurally generated slopes littered with obstacles. These obstacles range from simple ramps and rails to more challenging hazards like trees, snowdrifts, and even abandoned shacks.
The beauty of Snow Rider 3D lies in its physics. While simple, they feel surprisingly realistic. You'll need to anticipate turns, adjust your speed, and time your jumps to successfully navigate the terrain. A crash will reset you to the beginning of the course, so precision and patience are key.
The game offers different levels, each presenting a unique challenge. Some focus on speed and long jumps, while others demand skillful maneuvering through tight spaces. As you progress, you unlock new skins and sleds, adding a touch of customization to your experience. Think of it as a casual time-killer that can quickly turn into an hour-long obsession!
Tips for Mastering the Mountain:
Alright, so you're ready to hit the slopes. Here are a few tips to help you improve your runs and avoid those frustrating wipeouts:
Practice Makes Perfect: Don't get discouraged by early crashes. The more you play, the better you'll understand the physics and learn to anticipate the terrain.
Master the Turns: Smooth, controlled turns are essential for maintaining speed and avoiding obstacles. Practice feathering the arrow keys to make subtle adjustments.
Timing is Everything: When approaching jumps and ramps, pay close attention to your speed and angle. A well-timed jump can make all the difference.
Don't Be Afraid to Slow Down: Sometimes, the fastest route isn't the safest. Don't be afraid to ease off the gas and navigate tricky sections with caution. Consider looking up guides for specific levels of Snow Rider 3D at websites like Snow Rider 3D if you’re really struggling.
Experiment with Sleds and Skins: Different sleds may offer slight variations in handling. Try out different options to find one that suits your playstyle.
Conclusion: A Fun and Accessible Winter Escape
Snow Rider 3D is a surprisingly addictive and accessible game that’s perfect for a quick dose of winter fun. It's simple controls and challenging gameplay make it easy to pick up and play, while its procedural generation ensures that each run is a unique experience. So, whether you're looking for a casual time-killer or a challenging skill-based game, Snow Rider 3D is definitely worth checking out.
College life is often seen as an exciting phase filled with new experiences, independence, friendships, and opportunities. However, behind the social events and academic growth, many students also face stress, anxiety, loneliness, and pressure to perform well. Managing mental health during this time is just as important as achieving good grades, because emotional well-being directly impacts concentration, productivity, and overall success. Learning how to take care of your mental health can help students handle challenges more effectively and enjoy a more balanced college experience.
Many students struggle to keep up with assignments, deadlines, and academic expectations, which can sometimes feel overwhelming. In such situations, academic support services like pay for someone to <a href="https://myassignmenthelp.com/ca/do-my-homework.html">do my homework online</a> from MyAssignmentHelp can help reduce academic pressure and allow students to focus on maintaining better mental and emotional well-being alongside their studies.
Understanding Mental Health in College Life
Mental health refers to a person’s emotional, psychological, and social well-being. In college, students go through major life transitions—moving away from home, adapting to new environments, managing finances, and handling academic responsibilities. All of these changes can affect mental stability.
It is normal to feel stressed occasionally, but prolonged stress or emotional exhaustion should not be ignored. Recognizing early signs such as fatigue, loss of motivation, irritability, or difficulty concentrating is important for taking timely action.
Maintain a Balanced Routine
One of the most effective ways to support mental health is by maintaining a balanced daily routine. A structured lifestyle helps reduce chaos and creates a sense of stability.
Students should try to:
Follow a consistent sleep schedule
Allocate time for study and relaxation
Avoid last-minute cramming
Include breaks between study sessions
Set realistic daily goals
A balanced routine helps prevent burnout and ensures that students do not feel overwhelmed by academic pressure.
Prioritize Sleep and Rest
Sleep plays a crucial role in mental health. Lack of sleep can increase stress levels, reduce concentration, and negatively impact memory.
College students often sacrifice sleep to complete assignments or prepare for exams, but this habit can be harmful in the long run. Ideally, students should aim for 7–9 hours of quality sleep each night.
Creating a bedtime routine, limiting screen time before sleep, and avoiding caffeine late in the day can significantly improve sleep quality.
Stay Physically Active
Physical activity is not just good for the body but also essential for mental well-being. Exercise releases endorphins, which are natural mood boosters.
Students do not need intense workouts to benefit from physical activity. Simple habits like walking, cycling, yoga, or light stretching can make a big difference.
Regular exercise helps:
Reduce stress and anxiety
Improve focus and concentration
Boost energy levels
Enhance overall mood
Even 20–30 minutes of activity a day can have noticeable positive effects.
Build Strong Social Connections
Social support is one of the most important factors in maintaining good mental health. College is a great place to build friendships and connections that provide emotional support.
Students should try to:
Spend time with supportive friends
Participate in group activities
Join clubs or student organizations
Talk openly about feelings when needed
Having people to talk to can reduce feelings of loneliness and help students cope better with stress.
Learn Stress Management Techniques
Stress is unavoidable in college, but it can be managed effectively with the right techniques.
Some helpful stress management strategies include:
Deep breathing exercises
Meditation and mindfulness practices
Journaling thoughts and emotions
Listening to calming music
Taking short breaks during study sessions
These techniques help calm the mind and improve emotional balance.
Avoid Overloading Yourself
Many students try to take on too many responsibilities at once—academics, part-time jobs, extracurricular activities, and social commitments. While involvement is important, overloading can lead to burnout.
Learning to say no when necessary is a healthy habit. Students should prioritize tasks based on importance and avoid unnecessary pressure.
It is better to do a few things well than to do everything poorly due to exhaustion.
Seek Help When Needed
One of the most important aspects of mental health is recognizing when help is needed. Unfortunately, many students hesitate to seek support due to stigma or fear of judgment.
However, asking for help is a sign of strength, not weakness. Support can come from:
Friends and family
College counselors
Mentors or professors
Mental health professionals
Talking about problems can provide relief and open up solutions that may not be visible when dealing with stress alone.
Limit Social Media Usage
While social media helps students stay connected, excessive use can negatively affect mental health. Constant comparison with others, exposure to unrealistic lifestyles, and online pressure can increase anxiety and reduce self-esteem.
Students should:
Set time limits for social media use
Avoid comparing themselves to others
Take digital detox breaks
Focus on real-life interactions
Reducing screen time can improve focus, productivity, and emotional well-being.
Practice Self-Care Regularly
Self-care is essential for maintaining mental balance. It involves taking time to do activities that bring relaxation and happiness.
Self-care can include:
Reading a book
Watching a favorite show
Spending time in nature
Pursuing hobbies
Taking rest without guilt
Prioritizing self-care helps recharge the mind and improves resilience against stress.
Develop a Positive Mindset
A positive mindset plays a major role in mental health. College life comes with challenges, and setbacks are a normal part of the journey.
Instead of focusing on failures, students should:
Learn from mistakes
Celebrate small achievements
Stay hopeful during difficult times
Practice gratitude
Positive thinking helps build confidence and reduces emotional distress.
Maintain Academic Balance
Academic pressure is one of the biggest sources of stress for college students. Managing coursework effectively can significantly improve mental health.
Students should break tasks into smaller steps, avoid procrastination, and seek academic support when necessary. Staying organized can reduce last-minute stress and improve overall performance.
Conclusion
Mental health is a vital part of a successful and fulfilling college experience. Students who take care of their emotional well-being are more likely to perform better academically, build stronger relationships, and enjoy their college journey. By maintaining a balanced routine, staying physically active, managing stress, and seeking support when needed, students can create a healthier and more positive lifestyle. Remember, college is not just about academic achievement—it is also about growing as a person, and mental well-being
In case MMIO size is bigger than 4G and peer2peer DMA goes
through host bridge, we trigger a code path that assigns the
total linked IOVA (which is greater than 4G) to mapped_len.
Previously, `mapped_len` was declared as 32-bit `unsigned int`.
When accumulating `size_t` lengths, this leads to a silent wrap-around.
This truncation causes truncated lengths to be passed to functions
like `fill_sg_entry()`.
Fix this by changing `mapped_len` to `size_t` (64-bit). While
at it, fix similar potential overflow issues in `calc_sg_nents`
by using `size_t` for `nents` and checking against `UINT_MAX`
and using `unsigned int` for the loop iterator in `fill_sg_entry`
to match.
Fixes: 3aa31a8bb11e ("dma-buf: provide phys_vec to scatter-gather mapping routine")
Cc: stable(a)vger.kernel.org
Cc: iommu(a)lists.linux.dev
Reviewed-by: Pranjal Shrivastava <praan(a)google.com>
Signed-off-by: David Hu <xuehaohu(a)google.com>
---
Changes in v5:
- Removed WARN_ON_ONCE from calc_sg_nents() to avoid log noise (Jason).
- Added explicit check for `!nents` in dma_buf_phys_vec_to_sgt() to
cleanly return -EINVAL on overflow (Jason).
Changes in v4:
- Added WARN_ON_ONCE() to the nents overflow check to prevent silent
failures (Claude Bot).
Changes in v3:
- Removed leftover sentence fragment from the commit message.
- Kept `nents = 0` initialization (previously stated as removed in the
v2 changelog) as it is strictly required for the `+=` accumulation
loop in `calc_sg_nents()`.
Changes in v2:
- Fixed 'IVOA' -> 'IOVA' typo and expanded commit message (Claude Bot).
- Added Reverse Xmas tree formatting (Pranjal).
- Folded in extra bounds checking for calc_sg_nents() (Pranjal).
- Folded in type consistency fix for fill_sg_entry() (Pranjal).
drivers/dma-buf/dma-buf-mapping.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/dma-buf/dma-buf-mapping.c b/drivers/dma-buf/dma-buf-mapping.c
index 794acff2546a..607b7998463d 100644
--- a/drivers/dma-buf/dma-buf-mapping.c
+++ b/drivers/dma-buf/dma-buf-mapping.c
@@ -10,7 +10,7 @@ static struct scatterlist *fill_sg_entry(struct scatterlist *sgl, size_t length,
dma_addr_t addr)
{
unsigned int len, nents;
- int i;
+ unsigned int i;
nents = DIV_ROUND_UP(length, UINT_MAX);
for (i = 0; i < nents; i++) {
@@ -36,7 +36,7 @@ static unsigned int calc_sg_nents(struct dma_iova_state *state,
struct phys_vec *phys_vec, size_t nr_ranges,
size_t size)
{
- unsigned int nents = 0;
+ size_t nents = 0;
size_t i;
if (!state || !dma_use_iova(state)) {
@@ -51,6 +51,9 @@ static unsigned int calc_sg_nents(struct dma_iova_state *state,
nents = DIV_ROUND_UP(size, UINT_MAX);
}
+ if (nents > UINT_MAX)
+ return 0;
+
return nents;
}
@@ -95,9 +98,10 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach,
size_t nr_ranges, size_t size,
enum dma_data_direction dir)
{
- unsigned int nents, mapped_len = 0;
struct dma_buf_dma *dma;
struct scatterlist *sgl;
+ size_t mapped_len = 0;
+ unsigned int nents;
dma_addr_t addr;
size_t i;
int ret;
@@ -133,6 +137,11 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach,
}
nents = calc_sg_nents(dma->state, phys_vec, nr_ranges, size);
+ if (!nents) {
+ ret = -EINVAL;
+ goto err_free_state;
+ }
+
ret = sg_alloc_table(&dma->sgt, nents, GFP_KERNEL | __GFP_ZERO);
if (ret)
goto err_free_state;
--
2.54.0.929.g9b7fa37559-goog
On Wed, 3 Jun 2026 21:43:05 -0300
Daniel Almeida <dwlsalmeida(a)gmail.com> wrote:
> > On 3 Jun 2026, at 14:14, Boris Brezillon <boris.brezillon(a)collabora.com> wrote:
> >
> > On Wed, 3 Jun 2026 13:41:02 -0300
> > Daniel Almeida <dwlsalmeida(a)gmail.com> wrote:
> >
> >>> + /// Called when the fence is signaled.
> >>> + ///
> >>> + /// This is called from the fence signaling path, which may be in interrupt
> >>> + /// context or with locks held, which is why `self` is only borrowed, so that
> >>> + /// it cannot drop. Implementations must not sleep or perform
> >>> + /// long-running operations.
> >>> + ///
> >>> + /// An implementation likely wants to inform itself (e.g., through a work item)
> >>> + /// within this callback that the associated [`FenceCbRegistration`] can now be
> >>> + /// dropped.
> >>> + fn called(&mut self);
> >>
> >> This is a central point. We ideally would want this to consume self, because we
> >> may want to move things out of the callback.
> >
> > This one comes from me. The rationale being that ::called() is called
> > from an atomic context, and the resources attached to the callback data
> > might require acquiring other sleeping locks to be released, and
> > sometimes you don't even notice immediately because said resources are
> > refcounted, and the lock is only acquired when you happen to be the
> > last owner. Yes, those can be caught at runtime if the C side is
> > properly annotated with might_sleep(), but that's not always the case.
> >
> > If we defer the drop of the data only when the FenceCb is
> > dropped/recycled, we're at least not constrained by this "runs in
> > atomic context" thing.
> >
>
> This design does not solve it, because one can quite trivially get around this
> restriction using Option<T> as I said. If your point is “don’t run any drop() here”,
> then &mut self doesn’t do it.
My bad, I thought you were talking about some Option<T> in
FenceCbRegistration<T> (there was one at some point, but it's gone now),
but you're talking about having an Option<X> inside the T. Yes, there's
indeed nothing preventing a drop on X in that path, and it's just as
bad as passing the fence back as value to the callback in that case.
>
> >>
> >> Consider a fence design where signal() consumes self. Now consider this:
> >>
> >> ```
> >> impl FenceCb for MyCallback {
> >> fn called(&mut self) {
> >> // Can't move the fence out, so we have to put an Option<T> just to be able
> >> // to move.
> >> if let Some(f) = self.some_fence.take() {
> >> f.signal();
> >> }
> >> }
> >> ```
> >>
> >> This used to be the case when our version of the job queue used the "proxy
> >> fence" design:
> >>
> >>
> >> ```
> >> // Callback on the hw fence
> >> impl FenceCb for MyCallback {
> >> fn called(&mut self) {
> >> if let Some(f) = self.submit_fence.take() {
> >> f.signal();
> >> }
> >
> > I'm pretty sure lockdep won't like it anyway, because this is nested
> > locking of the same lock class. For such proxies, we'll need to teach
> > lockdep about the nesting like has been recently done on
> > dma_fence_array & co. But I'm digressing.
>
> Yeah, but this is more about resource transfer in general, not
> this pattern specifically.
>
> I agree that this has issues, and yes, lockdep complained back
> then :)
The thing is, there's so many aspects that could go wrong because of the
context this callback is called in. Nested locking is one of them,
the fact we can't sleep is another. And with rust it's even worse,
because of the implicit drops that will happen when you take ownership
of resources (taking sleeping locks to remove resources from a dataset
for instance).
So, by passing self by value to the ::callback(), you're basically
telling users "hey, BTW, don't forget to defer the drop to some
workqueue if you think it's not atomic-safe". And how can users know
that the thing they're about to drop can be dropped in atomic context?
They basically have to audit the ::drop() of all the resources they
embed in their type implementing FenceCb. Not only that, but they also
have to design the thing so the deferral of this ::drop() doesn't
allocate, because, obviously, allocating in atomic context is
tricky/fallible. AFAIK, none of this can be spot at compile-time (I
remember Gary/Danilo mentioning that we could teach the klint about
some of these rules). This would leave us with runtime checks like
might_sleep(), but most of the C putters (xxx_put(object)) don't have
might_sleep() in the path where the decref doesn't lead to a refcnt=0
situation.
TLDR; Call this PTSD if you want, but this is the sort of bugs I
struggled with on the C side, and I can predict that the exact same
will happen in rust drivers if we expose the FenceCb as it is designed
here and we don't have a way to check the soundness of the FenceCb
implementations at compile time.
The other option (the one I've been advocating for from the start), is
to not let drivers implement FenceCb (make it private), but instead
have a bunch of implementations that we know are safe. Here's a list of
implementations that I think would unblock most of the drivers use
cases:
- wakeup a thread
- complete a completion object
- schedule a WorkItem
- schedule a kthread_worker (once we get a proper rust abstraction for
that)
It doesn't mean we can't have optimized FenceCb implementations that do
a lot more in the callback() path instead of deferring to a
workqueue/thread, but at least those would have to be implemented in
dma_fence.rs, and the dma_fence.rs maintainers can then carefully audit
the code as part of the review process, which we know is not really the
case when changes touch drivers code only.
FWIW, I think the FenceProxy design you were describing falls into
this "must be carefully audited" bucket, and should be implemented in
dma_fence.rs.
>
> >
> >> }
> >> ```
> >>
> >> Although this is not the case anymore, since we phased out this design given
> >> Christian's recent work. Still, we should ideally not require Option<T> here in
> >> general just to make resource transfer possible.
> >
> > I see. OTOH, don't we need to make this inner data movable if we want
> > to cancel the FenceCb before the fence is signaled anyway? And that's
> > most certainly a case we have in the teardown path.
>
> Can you expand a bit on what you mean here?
Never mind, I was confusing two different iterations of the code here.
I thought the Option<T> you were mentioning was in
FenceCbRegistration<T>, with some explicit ::cancel() function that
would return Option<T> so the user can get its resources back when it
cancels the registration, and also know whether the callback was called
or not. But this is all gone now, and all we can do is drop the
registration, which will automatically drop the inner T.
In a world brimming with complex video games and immersive online experiences, sometimes the most satisfying entertainment comes from a simple yet brilliant word puzzle. The Connections Game, a daily online brain-teaser, offers just that – a delightful challenge that tests your vocabulary, logic, and lateral thinking. If you’re looking for a fresh way to engage your mind and expand your word association skills, then stepping into the world of Connections Game is a fantastic choice.
https://connectionsgamefree.com
What is Connections Game?
At its heart, Connections is a game about finding hidden relationships between words. Each day, you're presented with 16 seemingly disparate words. Your task is to group these words into four sets of four, with each set sharing a common thread or category. The categories can be anything from "Types of Fruit" to "Words that Rhyme with 'Blue'" or even more abstract connections that require a bit of outside-the-box thinking. The beauty of the game lies in its simplicity and the sheer satisfaction of uncovering those clever links. You can experience it firsthand at Connections Game.
The Gameplay Unpacked
When you open the game, you'll see all 16 words laid out before you. To play, you simply click on four words you believe belong together. Once you’ve selected your quartet, you hit the "Submit" button.
Correct Guess: If your four words form a valid category, they will disappear, and the category will be revealed. You'll then move on to the remaining words.
Incorrect Guess: If your guess is wrong, the words will remain on the board, and you'll lose one of your four allowed mistakes. That's right – you only get four incorrect attempts before the game ends! This adds a delicious layer of pressure and strategic thinking.
The categories are color-coded, ranging from "Yellow" (easiest) to "Purple" (most difficult/obscure). Often, the trickiest part is recognizing "red herrings" – words that seem to fit into multiple categories, making you second-guess your initial assumptions.
Tips for Success
To truly master the Connections Game, here are a few friendly tips:
Read All the Words First: Before clicking anything, take a moment to scan all 16 words. Look for obvious groupings first. Are there any four words that immediately jump out as being related?
Look for Obvious Categories: Sometimes, one or two categories will be relatively straightforward. Tackling these first can clear up the board and make the remaining words easier to analyze.
Consider Different Meanings: Many words have multiple meanings. Don't get stuck on just one interpretation. For example, "bat" could refer to a flying mammal or a piece of sports equipment.
Think About Wordplay and Sounds: Categories aren't always about literal definitions. They can involve synonyms, antonyms, rhyming words, or even words that form a phrase when combined.
Utilize Your Mistakes Wisely: Remember, you only have four chances. If you’re unsure, it’s often better to hold off on a guess until you have a stronger conviction. Sometimes, eliminating other categories can clarify ambiguous words.
Don't Be Afraid to Rearrange: Mentally (or even physically, if you're playing on a device that allows it) rearrange the words. Seeing them in a different order can sometimes spark new connections.
Conclusion
The Connections Game is more than just a pastime; it's a daily brain workout that's both challenging and incredibly rewarding. It encourages you to think critically, expand your vocabulary, and see the intricate relationships between words. Whether you're a seasoned wordsmith or just looking for a fun new way to pass the time, give it a try – you might just find your new favorite daily ritual! You can access the game daily at Connections Game.
This began as a one-line dma-buf fix for a path_noexec() warning added
by commit 1e7ab6f67824 ("anon_inode: rework assertions"). Christoph
pointed out that the fix belongs higher up: a pseudo filesystem has no
reason not to set SB_I_NOEXEC by default. This series does that.
* Patch 1 sets both flags in init_pseudo(), so every pseudo
filesystem gets them. This is the only patch that changes a flag,
and the only one with Fixes:/Cc: stable.
* Patch 2 drops the assignments that are now redundant in the callers
that set them by hand.
Most callers already set one or both flags. I audited every
init_pseudo() caller. Here is what patch 1 actually changes for each.
The only visible effect is on dma-buf, where SB_I_NOEXEC silences the
warning. SB_I_NODEV is never consulted on these SB_NOUSER mounts, and
none of the callers that gain SB_I_NOEXEC are executed from.
caller had patch 1 adds
--------------------------- -------- --------------
fs/anon_inodes.c both nothing new
mm/secretmem.c both nothing new
virt/kvm/guest_memfd.c both nothing new
fs/nsfs.c both nothing new
fs/pidfs.c both nothing new
fs/aio.c NOEXEC NODEV
drivers/dma-buf/dma-buf.c neither NOEXEC + NODEV
net/socket.c neither NOEXEC + NODEV
fs/pipe.c neither NOEXEC + NODEV
kernel/resource.c neither NOEXEC + NODEV
fs/erofs/super.c neither NOEXEC + NODEV
fs/btrfs/tests/... neither NOEXEC + NODEV
drivers/vfio/vfio_main.c neither NOEXEC + NODEV
drivers/gpu/drm/drm_drv.c neither NOEXEC + NODEV
drivers/dax/super.c neither NOEXEC + NODEV
block/bdev.c neither NOEXEC + NODEV
John Hubbard (2):
libfs: set SB_I_NOEXEC and SB_I_NODEV by default in init_pseudo()
libfs: drop redundant SB_I_NOEXEC/SB_I_NODEV in init_pseudo() callers
fs/aio.c | 1 -
fs/anon_inodes.c | 2 --
fs/libfs.c | 1 +
fs/nsfs.c | 1 -
fs/pidfs.c | 2 --
mm/secretmem.c | 2 --
virt/kvm/guest_memfd.c | 2 --
7 files changed, 1 insertion(+), 10 deletions(-)
base-commit: ba3e43a9e601636f5edb54e259a74f96ca3b8fd8
--
2.54.0