From the Super Mario Wiki
L Blocks are a type of Block exclusive to the Mario & Luigi series. They are very similar to the ? Blocks, though only Luigi or Baby Luigi can activate them. M Blocks are similar to these blocks, however, M Blocks can only be activated by Mario or Baby Mario. In Mario and Luigi: Superstar Saga, they are often used to solve puzzles. In Mario & Luigi: Partners in Time, they can be found scattered through different places. They produce Bros. Items and other items, such as Mushrooms. In Mario & Luigi: Bowser's Inside Story, they are mainly used for minigames to earn Attack Pieces. They may also contain items for the Mario Bros. to collect.