Commit e52e97f
statmount: let unset strings be empty
Just like it's normal for unset values to be zero, unset strings should be
empty instead of containing random values.
It seems to be a typical mistake that the mask returned by statmount is not
checked, which can result in various bugs.
With this fix, these bugs are prevented, since it is highly likely that
userspace would just want to turn the missing mask case into an empty
string anyway (most of the recently found cases are of this type).
Link: https://lore.kernel.org/all/CAJfpegsVCPfCn2DpM8iiYSS5DpMsLB8QBUCHecoj6s0Vxf4jzg@mail.gmail.com/
Fixes: 68385d7 ("statmount: simplify string option retrieval")
Fixes: 46eae99 ("add statmount(2) syscall")
Cc: [email protected] # v6.8
Signed-off-by: Miklos Szeredi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>1 parent 4e74872 commit e52e97f
1 file changed
+16
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5191 | 5191 | | |
5192 | 5192 | | |
5193 | 5193 | | |
5194 | | - | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
5195 | 5201 | | |
5196 | 5202 | | |
5197 | 5203 | | |
5198 | | - | |
| 5204 | + | |
5199 | 5205 | | |
5200 | 5206 | | |
5201 | 5207 | | |
5202 | | - | |
| 5208 | + | |
5203 | 5209 | | |
5204 | 5210 | | |
5205 | 5211 | | |
5206 | | - | |
| 5212 | + | |
5207 | 5213 | | |
5208 | 5214 | | |
5209 | 5215 | | |
5210 | | - | |
| 5216 | + | |
5211 | 5217 | | |
5212 | 5218 | | |
5213 | 5219 | | |
5214 | | - | |
| 5220 | + | |
5215 | 5221 | | |
5216 | 5222 | | |
5217 | 5223 | | |
5218 | | - | |
| 5224 | + | |
5219 | 5225 | | |
5220 | 5226 | | |
5221 | 5227 | | |
5222 | | - | |
| 5228 | + | |
5223 | 5229 | | |
5224 | 5230 | | |
5225 | 5231 | | |
5226 | | - | |
| 5232 | + | |
5227 | 5233 | | |
5228 | 5234 | | |
5229 | 5235 | | |
| |||
5251 | 5257 | | |
5252 | 5258 | | |
5253 | 5259 | | |
| 5260 | + | |
5254 | 5261 | | |
5255 | 5262 | | |
5256 | 5263 | | |
| |||
0 commit comments