In CBC, can I use a zero IV and prepend my actual IV to the plaintext? I understand that in CBC mode, the IV must be chosen randomly for every use of the same key. 

But for practical purposes I would like to easily store the IV alongside the cyphertext.

So I thought of calling the encryption function with a zero IV and prepend my actual IV to the plaintext:

         IV         P1         P2
          │          │          │
          ▼          ▼          ▼
Zero ──▶ XOR   ┌──▶ XOR   ┌──▶ XOR   ┌──▶ ...
          │    │     │    │     │    │
          ▼    │     ▼    │     ▼    │
         AES   │    AES   │    AES   │
          │    │     │    │     │    │
          ├────┘     ├────┘     ├────┘
          ▼          ▼          ▼
         C1         C2         C3


The decryption function can be called with the same constant (zero) IV and then I can just discard the first block_len bytes to recover the plaintext.

Are there any security risks with this approach?
I can think of one security risk, though it can be mitigated:


If the attacker can guess your IV, then you are giving them an avenue to recover your key. Ie if they know the IV, then they can do a known-plaintext attack on the first block. If you use a cryptographically-secure random number for the IV, then it's probably fine.


As @AgentMe points out, this has already been discussed here:

Why is CBC with predictable IV considered insecure against chosen-plaintext attack?



More importantly, there are some efficiency losses by doing this:


You do an extra encryption round. This is probably not a big deal for most applications.
You inflate the size of the cyphertext by one block. This can be a big deal where the plaintext and cyphertext are required to be the same size - for example if the caller is expecting it to be encrypted in place in the same memory block.