diff options
author | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
commit | cb5629b10d64a8006622ce3a52bc887d91057d69 (patch) | |
tree | 7c06d8f30783115e3384721046258ce615b129c5 /drivers/char/tpm | |
parent | 8920d5ad6ba74ae8ab020e90cc4d976980e68701 (diff) | |
parent | f01d1d546abb2f4028b5299092f529eefb01253a (diff) |
Merge branch 'master' into next
Conflicts:
fs/namei.c
Manually merged per:
diff --cc fs/namei.c
index 734f2b5,bbc15c2..0000000
--- a/fs/namei.c
+++ b/fs/namei.c
@@@ -860,9 -848,8 +849,10 @@@ static int __link_path_walk(const char
nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
- err = vfs_permission(nd, MAY_EXEC);
+ err = inode_permission(nd->path.dentry->d_inode,
+ MAY_EXEC);
+ if (!err)
+ err = ima_path_check(&nd->path, MAY_EXEC);
if (err)
break;
@@@ -1525,14 -1506,9 +1509,14 @@@ int may_open(struct path *path, int acc
flag &= ~O_TRUNC;
}
- error = vfs_permission(nd, acc_mode);
+ error = inode_permission(inode, acc_mode);
if (error)
return error;
+
- error = ima_path_check(&nd->path,
++ error = ima_path_check(path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
+ if (error)
+ return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r-- | drivers/char/tpm/tpm_bios.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_nsc.c | 35 |
2 files changed, 22 insertions, 15 deletions
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index 68f052b42ed7..ed306eb1057f 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c | |||
@@ -23,8 +23,6 @@ | |||
23 | #include <linux/security.h> | 23 | #include <linux/security.h> |
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <acpi/acpi.h> | 25 | #include <acpi/acpi.h> |
26 | #include <acpi/actypes.h> | ||
27 | #include <acpi/actbl.h> | ||
28 | #include "tpm.h" | 26 | #include "tpm.h" |
29 | 27 | ||
30 | #define TCG_EVENT_NAME_LEN_MAX 255 | 28 | #define TCG_EVENT_NAME_LEN_MAX 255 |
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c index ab18c1e7b115..70efba2ee053 100644 --- a/drivers/char/tpm/tpm_nsc.c +++ b/drivers/char/tpm/tpm_nsc.c | |||
@@ -273,12 +273,23 @@ static void tpm_nsc_remove(struct device *dev) | |||
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | static struct device_driver nsc_drv = { | 276 | static int tpm_nsc_suspend(struct platform_device *dev, pm_message_t msg) |
277 | .name = "tpm_nsc", | 277 | { |
278 | .bus = &platform_bus_type, | 278 | return tpm_pm_suspend(&dev->dev, msg); |
279 | .owner = THIS_MODULE, | 279 | } |
280 | .suspend = tpm_pm_suspend, | 280 | |
281 | .resume = tpm_pm_resume, | 281 | static int tpm_nsc_resume(struct platform_device *dev) |
282 | { | ||
283 | return tpm_pm_resume(&dev->dev); | ||
284 | } | ||
285 | |||
286 | static struct platform_driver nsc_drv = { | ||
287 | .suspend = tpm_nsc_suspend, | ||
288 | .resume = tpm_nsc_resume, | ||
289 | .driver = { | ||
290 | .name = "tpm_nsc", | ||
291 | .owner = THIS_MODULE, | ||
292 | }, | ||
282 | }; | 293 | }; |
283 | 294 | ||
284 | static int __init init_nsc(void) | 295 | static int __init init_nsc(void) |
@@ -297,7 +308,7 @@ static int __init init_nsc(void) | |||
297 | return -ENODEV; | 308 | return -ENODEV; |
298 | } | 309 | } |
299 | 310 | ||
300 | err = driver_register(&nsc_drv); | 311 | err = platform_driver_register(&nsc_drv); |
301 | if (err) | 312 | if (err) |
302 | return err; | 313 | return err; |
303 | 314 | ||
@@ -308,17 +319,15 @@ static int __init init_nsc(void) | |||
308 | /* enable the DPM module */ | 319 | /* enable the DPM module */ |
309 | tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01); | 320 | tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01); |
310 | 321 | ||
311 | pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL); | 322 | pdev = platform_device_alloc("tpm_nscl0", -1); |
312 | if (!pdev) { | 323 | if (!pdev) { |
313 | rc = -ENOMEM; | 324 | rc = -ENOMEM; |
314 | goto err_unreg_drv; | 325 | goto err_unreg_drv; |
315 | } | 326 | } |
316 | 327 | ||
317 | pdev->name = "tpm_nscl0"; | ||
318 | pdev->id = -1; | ||
319 | pdev->num_resources = 0; | 328 | pdev->num_resources = 0; |
329 | pdev->dev.driver = &nsc_drv.driver; | ||
320 | pdev->dev.release = tpm_nsc_remove; | 330 | pdev->dev.release = tpm_nsc_remove; |
321 | pdev->dev.driver = &nsc_drv; | ||
322 | 331 | ||
323 | if ((rc = platform_device_register(pdev)) < 0) | 332 | if ((rc = platform_device_register(pdev)) < 0) |
324 | goto err_free_dev; | 333 | goto err_free_dev; |
@@ -377,7 +386,7 @@ err_unreg_dev: | |||
377 | err_free_dev: | 386 | err_free_dev: |
378 | kfree(pdev); | 387 | kfree(pdev); |
379 | err_unreg_drv: | 388 | err_unreg_drv: |
380 | driver_unregister(&nsc_drv); | 389 | platform_driver_unregister(&nsc_drv); |
381 | return rc; | 390 | return rc; |
382 | } | 391 | } |
383 | 392 | ||
@@ -390,7 +399,7 @@ static void __exit cleanup_nsc(void) | |||
390 | pdev = NULL; | 399 | pdev = NULL; |
391 | } | 400 | } |
392 | 401 | ||
393 | driver_unregister(&nsc_drv); | 402 | platform_driver_unregister(&nsc_drv); |
394 | } | 403 | } |
395 | 404 | ||
396 | module_init(init_nsc); | 405 | module_init(init_nsc); |