create a vdso in linux [on hold]











up vote
1
down vote

favorite
1












I'm currently trying to implement my own VDSO. I have seen this tutorial which explains how to do this.



However, this tutorial is made for Linux 2.6.x and I would like to use it on Linux 4.8.x. But the architectural structure of vdso changed a lot since this version (e.g. vextern.h has been suppressed) and I don't know how to adapt it to get it working.



Do you know how I could adapt this tutorial for a recent kernel or where I can find enough resources about vdso to implement my own?



Also, do you know whether I can simply recreate the behavior of an arbitrary syscall as a VDSO? I know it is a very bad idea from a security perspective (and the performance gain is negligible)










share|improve this question









New contributor




Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Rui F Ribeiro, Jeff Schaller, RalfFriedl, G-Man, Archemar yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Rui F Ribeiro, RalfFriedl, Archemar

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Thanks I learnt something new. However the phrase “the kernel is divided into two primary segments of memory: userland and kernel land.” is inept. This is as silly as saying that apples are divided into two groups: apples and oranges.
    – ctrl-alt-delor
    2 days ago















up vote
1
down vote

favorite
1












I'm currently trying to implement my own VDSO. I have seen this tutorial which explains how to do this.



However, this tutorial is made for Linux 2.6.x and I would like to use it on Linux 4.8.x. But the architectural structure of vdso changed a lot since this version (e.g. vextern.h has been suppressed) and I don't know how to adapt it to get it working.



Do you know how I could adapt this tutorial for a recent kernel or where I can find enough resources about vdso to implement my own?



Also, do you know whether I can simply recreate the behavior of an arbitrary syscall as a VDSO? I know it is a very bad idea from a security perspective (and the performance gain is negligible)










share|improve this question









New contributor




Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Rui F Ribeiro, Jeff Schaller, RalfFriedl, G-Man, Archemar yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Rui F Ribeiro, RalfFriedl, Archemar

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Thanks I learnt something new. However the phrase “the kernel is divided into two primary segments of memory: userland and kernel land.” is inept. This is as silly as saying that apples are divided into two groups: apples and oranges.
    – ctrl-alt-delor
    2 days ago













up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I'm currently trying to implement my own VDSO. I have seen this tutorial which explains how to do this.



However, this tutorial is made for Linux 2.6.x and I would like to use it on Linux 4.8.x. But the architectural structure of vdso changed a lot since this version (e.g. vextern.h has been suppressed) and I don't know how to adapt it to get it working.



Do you know how I could adapt this tutorial for a recent kernel or where I can find enough resources about vdso to implement my own?



Also, do you know whether I can simply recreate the behavior of an arbitrary syscall as a VDSO? I know it is a very bad idea from a security perspective (and the performance gain is negligible)










share|improve this question









New contributor




Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I'm currently trying to implement my own VDSO. I have seen this tutorial which explains how to do this.



However, this tutorial is made for Linux 2.6.x and I would like to use it on Linux 4.8.x. But the architectural structure of vdso changed a lot since this version (e.g. vextern.h has been suppressed) and I don't know how to adapt it to get it working.



Do you know how I could adapt this tutorial for a recent kernel or where I can find enough resources about vdso to implement my own?



Also, do you know whether I can simply recreate the behavior of an arbitrary syscall as a VDSO? I know it is a very bad idea from a security perspective (and the performance gain is negligible)







kernel linux-kernel compiling system-calls syscalls






share|improve this question









New contributor




Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









Rui F Ribeiro

38.2k1475123




38.2k1475123






New contributor




Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









Maxime B.

161




161




New contributor




Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Maxime B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as off-topic by Rui F Ribeiro, Jeff Schaller, RalfFriedl, G-Man, Archemar yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Rui F Ribeiro, RalfFriedl, Archemar

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by Rui F Ribeiro, Jeff Schaller, RalfFriedl, G-Man, Archemar yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Rui F Ribeiro, RalfFriedl, Archemar

If this question can be reworded to fit the rules in the help center, please edit the question.












  • Thanks I learnt something new. However the phrase “the kernel is divided into two primary segments of memory: userland and kernel land.” is inept. This is as silly as saying that apples are divided into two groups: apples and oranges.
    – ctrl-alt-delor
    2 days ago


















  • Thanks I learnt something new. However the phrase “the kernel is divided into two primary segments of memory: userland and kernel land.” is inept. This is as silly as saying that apples are divided into two groups: apples and oranges.
    – ctrl-alt-delor
    2 days ago
















Thanks I learnt something new. However the phrase “the kernel is divided into two primary segments of memory: userland and kernel land.” is inept. This is as silly as saying that apples are divided into two groups: apples and oranges.
– ctrl-alt-delor
2 days ago




Thanks I learnt something new. However the phrase “the kernel is divided into two primary segments of memory: userland and kernel land.” is inept. This is as silly as saying that apples are divided into two groups: apples and oranges.
– ctrl-alt-delor
2 days ago










1 Answer
1






active

oldest

votes

















up vote
1
down vote













I’m not sure there’s an updated tutorial in the same style, but the changes are limited:





  • arch/x86/vdso moved to arch/x86/entry/vdso;

  • variable declarations have been greatly simplified.


The latter means that you only need to declare your variable once, in arch/x86/include/asm/vvar.h, at a fixed offset, with the DECLARE_VVAR macro. To define it, use the DEFINE_VVAR macro; to access it, use the VVAR macro. The linked commit above has a number of examples (all the existing uses of shared variables).



You can’t recreate the behaviour of an arbitrary syscall in the vDSO, at least not without calling into the kernel in kernel mode. The vDSO is only really useful for calls which can be handled in user space; there aren’t many of those.






share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    I’m not sure there’s an updated tutorial in the same style, but the changes are limited:





    • arch/x86/vdso moved to arch/x86/entry/vdso;

    • variable declarations have been greatly simplified.


    The latter means that you only need to declare your variable once, in arch/x86/include/asm/vvar.h, at a fixed offset, with the DECLARE_VVAR macro. To define it, use the DEFINE_VVAR macro; to access it, use the VVAR macro. The linked commit above has a number of examples (all the existing uses of shared variables).



    You can’t recreate the behaviour of an arbitrary syscall in the vDSO, at least not without calling into the kernel in kernel mode. The vDSO is only really useful for calls which can be handled in user space; there aren’t many of those.






    share|improve this answer

























      up vote
      1
      down vote













      I’m not sure there’s an updated tutorial in the same style, but the changes are limited:





      • arch/x86/vdso moved to arch/x86/entry/vdso;

      • variable declarations have been greatly simplified.


      The latter means that you only need to declare your variable once, in arch/x86/include/asm/vvar.h, at a fixed offset, with the DECLARE_VVAR macro. To define it, use the DEFINE_VVAR macro; to access it, use the VVAR macro. The linked commit above has a number of examples (all the existing uses of shared variables).



      You can’t recreate the behaviour of an arbitrary syscall in the vDSO, at least not without calling into the kernel in kernel mode. The vDSO is only really useful for calls which can be handled in user space; there aren’t many of those.






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        I’m not sure there’s an updated tutorial in the same style, but the changes are limited:





        • arch/x86/vdso moved to arch/x86/entry/vdso;

        • variable declarations have been greatly simplified.


        The latter means that you only need to declare your variable once, in arch/x86/include/asm/vvar.h, at a fixed offset, with the DECLARE_VVAR macro. To define it, use the DEFINE_VVAR macro; to access it, use the VVAR macro. The linked commit above has a number of examples (all the existing uses of shared variables).



        You can’t recreate the behaviour of an arbitrary syscall in the vDSO, at least not without calling into the kernel in kernel mode. The vDSO is only really useful for calls which can be handled in user space; there aren’t many of those.






        share|improve this answer












        I’m not sure there’s an updated tutorial in the same style, but the changes are limited:





        • arch/x86/vdso moved to arch/x86/entry/vdso;

        • variable declarations have been greatly simplified.


        The latter means that you only need to declare your variable once, in arch/x86/include/asm/vvar.h, at a fixed offset, with the DECLARE_VVAR macro. To define it, use the DEFINE_VVAR macro; to access it, use the VVAR macro. The linked commit above has a number of examples (all the existing uses of shared variables).



        You can’t recreate the behaviour of an arbitrary syscall in the vDSO, at least not without calling into the kernel in kernel mode. The vDSO is only really useful for calls which can be handled in user space; there aren’t many of those.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        Stephen Kitt

        157k23343418




        157k23343418















            Popular posts from this blog

            Entries order in /etc/network/interfaces

            新発田市

            Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)